From 2da8b6f4f206281da81d82e1b0233f0df522bc48 Mon Sep 17 00:00:00 2001 From: Tyson Thomas Date: Sat, 6 Sep 2025 13:20:04 -0700 Subject: [PATCH 1/7] wip: mcp tool --- config/gni/devtools_grd_files.gni | 17 + front_end/panels/ai_chat/BUILD.gn | 14 + .../agent_framework/ConfigurableAgentTool.ts | 2 +- .../implementation/ConfiguredAgents.ts | 3 + .../panels/ai_chat/core/AgentNodes.test.ts | 204 + front_end/panels/ai_chat/core/AgentNodes.ts | 32 +- .../ai_chat/core/ToolNameMapping.test.ts | 81 + .../ai_chat/core/ToolSurfaceProvider.test.ts | 136 + .../ai_chat/core/ToolSurfaceProvider.ts | 216 + .../panels/ai_chat/mcp/MCPClientSDK.test.ts | 136 + front_end/panels/ai_chat/mcp/MCPConfig.ts | 95 + front_end/panels/ai_chat/mcp/MCPMetaTools.ts | 204 + front_end/panels/ai_chat/mcp/MCPRegistry.ts | 153 + .../panels/ai_chat/mcp/MCPToolAdapter.ts | 54 + front_end/panels/ai_chat/ui/AIChatPanel.ts | 41 +- front_end/panels/ai_chat/ui/ChatView.ts | 4 +- front_end/panels/ai_chat/ui/SettingsDialog.ts | 589 +- .../third_party/additional_readme_paths.json | 1 + front_end/third_party/mcp-sdk/BUILD.gn | 57 + front_end/third_party/mcp-sdk/LICENSE | 21 + front_end/third_party/mcp-sdk/README.chromium | 24 + .../mcp-sdk/ajv/.runkit_example.js | 23 + front_end/third_party/mcp-sdk/ajv/LICENSE | 22 + front_end/third_party/mcp-sdk/ajv/README.md | 207 + .../third_party/mcp-sdk/ajv/dist/2019.d.ts | 19 + .../third_party/mcp-sdk/ajv/dist/2019.js | 61 + .../third_party/mcp-sdk/ajv/dist/2019.js.map | 1 + .../third_party/mcp-sdk/ajv/dist/2020.d.ts | 19 + .../third_party/mcp-sdk/ajv/dist/2020.js | 55 + .../third_party/mcp-sdk/ajv/dist/2020.js.map | 1 + .../third_party/mcp-sdk/ajv/dist/ajv.d.ts | 18 + front_end/third_party/mcp-sdk/ajv/dist/ajv.js | 50 + .../third_party/mcp-sdk/ajv/dist/ajv.js.map | 1 + .../third_party/mcp-sdk/ajv/dist/cjs/cli.d.ts | 2 + .../mcp-sdk/ajv/dist/cjs/cli.d.ts.map | 1 + .../third_party/mcp-sdk/ajv/dist/cjs/cli.js | 131 + .../mcp-sdk/ajv/dist/cjs/cli.js.map | 1 + .../mcp-sdk/ajv/dist/cjs/client/auth.d.ts | 139 + .../mcp-sdk/ajv/dist/cjs/client/auth.d.ts.map | 1 + .../mcp-sdk/ajv/dist/cjs/client/auth.js | 340 + .../mcp-sdk/ajv/dist/cjs/client/auth.js.map | 1 + .../mcp-sdk/ajv/dist/cjs/client/index.d.ts | 942 + .../ajv/dist/cjs/client/index.d.ts.map | 1 + .../mcp-sdk/ajv/dist/cjs/client/index.js | 286 + .../mcp-sdk/ajv/dist/cjs/client/index.js.map | 1 + .../mcp-sdk/ajv/dist/cjs/client/sse.d.ts | 71 + .../mcp-sdk/ajv/dist/cjs/client/sse.d.ts.map | 1 + .../mcp-sdk/ajv/dist/cjs/client/sse.js | 176 + .../mcp-sdk/ajv/dist/cjs/client/sse.js.map | 1 + .../mcp-sdk/ajv/dist/cjs/client/stdio.d.ts | 72 + .../ajv/dist/cjs/client/stdio.d.ts.map | 1 + .../mcp-sdk/ajv/dist/cjs/client/stdio.js | 170 + .../mcp-sdk/ajv/dist/cjs/client/stdio.js.map | 1 + .../ajv/dist/cjs/client/streamableHttp.d.ts | 125 + .../dist/cjs/client/streamableHttp.d.ts.map | 1 + .../ajv/dist/cjs/client/streamableHttp.js | 355 + .../ajv/dist/cjs/client/streamableHttp.js.map | 1 + .../ajv/dist/cjs/client/websocket.d.ts | 17 + .../ajv/dist/cjs/client/websocket.d.ts.map | 1 + .../mcp-sdk/ajv/dist/cjs/client/websocket.js | 65 + .../ajv/dist/cjs/client/websocket.js.map | 1 + .../client/multipleClientsParallel.d.ts | 2 + .../client/multipleClientsParallel.d.ts.map | 1 + .../client/multipleClientsParallel.js | 134 + .../client/multipleClientsParallel.js.map | 1 + .../client/parallelToolCallsClient.d.ts | 2 + .../client/parallelToolCallsClient.d.ts.map | 1 + .../client/parallelToolCallsClient.js | 175 + .../client/parallelToolCallsClient.js.map | 1 + .../examples/client/simpleOAuthClient.d.ts | 3 + .../client/simpleOAuthClient.d.ts.map | 1 + .../cjs/examples/client/simpleOAuthClient.js | 372 + .../examples/client/simpleOAuthClient.js.map | 1 + .../examples/client/simpleStreamableHttp.d.ts | 2 + .../client/simpleStreamableHttp.d.ts.map | 1 + .../examples/client/simpleStreamableHttp.js | 487 + .../client/simpleStreamableHttp.js.map | 1 + .../streamableHttpWithSseFallbackClient.d.ts | 2 + ...reamableHttpWithSseFallbackClient.d.ts.map | 1 + .../streamableHttpWithSseFallbackClient.js | 168 + ...streamableHttpWithSseFallbackClient.js.map | 1 + .../server/demoInMemoryOAuthProvider.d.ts | 70 + .../server/demoInMemoryOAuthProvider.d.ts.map | 1 + .../server/demoInMemoryOAuthProvider.js | 165 + .../server/demoInMemoryOAuthProvider.js.map | 1 + .../server/jsonResponseStreamableHttp.d.ts | 2 + .../jsonResponseStreamableHttp.d.ts.map | 1 + .../server/jsonResponseStreamableHttp.js | 142 + .../server/jsonResponseStreamableHttp.js.map | 1 + .../server/mcpServerOutputSchema.d.ts | 7 + .../server/mcpServerOutputSchema.d.ts.map | 1 + .../examples/server/mcpServerOutputSchema.js | 70 + .../server/mcpServerOutputSchema.js.map | 1 + .../cjs/examples/server/simpleSseServer.d.ts | 2 + .../examples/server/simpleSseServer.d.ts.map | 1 + .../cjs/examples/server/simpleSseServer.js | 148 + .../examples/server/simpleSseServer.js.map | 1 + .../server/simpleStatelessStreamableHttp.d.ts | 2 + .../simpleStatelessStreamableHttp.d.ts.map | 1 + .../server/simpleStatelessStreamableHttp.js | 140 + .../simpleStatelessStreamableHttp.js.map | 1 + .../examples/server/simpleStreamableHttp.d.ts | 2 + .../server/simpleStreamableHttp.d.ts.map | 1 + .../examples/server/simpleStreamableHttp.js | 338 + .../server/simpleStreamableHttp.js.map | 1 + .../sseAndStreamableHttpCompatibleServer.d.ts | 2 + ...AndStreamableHttpCompatibleServer.d.ts.map | 1 + .../sseAndStreamableHttpCompatibleServer.js | 233 + ...seAndStreamableHttpCompatibleServer.js.map | 1 + .../standaloneSseWithGetStreamableHttp.d.ts | 2 + ...tandaloneSseWithGetStreamableHttp.d.ts.map | 1 + .../standaloneSseWithGetStreamableHttp.js | 112 + .../standaloneSseWithGetStreamableHttp.js.map | 1 + .../examples/shared/inMemoryEventStore.d.ts | 31 + .../shared/inMemoryEventStore.d.ts.map | 1 + .../cjs/examples/shared/inMemoryEventStore.js | 69 + .../examples/shared/inMemoryEventStore.js.map | 1 + .../mcp-sdk/ajv/dist/cjs/inMemory.d.ts | 31 + .../mcp-sdk/ajv/dist/cjs/inMemory.d.ts.map | 1 + .../mcp-sdk/ajv/dist/cjs/inMemory.js | 53 + .../mcp-sdk/ajv/dist/cjs/inMemory.js.map | 1 + .../mcp-sdk/ajv/dist/cjs/package.json | 1 + .../ajv/dist/cjs/server/auth/clients.d.ts | 19 + .../ajv/dist/cjs/server/auth/clients.d.ts.map | 1 + .../ajv/dist/cjs/server/auth/clients.js | 3 + .../ajv/dist/cjs/server/auth/clients.js.map | 1 + .../ajv/dist/cjs/server/auth/errors.d.ts | 126 + .../ajv/dist/cjs/server/auth/errors.d.ts.map | 1 + .../ajv/dist/cjs/server/auth/errors.js | 189 + .../ajv/dist/cjs/server/auth/errors.js.map | 1 + .../cjs/server/auth/handlers/authorize.d.ts | 13 + .../server/auth/handlers/authorize.d.ts.map | 1 + .../cjs/server/auth/handlers/authorize.js | 149 + .../cjs/server/auth/handlers/authorize.js.map | 1 + .../cjs/server/auth/handlers/metadata.d.ts | 4 + .../server/auth/handlers/metadata.d.ts.map | 1 + .../dist/cjs/server/auth/handlers/metadata.js | 21 + .../cjs/server/auth/handlers/metadata.js.map | 1 + .../cjs/server/auth/handlers/register.d.ts | 23 + .../server/auth/handlers/register.d.ts.map | 1 + .../dist/cjs/server/auth/handlers/register.js | 79 + .../cjs/server/auth/handlers/register.js.map | 1 + .../dist/cjs/server/auth/handlers/revoke.d.ts | 13 + .../cjs/server/auth/handlers/revoke.d.ts.map | 1 + .../dist/cjs/server/auth/handlers/revoke.js | 67 + .../cjs/server/auth/handlers/revoke.js.map | 1 + .../dist/cjs/server/auth/handlers/token.d.ts | 13 + .../cjs/server/auth/handlers/token.d.ts.map | 1 + .../dist/cjs/server/auth/handlers/token.js | 113 + .../cjs/server/auth/handlers/token.js.map | 1 + .../auth/middleware/allowedMethods.d.ts | 9 + .../auth/middleware/allowedMethods.d.ts.map | 1 + .../server/auth/middleware/allowedMethods.js | 23 + .../auth/middleware/allowedMethods.js.map | 1 + .../server/auth/middleware/bearerAuth.d.ts | 35 + .../auth/middleware/bearerAuth.d.ts.map | 1 + .../cjs/server/auth/middleware/bearerAuth.js | 68 + .../server/auth/middleware/bearerAuth.js.map | 1 + .../server/auth/middleware/clientAuth.d.ts | 19 + .../auth/middleware/clientAuth.d.ts.map | 1 + .../cjs/server/auth/middleware/clientAuth.js | 53 + .../server/auth/middleware/clientAuth.js.map | 1 + .../ajv/dist/cjs/server/auth/provider.d.ts | 67 + .../dist/cjs/server/auth/provider.d.ts.map | 1 + .../ajv/dist/cjs/server/auth/provider.js | 3 + .../ajv/dist/cjs/server/auth/provider.js.map | 1 + .../server/auth/providers/proxyProvider.d.ts | 43 + .../auth/providers/proxyProvider.d.ts.map | 1 + .../server/auth/providers/proxyProvider.js | 148 + .../auth/providers/proxyProvider.js.map | 1 + .../ajv/dist/cjs/server/auth/router.d.ts | 96 + .../ajv/dist/cjs/server/auth/router.d.ts.map | 1 + .../ajv/dist/cjs/server/auth/router.js | 122 + .../ajv/dist/cjs/server/auth/router.js.map | 1 + .../ajv/dist/cjs/server/auth/types.d.ts | 27 + .../ajv/dist/cjs/server/auth/types.d.ts.map | 1 + .../mcp-sdk/ajv/dist/cjs/server/auth/types.js | 3 + .../ajv/dist/cjs/server/auth/types.js.map | 1 + .../ajv/dist/cjs/server/completable.d.ts | 22 + .../ajv/dist/cjs/server/completable.d.ts.map | 1 + .../ajv/dist/cjs/server/completable.js | 65 + .../ajv/dist/cjs/server/completable.js.map | 1 + .../mcp-sdk/ajv/dist/cjs/server/index.d.ts | 135 + .../ajv/dist/cjs/server/index.d.ts.map | 1 + .../mcp-sdk/ajv/dist/cjs/server/index.js | 200 + .../mcp-sdk/ajv/dist/cjs/server/index.js.map | 1 + .../mcp-sdk/ajv/dist/cjs/server/mcp.d.ts | 271 + .../mcp-sdk/ajv/dist/cjs/server/mcp.d.ts.map | 1 + .../mcp-sdk/ajv/dist/cjs/server/mcp.js | 608 + .../mcp-sdk/ajv/dist/cjs/server/mcp.js.map | 1 + .../mcp-sdk/ajv/dist/cjs/server/sse.d.ts | 53 + .../mcp-sdk/ajv/dist/cjs/server/sse.d.ts.map | 1 + .../mcp-sdk/ajv/dist/cjs/server/sse.js | 132 + .../mcp-sdk/ajv/dist/cjs/server/sse.js.map | 1 + .../mcp-sdk/ajv/dist/cjs/server/stdio.d.ts | 28 + .../ajv/dist/cjs/server/stdio.d.ts.map | 1 + .../mcp-sdk/ajv/dist/cjs/server/stdio.js | 85 + .../mcp-sdk/ajv/dist/cjs/server/stdio.js.map | 1 + .../ajv/dist/cjs/server/streamableHttp.d.ts | 151 + .../dist/cjs/server/streamableHttp.d.ts.map | 1 + .../ajv/dist/cjs/server/streamableHttp.js | 539 + .../ajv/dist/cjs/server/streamableHttp.js.map | 1 + .../mcp-sdk/ajv/dist/cjs/shared/auth.d.ts | 321 + .../mcp-sdk/ajv/dist/cjs/shared/auth.d.ts.map | 1 + .../mcp-sdk/ajv/dist/cjs/shared/auth.js | 127 + .../mcp-sdk/ajv/dist/cjs/shared/auth.js.map | 1 + .../mcp-sdk/ajv/dist/cjs/shared/protocol.d.ts | 217 + .../ajv/dist/cjs/shared/protocol.d.ts.map | 1 + .../mcp-sdk/ajv/dist/cjs/shared/protocol.js | 374 + .../ajv/dist/cjs/shared/protocol.js.map | 1 + .../mcp-sdk/ajv/dist/cjs/shared/stdio.d.ts | 13 + .../ajv/dist/cjs/shared/stdio.d.ts.map | 1 + .../mcp-sdk/ajv/dist/cjs/shared/stdio.js | 37 + .../mcp-sdk/ajv/dist/cjs/shared/stdio.js.map | 1 + .../ajv/dist/cjs/shared/transport.d.ts | 72 + .../ajv/dist/cjs/shared/transport.d.ts.map | 1 + .../mcp-sdk/ajv/dist/cjs/shared/transport.js | 3 + .../ajv/dist/cjs/shared/transport.js.map | 1 + .../ajv/dist/cjs/shared/uriTemplate.d.ts | 25 + .../ajv/dist/cjs/shared/uriTemplate.d.ts.map | 1 + .../ajv/dist/cjs/shared/uriTemplate.js | 245 + .../ajv/dist/cjs/shared/uriTemplate.js.map | 1 + .../mcp-sdk/ajv/dist/cjs/types.d.ts | 31751 ++++++++++++++++ .../mcp-sdk/ajv/dist/cjs/types.d.ts.map | 1 + .../third_party/mcp-sdk/ajv/dist/cjs/types.js | 1146 + .../mcp-sdk/ajv/dist/cjs/types.js.map | 1 + .../ajv/dist/compile/codegen/code.d.ts | 40 + .../mcp-sdk/ajv/dist/compile/codegen/code.js | 156 + .../ajv/dist/compile/codegen/code.js.map | 1 + .../ajv/dist/compile/codegen/index.d.ts | 79 + .../mcp-sdk/ajv/dist/compile/codegen/index.js | 697 + .../ajv/dist/compile/codegen/index.js.map | 1 + .../ajv/dist/compile/codegen/scope.d.ts | 79 + .../mcp-sdk/ajv/dist/compile/codegen/scope.js | 143 + .../ajv/dist/compile/codegen/scope.js.map | 1 + .../mcp-sdk/ajv/dist/compile/errors.d.ts | 13 + .../mcp-sdk/ajv/dist/compile/errors.js | 123 + .../mcp-sdk/ajv/dist/compile/errors.js.map | 1 + .../mcp-sdk/ajv/dist/compile/index.d.ts | 80 + .../mcp-sdk/ajv/dist/compile/index.js | 242 + .../mcp-sdk/ajv/dist/compile/index.js.map | 1 + .../mcp-sdk/ajv/dist/compile/jtd/parse.d.ts | 4 + .../mcp-sdk/ajv/dist/compile/jtd/parse.js | 350 + .../mcp-sdk/ajv/dist/compile/jtd/parse.js.map | 1 + .../ajv/dist/compile/jtd/serialize.d.ts | 4 + .../mcp-sdk/ajv/dist/compile/jtd/serialize.js | 229 + .../ajv/dist/compile/jtd/serialize.js.map | 1 + .../mcp-sdk/ajv/dist/compile/jtd/types.d.ts | 6 + .../mcp-sdk/ajv/dist/compile/jtd/types.js | 14 + .../mcp-sdk/ajv/dist/compile/jtd/types.js.map | 1 + .../mcp-sdk/ajv/dist/compile/names.d.ts | 20 + .../mcp-sdk/ajv/dist/compile/names.js | 28 + .../mcp-sdk/ajv/dist/compile/names.js.map | 1 + .../mcp-sdk/ajv/dist/compile/ref_error.d.ts | 6 + .../mcp-sdk/ajv/dist/compile/ref_error.js | 12 + .../mcp-sdk/ajv/dist/compile/ref_error.js.map | 1 + .../mcp-sdk/ajv/dist/compile/resolve.d.ts | 12 + .../mcp-sdk/ajv/dist/compile/resolve.js | 155 + .../mcp-sdk/ajv/dist/compile/resolve.js.map | 1 + .../mcp-sdk/ajv/dist/compile/rules.d.ts | 28 + .../mcp-sdk/ajv/dist/compile/rules.js | 26 + .../mcp-sdk/ajv/dist/compile/rules.js.map | 1 + .../mcp-sdk/ajv/dist/compile/util.d.ts | 40 + .../mcp-sdk/ajv/dist/compile/util.js | 178 + .../mcp-sdk/ajv/dist/compile/util.js.map | 1 + .../dist/compile/validate/applicability.d.ts | 6 + .../dist/compile/validate/applicability.js | 19 + .../compile/validate/applicability.js.map | 1 + .../ajv/dist/compile/validate/boolSchema.d.ts | 4 + .../ajv/dist/compile/validate/boolSchema.js | 50 + .../dist/compile/validate/boolSchema.js.map | 1 + .../ajv/dist/compile/validate/dataType.d.ts | 17 + .../ajv/dist/compile/validate/dataType.js | 203 + .../ajv/dist/compile/validate/dataType.js.map | 1 + .../ajv/dist/compile/validate/defaults.d.ts | 2 + .../ajv/dist/compile/validate/defaults.js | 35 + .../ajv/dist/compile/validate/defaults.js.map | 1 + .../ajv/dist/compile/validate/index.d.ts | 42 + .../ajv/dist/compile/validate/index.js | 520 + .../ajv/dist/compile/validate/index.js.map | 1 + .../ajv/dist/compile/validate/keyword.d.ts | 8 + .../ajv/dist/compile/validate/keyword.js | 124 + .../ajv/dist/compile/validate/keyword.js.map | 1 + .../ajv/dist/compile/validate/subschema.d.ts | 47 + .../ajv/dist/compile/validate/subschema.js | 81 + .../dist/compile/validate/subschema.js.map | 1 + .../third_party/mcp-sdk/ajv/dist/core.d.ts | 173 + .../third_party/mcp-sdk/ajv/dist/core.js | 618 + .../third_party/mcp-sdk/ajv/dist/core.js.map | 1 + .../third_party/mcp-sdk/ajv/dist/esm/cli.d.ts | 2 + .../mcp-sdk/ajv/dist/esm/cli.d.ts.map | 1 + .../third_party/mcp-sdk/ajv/dist/esm/cli.js | 126 + .../mcp-sdk/ajv/dist/esm/cli.js.map | 1 + .../mcp-sdk/ajv/dist/esm/client/auth.d.ts | 139 + .../mcp-sdk/ajv/dist/esm/client/auth.d.ts.map | 1 + .../mcp-sdk/ajv/dist/esm/client/auth.js | 325 + .../mcp-sdk/ajv/dist/esm/client/auth.js.map | 1 + .../mcp-sdk/ajv/dist/esm/client/index.d.ts | 942 + .../ajv/dist/esm/client/index.d.ts.map | 1 + .../mcp-sdk/ajv/dist/esm/client/index.js | 279 + .../mcp-sdk/ajv/dist/esm/client/index.js.map | 1 + .../mcp-sdk/ajv/dist/esm/client/sse.d.ts | 71 + .../mcp-sdk/ajv/dist/esm/client/sse.d.ts.map | 1 + .../mcp-sdk/ajv/dist/esm/client/sse.js | 171 + .../mcp-sdk/ajv/dist/esm/client/sse.js.map | 1 + .../mcp-sdk/ajv/dist/esm/client/stdio.d.ts | 72 + .../ajv/dist/esm/client/stdio.d.ts.map | 1 + .../mcp-sdk/ajv/dist/esm/client/stdio.js | 162 + .../mcp-sdk/ajv/dist/esm/client/stdio.js.map | 1 + .../ajv/dist/esm/client/streamableHttp.d.ts | 125 + .../dist/esm/client/streamableHttp.d.ts.map | 1 + .../ajv/dist/esm/client/streamableHttp.js | 350 + .../ajv/dist/esm/client/streamableHttp.js.map | 1 + .../ajv/dist/esm/client/websocket.d.ts | 17 + .../ajv/dist/esm/client/websocket.d.ts.map | 1 + .../mcp-sdk/ajv/dist/esm/client/websocket.js | 61 + .../ajv/dist/esm/client/websocket.js.map | 1 + .../client/multipleClientsParallel.d.ts | 2 + .../client/multipleClientsParallel.d.ts.map | 1 + .../client/multipleClientsParallel.js | 132 + .../client/multipleClientsParallel.js.map | 1 + .../client/parallelToolCallsClient.d.ts | 2 + .../client/parallelToolCallsClient.d.ts.map | 1 + .../client/parallelToolCallsClient.js | 173 + .../client/parallelToolCallsClient.js.map | 1 + .../examples/client/simpleOAuthClient.d.ts | 3 + .../client/simpleOAuthClient.d.ts.map | 1 + .../esm/examples/client/simpleOAuthClient.js | 370 + .../examples/client/simpleOAuthClient.js.map | 1 + .../examples/client/simpleStreamableHttp.d.ts | 2 + .../client/simpleStreamableHttp.d.ts.map | 1 + .../examples/client/simpleStreamableHttp.js | 485 + .../client/simpleStreamableHttp.js.map | 1 + .../streamableHttpWithSseFallbackClient.d.ts | 2 + ...reamableHttpWithSseFallbackClient.d.ts.map | 1 + .../streamableHttpWithSseFallbackClient.js | 166 + ...streamableHttpWithSseFallbackClient.js.map | 1 + .../server/demoInMemoryOAuthProvider.d.ts | 70 + .../server/demoInMemoryOAuthProvider.d.ts.map | 1 + .../server/demoInMemoryOAuthProvider.js | 156 + .../server/demoInMemoryOAuthProvider.js.map | 1 + .../server/jsonResponseStreamableHttp.d.ts | 2 + .../jsonResponseStreamableHttp.d.ts.map | 1 + .../server/jsonResponseStreamableHttp.js | 137 + .../server/jsonResponseStreamableHttp.js.map | 1 + .../server/mcpServerOutputSchema.d.ts | 7 + .../server/mcpServerOutputSchema.d.ts.map | 1 + .../examples/server/mcpServerOutputSchema.js | 68 + .../server/mcpServerOutputSchema.js.map | 1 + .../esm/examples/server/simpleSseServer.d.ts | 2 + .../examples/server/simpleSseServer.d.ts.map | 1 + .../esm/examples/server/simpleSseServer.js | 143 + .../examples/server/simpleSseServer.js.map | 1 + .../server/simpleStatelessStreamableHttp.d.ts | 2 + .../simpleStatelessStreamableHttp.d.ts.map | 1 + .../server/simpleStatelessStreamableHttp.js | 135 + .../simpleStatelessStreamableHttp.js.map | 1 + .../examples/server/simpleStreamableHttp.d.ts | 2 + .../server/simpleStreamableHttp.d.ts.map | 1 + .../examples/server/simpleStreamableHttp.js | 333 + .../server/simpleStreamableHttp.js.map | 1 + .../sseAndStreamableHttpCompatibleServer.d.ts | 2 + ...AndStreamableHttpCompatibleServer.d.ts.map | 1 + .../sseAndStreamableHttpCompatibleServer.js | 228 + ...seAndStreamableHttpCompatibleServer.js.map | 1 + .../standaloneSseWithGetStreamableHttp.d.ts | 2 + ...tandaloneSseWithGetStreamableHttp.d.ts.map | 1 + .../standaloneSseWithGetStreamableHttp.js | 107 + .../standaloneSseWithGetStreamableHttp.js.map | 1 + .../examples/shared/inMemoryEventStore.d.ts | 31 + .../shared/inMemoryEventStore.d.ts.map | 1 + .../esm/examples/shared/inMemoryEventStore.js | 65 + .../examples/shared/inMemoryEventStore.js.map | 1 + .../mcp-sdk/ajv/dist/esm/inMemory.d.ts | 31 + .../mcp-sdk/ajv/dist/esm/inMemory.d.ts.map | 1 + .../mcp-sdk/ajv/dist/esm/inMemory.js | 49 + .../mcp-sdk/ajv/dist/esm/inMemory.js.map | 1 + .../mcp-sdk/ajv/dist/esm/package.json | 1 + .../ajv/dist/esm/server/auth/clients.d.ts | 19 + .../ajv/dist/esm/server/auth/clients.d.ts.map | 1 + .../ajv/dist/esm/server/auth/clients.js | 2 + .../ajv/dist/esm/server/auth/clients.js.map | 1 + .../ajv/dist/esm/server/auth/errors.d.ts | 126 + .../ajv/dist/esm/server/auth/errors.d.ts.map | 1 + .../ajv/dist/esm/server/auth/errors.js | 169 + .../ajv/dist/esm/server/auth/errors.js.map | 1 + .../esm/server/auth/handlers/authorize.d.ts | 13 + .../server/auth/handlers/authorize.d.ts.map | 1 + .../esm/server/auth/handlers/authorize.js | 143 + .../esm/server/auth/handlers/authorize.js.map | 1 + .../esm/server/auth/handlers/metadata.d.ts | 4 + .../server/auth/handlers/metadata.d.ts.map | 1 + .../dist/esm/server/auth/handlers/metadata.js | 15 + .../esm/server/auth/handlers/metadata.js.map | 1 + .../esm/server/auth/handlers/register.d.ts | 23 + .../server/auth/handlers/register.d.ts.map | 1 + .../dist/esm/server/auth/handlers/register.js | 73 + .../esm/server/auth/handlers/register.js.map | 1 + .../dist/esm/server/auth/handlers/revoke.d.ts | 13 + .../esm/server/auth/handlers/revoke.d.ts.map | 1 + .../dist/esm/server/auth/handlers/revoke.js | 61 + .../esm/server/auth/handlers/revoke.js.map | 1 + .../dist/esm/server/auth/handlers/token.d.ts | 13 + .../esm/server/auth/handlers/token.d.ts.map | 1 + .../dist/esm/server/auth/handlers/token.js | 107 + .../esm/server/auth/handlers/token.js.map | 1 + .../auth/middleware/allowedMethods.d.ts | 9 + .../auth/middleware/allowedMethods.d.ts.map | 1 + .../server/auth/middleware/allowedMethods.js | 20 + .../auth/middleware/allowedMethods.js.map | 1 + .../server/auth/middleware/bearerAuth.d.ts | 35 + .../auth/middleware/bearerAuth.d.ts.map | 1 + .../esm/server/auth/middleware/bearerAuth.js | 65 + .../server/auth/middleware/bearerAuth.js.map | 1 + .../server/auth/middleware/clientAuth.d.ts | 19 + .../auth/middleware/clientAuth.d.ts.map | 1 + .../esm/server/auth/middleware/clientAuth.js | 50 + .../server/auth/middleware/clientAuth.js.map | 1 + .../ajv/dist/esm/server/auth/provider.d.ts | 67 + .../dist/esm/server/auth/provider.d.ts.map | 1 + .../ajv/dist/esm/server/auth/provider.js | 2 + .../ajv/dist/esm/server/auth/provider.js.map | 1 + .../server/auth/providers/proxyProvider.d.ts | 43 + .../auth/providers/proxyProvider.d.ts.map | 1 + .../server/auth/providers/proxyProvider.js | 144 + .../auth/providers/proxyProvider.js.map | 1 + .../ajv/dist/esm/server/auth/router.d.ts | 96 + .../ajv/dist/esm/server/auth/router.d.ts.map | 1 + .../ajv/dist/esm/server/auth/router.js | 112 + .../ajv/dist/esm/server/auth/router.js.map | 1 + .../ajv/dist/esm/server/auth/types.d.ts | 27 + .../ajv/dist/esm/server/auth/types.d.ts.map | 1 + .../mcp-sdk/ajv/dist/esm/server/auth/types.js | 2 + .../ajv/dist/esm/server/auth/types.js.map | 1 + .../ajv/dist/esm/server/completable.d.ts | 22 + .../ajv/dist/esm/server/completable.d.ts.map | 1 + .../ajv/dist/esm/server/completable.js | 60 + .../ajv/dist/esm/server/completable.js.map | 1 + .../mcp-sdk/ajv/dist/esm/server/index.d.ts | 135 + .../ajv/dist/esm/server/index.d.ts.map | 1 + .../mcp-sdk/ajv/dist/esm/server/index.js | 196 + .../mcp-sdk/ajv/dist/esm/server/index.js.map | 1 + .../mcp-sdk/ajv/dist/esm/server/mcp.d.ts | 271 + .../mcp-sdk/ajv/dist/esm/server/mcp.d.ts.map | 1 + .../mcp-sdk/ajv/dist/esm/server/mcp.js | 603 + .../mcp-sdk/ajv/dist/esm/server/mcp.js.map | 1 + .../mcp-sdk/ajv/dist/esm/server/sse.d.ts | 53 + .../mcp-sdk/ajv/dist/esm/server/sse.d.ts.map | 1 + .../mcp-sdk/ajv/dist/esm/server/sse.js | 125 + .../mcp-sdk/ajv/dist/esm/server/sse.js.map | 1 + .../mcp-sdk/ajv/dist/esm/server/stdio.d.ts | 28 + .../ajv/dist/esm/server/stdio.d.ts.map | 1 + .../mcp-sdk/ajv/dist/esm/server/stdio.js | 78 + .../mcp-sdk/ajv/dist/esm/server/stdio.js.map | 1 + .../ajv/dist/esm/server/streamableHttp.d.ts | 151 + .../dist/esm/server/streamableHttp.d.ts.map | 1 + .../ajv/dist/esm/server/streamableHttp.js | 532 + .../ajv/dist/esm/server/streamableHttp.js.map | 1 + .../mcp-sdk/ajv/dist/esm/shared/auth.d.ts | 321 + .../mcp-sdk/ajv/dist/esm/shared/auth.d.ts.map | 1 + .../mcp-sdk/ajv/dist/esm/shared/auth.js | 124 + .../mcp-sdk/ajv/dist/esm/shared/auth.js.map | 1 + .../mcp-sdk/ajv/dist/esm/shared/protocol.d.ts | 217 + .../ajv/dist/esm/shared/protocol.d.ts.map | 1 + .../mcp-sdk/ajv/dist/esm/shared/protocol.js | 369 + .../ajv/dist/esm/shared/protocol.js.map | 1 + .../mcp-sdk/ajv/dist/esm/shared/stdio.d.ts | 13 + .../ajv/dist/esm/shared/stdio.d.ts.map | 1 + .../mcp-sdk/ajv/dist/esm/shared/stdio.js | 31 + .../mcp-sdk/ajv/dist/esm/shared/stdio.js.map | 1 + .../ajv/dist/esm/shared/transport.d.ts | 72 + .../ajv/dist/esm/shared/transport.d.ts.map | 1 + .../mcp-sdk/ajv/dist/esm/shared/transport.js | 2 + .../ajv/dist/esm/shared/transport.js.map | 1 + .../ajv/dist/esm/shared/uriTemplate.d.ts | 25 + .../ajv/dist/esm/shared/uriTemplate.d.ts.map | 1 + .../ajv/dist/esm/shared/uriTemplate.js | 241 + .../ajv/dist/esm/shared/uriTemplate.js.map | 1 + .../mcp-sdk/ajv/dist/esm/types.d.ts | 31751 ++++++++++++++++ .../mcp-sdk/ajv/dist/esm/types.d.ts.map | 1 + .../third_party/mcp-sdk/ajv/dist/esm/types.js | 1135 + .../mcp-sdk/ajv/dist/esm/types.js.map | 1 + .../third_party/mcp-sdk/ajv/dist/jtd.d.ts | 47 + front_end/third_party/mcp-sdk/ajv/dist/jtd.js | 72 + .../third_party/mcp-sdk/ajv/dist/jtd.js.map | 1 + .../mcp-sdk/ajv/dist/refs/data.json | 13 + .../dist/refs/json-schema-2019-09/index.d.ts | 2 + .../dist/refs/json-schema-2019-09/index.js | 28 + .../refs/json-schema-2019-09/index.js.map | 1 + .../json-schema-2019-09/meta/applicator.json | 53 + .../json-schema-2019-09/meta/content.json | 17 + .../refs/json-schema-2019-09/meta/core.json | 57 + .../refs/json-schema-2019-09/meta/format.json | 14 + .../json-schema-2019-09/meta/meta-data.json | 37 + .../json-schema-2019-09/meta/validation.json | 90 + .../dist/refs/json-schema-2019-09/schema.json | 39 + .../dist/refs/json-schema-2020-12/index.d.ts | 2 + .../dist/refs/json-schema-2020-12/index.js | 30 + .../refs/json-schema-2020-12/index.js.map | 1 + .../json-schema-2020-12/meta/applicator.json | 48 + .../json-schema-2020-12/meta/content.json | 17 + .../refs/json-schema-2020-12/meta/core.json | 51 + .../meta/format-annotation.json | 14 + .../json-schema-2020-12/meta/meta-data.json | 37 + .../json-schema-2020-12/meta/unevaluated.json | 15 + .../json-schema-2020-12/meta/validation.json | 90 + .../dist/refs/json-schema-2020-12/schema.json | 55 + .../ajv/dist/refs/json-schema-draft-06.json | 137 + .../ajv/dist/refs/json-schema-draft-07.json | 151 + .../ajv/dist/refs/json-schema-secure.json | 88 + .../mcp-sdk/ajv/dist/refs/jtd-schema.d.ts | 3 + .../mcp-sdk/ajv/dist/refs/jtd-schema.js | 118 + .../mcp-sdk/ajv/dist/refs/jtd-schema.js.map | 1 + .../mcp-sdk/ajv/dist/runtime/equal.d.ts | 6 + .../mcp-sdk/ajv/dist/runtime/equal.js | 7 + .../mcp-sdk/ajv/dist/runtime/equal.js.map | 1 + .../mcp-sdk/ajv/dist/runtime/parseJson.d.ts | 18 + .../mcp-sdk/ajv/dist/runtime/parseJson.js | 185 + .../mcp-sdk/ajv/dist/runtime/parseJson.js.map | 1 + .../mcp-sdk/ajv/dist/runtime/quote.d.ts | 5 + .../mcp-sdk/ajv/dist/runtime/quote.js | 30 + .../mcp-sdk/ajv/dist/runtime/quote.js.map | 1 + .../mcp-sdk/ajv/dist/runtime/re2.d.ts | 6 + .../mcp-sdk/ajv/dist/runtime/re2.js | 6 + .../mcp-sdk/ajv/dist/runtime/re2.js.map | 1 + .../mcp-sdk/ajv/dist/runtime/timestamp.d.ts | 5 + .../mcp-sdk/ajv/dist/runtime/timestamp.js | 42 + .../mcp-sdk/ajv/dist/runtime/timestamp.js.map | 1 + .../mcp-sdk/ajv/dist/runtime/ucs2length.d.ts | 5 + .../mcp-sdk/ajv/dist/runtime/ucs2length.js | 24 + .../ajv/dist/runtime/ucs2length.js.map | 1 + .../mcp-sdk/ajv/dist/runtime/uri.d.ts | 6 + .../mcp-sdk/ajv/dist/runtime/uri.js | 6 + .../mcp-sdk/ajv/dist/runtime/uri.js.map | 1 + .../ajv/dist/runtime/validation_error.d.ts | 7 + .../ajv/dist/runtime/validation_error.js | 11 + .../ajv/dist/runtime/validation_error.js.map | 1 + .../mcp-sdk/ajv/dist/standalone/index.d.ts | 6 + .../mcp-sdk/ajv/dist/standalone/index.js | 90 + .../mcp-sdk/ajv/dist/standalone/index.js.map | 1 + .../mcp-sdk/ajv/dist/standalone/instance.d.ts | 12 + .../mcp-sdk/ajv/dist/standalone/instance.js | 35 + .../ajv/dist/standalone/instance.js.map | 1 + .../mcp-sdk/ajv/dist/types/index.d.ts | 183 + .../mcp-sdk/ajv/dist/types/index.js | 3 + .../mcp-sdk/ajv/dist/types/index.js.map | 1 + .../mcp-sdk/ajv/dist/types/json-schema.d.ts | 125 + .../mcp-sdk/ajv/dist/types/json-schema.js | 3 + .../mcp-sdk/ajv/dist/types/json-schema.js.map | 1 + .../mcp-sdk/ajv/dist/types/jtd-schema.d.ts | 174 + .../mcp-sdk/ajv/dist/types/jtd-schema.js | 3 + .../mcp-sdk/ajv/dist/types/jtd-schema.js.map | 1 + .../applicator/additionalItems.d.ts | 8 + .../applicator/additionalItems.js | 49 + .../applicator/additionalItems.js.map | 1 + .../applicator/additionalProperties.d.ts | 6 + .../applicator/additionalProperties.js | 106 + .../applicator/additionalProperties.js.map | 1 + .../dist/vocabularies/applicator/allOf.d.ts | 3 + .../ajv/dist/vocabularies/applicator/allOf.js | 23 + .../dist/vocabularies/applicator/allOf.js.map | 1 + .../dist/vocabularies/applicator/anyOf.d.ts | 4 + .../ajv/dist/vocabularies/applicator/anyOf.js | 12 + .../dist/vocabularies/applicator/anyOf.js.map | 1 + .../vocabularies/applicator/contains.d.ts | 7 + .../dist/vocabularies/applicator/contains.js | 95 + .../vocabularies/applicator/contains.js.map | 1 + .../vocabularies/applicator/dependencies.d.ts | 21 + .../vocabularies/applicator/dependencies.js | 85 + .../applicator/dependencies.js.map | 1 + .../applicator/dependentSchemas.d.ts | 3 + .../applicator/dependentSchemas.js | 11 + .../applicator/dependentSchemas.js.map | 1 + .../ajv/dist/vocabularies/applicator/if.d.ts | 6 + .../ajv/dist/vocabularies/applicator/if.js | 66 + .../dist/vocabularies/applicator/if.js.map | 1 + .../dist/vocabularies/applicator/index.d.ts | 13 + .../ajv/dist/vocabularies/applicator/index.js | 44 + .../dist/vocabularies/applicator/index.js.map | 1 + .../dist/vocabularies/applicator/items.d.ts | 5 + .../ajv/dist/vocabularies/applicator/items.js | 52 + .../dist/vocabularies/applicator/items.js.map | 1 + .../vocabularies/applicator/items2020.d.ts | 6 + .../dist/vocabularies/applicator/items2020.js | 30 + .../vocabularies/applicator/items2020.js.map | 1 + .../ajv/dist/vocabularies/applicator/not.d.ts | 4 + .../ajv/dist/vocabularies/applicator/not.js | 26 + .../dist/vocabularies/applicator/not.js.map | 1 + .../dist/vocabularies/applicator/oneOf.d.ts | 6 + .../ajv/dist/vocabularies/applicator/oneOf.js | 60 + .../dist/vocabularies/applicator/oneOf.js.map | 1 + .../applicator/patternProperties.d.ts | 3 + .../applicator/patternProperties.js | 75 + .../applicator/patternProperties.js.map | 1 + .../vocabularies/applicator/prefixItems.d.ts | 3 + .../vocabularies/applicator/prefixItems.js | 12 + .../applicator/prefixItems.js.map | 1 + .../vocabularies/applicator/properties.d.ts | 3 + .../vocabularies/applicator/properties.js | 54 + .../vocabularies/applicator/properties.js.map | 1 + .../applicator/propertyNames.d.ts | 6 + .../vocabularies/applicator/propertyNames.js | 38 + .../applicator/propertyNames.js.map | 1 + .../vocabularies/applicator/thenElse.d.ts | 3 + .../dist/vocabularies/applicator/thenElse.js | 13 + .../vocabularies/applicator/thenElse.js.map | 1 + .../mcp-sdk/ajv/dist/vocabularies/code.d.ts | 17 + .../mcp-sdk/ajv/dist/vocabularies/code.js | 131 + .../mcp-sdk/ajv/dist/vocabularies/code.js.map | 1 + .../ajv/dist/vocabularies/core/id.d.ts | 3 + .../mcp-sdk/ajv/dist/vocabularies/core/id.js | 10 + .../ajv/dist/vocabularies/core/id.js.map | 1 + .../ajv/dist/vocabularies/core/index.d.ts | 3 + .../ajv/dist/vocabularies/core/index.js | 16 + .../ajv/dist/vocabularies/core/index.js.map | 1 + .../ajv/dist/vocabularies/core/ref.d.ts | 8 + .../mcp-sdk/ajv/dist/vocabularies/core/ref.js | 122 + .../ajv/dist/vocabularies/core/ref.js.map | 1 + .../vocabularies/discriminator/index.d.ts | 5 + .../dist/vocabularies/discriminator/index.js | 104 + .../vocabularies/discriminator/index.js.map | 1 + .../vocabularies/discriminator/types.d.ts | 10 + .../dist/vocabularies/discriminator/types.js | 9 + .../vocabularies/discriminator/types.js.map | 1 + .../ajv/dist/vocabularies/draft2020.d.ts | 3 + .../ajv/dist/vocabularies/draft2020.js | 23 + .../ajv/dist/vocabularies/draft2020.js.map | 1 + .../mcp-sdk/ajv/dist/vocabularies/draft7.d.ts | 3 + .../mcp-sdk/ajv/dist/vocabularies/draft7.js | 17 + .../ajv/dist/vocabularies/draft7.js.map | 1 + .../vocabularies/dynamic/dynamicAnchor.d.ts | 5 + .../vocabularies/dynamic/dynamicAnchor.js | 30 + .../vocabularies/dynamic/dynamicAnchor.js.map | 1 + .../dist/vocabularies/dynamic/dynamicRef.d.ts | 5 + .../dist/vocabularies/dynamic/dynamicRef.js | 51 + .../vocabularies/dynamic/dynamicRef.js.map | 1 + .../ajv/dist/vocabularies/dynamic/index.d.ts | 3 + .../ajv/dist/vocabularies/dynamic/index.js | 9 + .../dist/vocabularies/dynamic/index.js.map | 1 + .../vocabularies/dynamic/recursiveAnchor.d.ts | 3 + .../vocabularies/dynamic/recursiveAnchor.js | 16 + .../dynamic/recursiveAnchor.js.map | 1 + .../vocabularies/dynamic/recursiveRef.d.ts | 3 + .../dist/vocabularies/dynamic/recursiveRef.js | 10 + .../vocabularies/dynamic/recursiveRef.js.map | 1 + .../mcp-sdk/ajv/dist/vocabularies/errors.d.ts | 9 + .../mcp-sdk/ajv/dist/vocabularies/errors.js | 3 + .../ajv/dist/vocabularies/errors.js.map | 1 + .../ajv/dist/vocabularies/format/format.d.ts | 8 + .../ajv/dist/vocabularies/format/format.js | 92 + .../dist/vocabularies/format/format.js.map | 1 + .../ajv/dist/vocabularies/format/index.d.ts | 3 + .../ajv/dist/vocabularies/format/index.js | 6 + .../ajv/dist/vocabularies/format/index.js.map | 1 + .../dist/vocabularies/jtd/discriminator.d.ts | 6 + .../dist/vocabularies/jtd/discriminator.js | 71 + .../vocabularies/jtd/discriminator.js.map | 1 + .../ajv/dist/vocabularies/jtd/elements.d.ts | 5 + .../ajv/dist/vocabularies/jtd/elements.js | 24 + .../ajv/dist/vocabularies/jtd/elements.js.map | 1 + .../ajv/dist/vocabularies/jtd/enum.d.ts | 6 + .../mcp-sdk/ajv/dist/vocabularies/jtd/enum.js | 43 + .../ajv/dist/vocabularies/jtd/enum.js.map | 1 + .../ajv/dist/vocabularies/jtd/error.d.ts | 9 + .../ajv/dist/vocabularies/jtd/error.js | 20 + .../ajv/dist/vocabularies/jtd/error.js.map | 1 + .../ajv/dist/vocabularies/jtd/index.d.ts | 10 + .../ajv/dist/vocabularies/jtd/index.js | 29 + .../ajv/dist/vocabularies/jtd/index.js.map | 1 + .../ajv/dist/vocabularies/jtd/metadata.d.ts | 5 + .../ajv/dist/vocabularies/jtd/metadata.js | 25 + .../ajv/dist/vocabularies/jtd/metadata.js.map | 1 + .../ajv/dist/vocabularies/jtd/nullable.d.ts | 4 + .../ajv/dist/vocabularies/jtd/nullable.js | 22 + .../ajv/dist/vocabularies/jtd/nullable.js.map | 1 + .../vocabularies/jtd/optionalProperties.d.ts | 3 + .../vocabularies/jtd/optionalProperties.js | 15 + .../jtd/optionalProperties.js.map | 1 + .../ajv/dist/vocabularies/jtd/properties.d.ts | 22 + .../ajv/dist/vocabularies/jtd/properties.js | 149 + .../dist/vocabularies/jtd/properties.js.map | 1 + .../ajv/dist/vocabularies/jtd/ref.d.ts | 4 + .../mcp-sdk/ajv/dist/vocabularies/jtd/ref.js | 67 + .../ajv/dist/vocabularies/jtd/ref.js.map | 1 + .../ajv/dist/vocabularies/jtd/type.d.ts | 10 + .../mcp-sdk/ajv/dist/vocabularies/jtd/type.js | 69 + .../ajv/dist/vocabularies/jtd/type.js.map | 1 + .../ajv/dist/vocabularies/jtd/union.d.ts | 3 + .../ajv/dist/vocabularies/jtd/union.js | 12 + .../ajv/dist/vocabularies/jtd/union.js.map | 1 + .../ajv/dist/vocabularies/jtd/values.d.ts | 5 + .../ajv/dist/vocabularies/jtd/values.js | 51 + .../ajv/dist/vocabularies/jtd/values.js.map | 1 + .../ajv/dist/vocabularies/metadata.d.ts | 3 + .../mcp-sdk/ajv/dist/vocabularies/metadata.js | 18 + .../ajv/dist/vocabularies/metadata.js.map | 1 + .../mcp-sdk/ajv/dist/vocabularies/next.d.ts | 3 + .../mcp-sdk/ajv/dist/vocabularies/next.js | 8 + .../mcp-sdk/ajv/dist/vocabularies/next.js.map | 1 + .../dist/vocabularies/unevaluated/index.d.ts | 3 + .../dist/vocabularies/unevaluated/index.js | 7 + .../vocabularies/unevaluated/index.js.map | 1 + .../unevaluated/unevaluatedItems.d.ts | 6 + .../unevaluated/unevaluatedItems.js | 40 + .../unevaluated/unevaluatedItems.js.map | 1 + .../unevaluated/unevaluatedProperties.d.ts | 6 + .../unevaluated/unevaluatedProperties.js | 65 + .../unevaluated/unevaluatedProperties.js.map | 1 + .../dist/vocabularies/validation/const.d.ts | 6 + .../ajv/dist/vocabularies/validation/const.js | 25 + .../dist/vocabularies/validation/const.js.map | 1 + .../validation/dependentRequired.d.ts | 5 + .../validation/dependentRequired.js | 12 + .../validation/dependentRequired.js.map | 1 + .../dist/vocabularies/validation/enum.d.ts | 8 + .../ajv/dist/vocabularies/validation/enum.js | 48 + .../dist/vocabularies/validation/enum.js.map | 1 + .../dist/vocabularies/validation/index.d.ts | 16 + .../ajv/dist/vocabularies/validation/index.js | 33 + .../dist/vocabularies/validation/index.js.map | 1 + .../validation/limitContains.d.ts | 3 + .../vocabularies/validation/limitContains.js | 15 + .../validation/limitContains.js.map | 1 + .../vocabularies/validation/limitItems.d.ts | 3 + .../vocabularies/validation/limitItems.js | 24 + .../vocabularies/validation/limitItems.js.map | 1 + .../vocabularies/validation/limitLength.d.ts | 3 + .../vocabularies/validation/limitLength.js | 27 + .../validation/limitLength.js.map | 1 + .../vocabularies/validation/limitNumber.d.ts | 11 + .../vocabularies/validation/limitNumber.js | 27 + .../validation/limitNumber.js.map | 1 + .../validation/limitProperties.d.ts | 3 + .../validation/limitProperties.js | 24 + .../validation/limitProperties.js.map | 1 + .../vocabularies/validation/multipleOf.d.ts | 8 + .../vocabularies/validation/multipleOf.js | 26 + .../vocabularies/validation/multipleOf.js.map | 1 + .../dist/vocabularies/validation/pattern.d.ts | 8 + .../dist/vocabularies/validation/pattern.js | 24 + .../vocabularies/validation/pattern.js.map | 1 + .../vocabularies/validation/required.d.ts | 8 + .../dist/vocabularies/validation/required.js | 79 + .../vocabularies/validation/required.js.map | 1 + .../vocabularies/validation/uniqueItems.d.ts | 9 + .../vocabularies/validation/uniqueItems.js | 64 + .../validation/uniqueItems.js.map | 1 + front_end/third_party/mcp-sdk/ajv/lib/2019.ts | 81 + front_end/third_party/mcp-sdk/ajv/lib/2020.ts | 75 + front_end/third_party/mcp-sdk/ajv/lib/ajv.ts | 70 + .../mcp-sdk/ajv/lib/compile/codegen/code.ts | 169 + .../mcp-sdk/ajv/lib/compile/codegen/index.ts | 852 + .../mcp-sdk/ajv/lib/compile/codegen/scope.ts | 215 + .../mcp-sdk/ajv/lib/compile/errors.ts | 184 + .../mcp-sdk/ajv/lib/compile/index.ts | 324 + .../mcp-sdk/ajv/lib/compile/jtd/parse.ts | 411 + .../mcp-sdk/ajv/lib/compile/jtd/serialize.ts | 266 + .../mcp-sdk/ajv/lib/compile/jtd/types.ts | 16 + .../mcp-sdk/ajv/lib/compile/names.ts | 27 + .../mcp-sdk/ajv/lib/compile/ref_error.ts | 13 + .../mcp-sdk/ajv/lib/compile/resolve.ts | 149 + .../mcp-sdk/ajv/lib/compile/rules.ts | 50 + .../mcp-sdk/ajv/lib/compile/util.ts | 213 + .../ajv/lib/compile/validate/applicability.ts | 22 + .../ajv/lib/compile/validate/boolSchema.ts | 47 + .../ajv/lib/compile/validate/dataType.ts | 230 + .../ajv/lib/compile/validate/defaults.ts | 32 + .../mcp-sdk/ajv/lib/compile/validate/index.ts | 582 + .../ajv/lib/compile/validate/keyword.ts | 171 + .../ajv/lib/compile/validate/subschema.ts | 135 + front_end/third_party/mcp-sdk/ajv/lib/core.ts | 891 + front_end/third_party/mcp-sdk/ajv/lib/jtd.ts | 132 + .../mcp-sdk/ajv/lib/refs/data.json | 13 + .../ajv/lib/refs/json-schema-2019-09/index.ts | 28 + .../json-schema-2019-09/meta/applicator.json | 53 + .../json-schema-2019-09/meta/content.json | 17 + .../refs/json-schema-2019-09/meta/core.json | 57 + .../refs/json-schema-2019-09/meta/format.json | 14 + .../json-schema-2019-09/meta/meta-data.json | 37 + .../json-schema-2019-09/meta/validation.json | 90 + .../lib/refs/json-schema-2019-09/schema.json | 39 + .../ajv/lib/refs/json-schema-2020-12/index.ts | 30 + .../json-schema-2020-12/meta/applicator.json | 48 + .../json-schema-2020-12/meta/content.json | 17 + .../refs/json-schema-2020-12/meta/core.json | 51 + .../meta/format-annotation.json | 14 + .../json-schema-2020-12/meta/meta-data.json | 37 + .../json-schema-2020-12/meta/unevaluated.json | 15 + .../json-schema-2020-12/meta/validation.json | 90 + .../lib/refs/json-schema-2020-12/schema.json | 55 + .../ajv/lib/refs/json-schema-draft-06.json | 137 + .../ajv/lib/refs/json-schema-draft-07.json | 151 + .../ajv/lib/refs/json-schema-secure.json | 88 + .../mcp-sdk/ajv/lib/refs/jtd-schema.ts | 130 + .../mcp-sdk/ajv/lib/runtime/equal.ts | 7 + .../mcp-sdk/ajv/lib/runtime/parseJson.ts | 177 + .../mcp-sdk/ajv/lib/runtime/quote.ts | 31 + .../mcp-sdk/ajv/lib/runtime/re2.ts | 6 + .../mcp-sdk/ajv/lib/runtime/timestamp.ts | 46 + .../mcp-sdk/ajv/lib/runtime/ucs2length.ts | 20 + .../mcp-sdk/ajv/lib/runtime/uri.ts | 6 + .../ajv/lib/runtime/validation_error.ts | 13 + .../mcp-sdk/ajv/lib/standalone/index.ts | 100 + .../mcp-sdk/ajv/lib/standalone/instance.ts | 36 + .../mcp-sdk/ajv/lib/types/index.ts | 244 + .../mcp-sdk/ajv/lib/types/json-schema.ts | 187 + .../mcp-sdk/ajv/lib/types/jtd-schema.ts | 273 + .../applicator/additionalItems.ts | 56 + .../applicator/additionalProperties.ts | 118 + .../ajv/lib/vocabularies/applicator/allOf.ts | 22 + .../ajv/lib/vocabularies/applicator/anyOf.ts | 14 + .../lib/vocabularies/applicator/contains.ts | 109 + .../vocabularies/applicator/dependencies.ts | 112 + .../applicator/dependentSchemas.ts | 11 + .../ajv/lib/vocabularies/applicator/if.ts | 80 + .../ajv/lib/vocabularies/applicator/index.ts | 53 + .../ajv/lib/vocabularies/applicator/items.ts | 59 + .../lib/vocabularies/applicator/items2020.ts | 36 + .../ajv/lib/vocabularies/applicator/not.ts | 38 + .../ajv/lib/vocabularies/applicator/oneOf.ts | 82 + .../applicator/patternProperties.ts | 91 + .../vocabularies/applicator/prefixItems.ts | 12 + .../lib/vocabularies/applicator/properties.ts | 57 + .../vocabularies/applicator/propertyNames.ts | 50 + .../lib/vocabularies/applicator/thenElse.ts | 13 + .../mcp-sdk/ajv/lib/vocabularies/code.ts | 168 + .../mcp-sdk/ajv/lib/vocabularies/core/id.ts | 10 + .../ajv/lib/vocabularies/core/index.ts | 16 + .../mcp-sdk/ajv/lib/vocabularies/core/ref.ts | 129 + .../lib/vocabularies/discriminator/index.ts | 113 + .../lib/vocabularies/discriminator/types.ts | 12 + .../mcp-sdk/ajv/lib/vocabularies/draft2020.ts | 23 + .../mcp-sdk/ajv/lib/vocabularies/draft7.ts | 17 + .../lib/vocabularies/dynamic/dynamicAnchor.ts | 31 + .../lib/vocabularies/dynamic/dynamicRef.ts | 51 + .../ajv/lib/vocabularies/dynamic/index.ts | 9 + .../vocabularies/dynamic/recursiveAnchor.ts | 14 + .../lib/vocabularies/dynamic/recursiveRef.ts | 10 + .../mcp-sdk/ajv/lib/vocabularies/errors.ts | 18 + .../ajv/lib/vocabularies/format/format.ts | 120 + .../ajv/lib/vocabularies/format/index.ts | 6 + .../ajv/lib/vocabularies/jtd/discriminator.ts | 89 + .../ajv/lib/vocabularies/jtd/elements.ts | 32 + .../mcp-sdk/ajv/lib/vocabularies/jtd/enum.ts | 45 + .../mcp-sdk/ajv/lib/vocabularies/jtd/error.ts | 23 + .../mcp-sdk/ajv/lib/vocabularies/jtd/index.ts | 37 + .../ajv/lib/vocabularies/jtd/metadata.ts | 24 + .../ajv/lib/vocabularies/jtd/nullable.ts | 21 + .../vocabularies/jtd/optionalProperties.ts | 15 + .../ajv/lib/vocabularies/jtd/properties.ts | 184 + .../mcp-sdk/ajv/lib/vocabularies/jtd/ref.ts | 76 + .../mcp-sdk/ajv/lib/vocabularies/jtd/type.ts | 75 + .../mcp-sdk/ajv/lib/vocabularies/jtd/union.ts | 12 + .../ajv/lib/vocabularies/jtd/values.ts | 58 + .../mcp-sdk/ajv/lib/vocabularies/metadata.ts | 17 + .../mcp-sdk/ajv/lib/vocabularies/next.ts | 8 + .../ajv/lib/vocabularies/unevaluated/index.ts | 7 + .../unevaluated/unevaluatedItems.ts | 47 + .../unevaluated/unevaluatedProperties.ts | 85 + .../ajv/lib/vocabularies/validation/const.ts | 28 + .../validation/dependentRequired.ts | 23 + .../ajv/lib/vocabularies/validation/enum.ts | 54 + .../ajv/lib/vocabularies/validation/index.ts | 49 + .../vocabularies/validation/limitContains.ts | 16 + .../lib/vocabularies/validation/limitItems.ts | 26 + .../vocabularies/validation/limitLength.ts | 30 + .../vocabularies/validation/limitNumber.ts | 42 + .../validation/limitProperties.ts | 26 + .../lib/vocabularies/validation/multipleOf.ts | 34 + .../lib/vocabularies/validation/pattern.ts | 28 + .../lib/vocabularies/validation/required.ts | 98 + .../vocabularies/validation/uniqueItems.ts | 79 + .../third_party/mcp-sdk/ajv/package.json | 126 + .../eventsource-parser/package/LICENSE | 21 + .../eventsource-parser/package/README.md | 126 + .../eventsource-parser/package/dist/index.cjs | 106 + .../package/dist/index.cjs.map | 1 + .../package/dist/index.d.cts | 144 + .../package/dist/index.d.ts | 144 + .../eventsource-parser/package/dist/index.js | 106 + .../package/dist/index.js.map | 1 + .../package/dist/stream.cjs | 28 + .../package/dist/stream.cjs.map | 1 + .../package/dist/stream.d.cts | 118 + .../package/dist/stream.d.ts | 118 + .../eventsource-parser/package/dist/stream.js | 29 + .../package/dist/stream.js.map | 1 + .../eventsource-parser/package/package.json | 115 + .../eventsource-parser/package/src/errors.ts | 44 + .../eventsource-parser/package/src/index.ts | 3 + .../eventsource-parser/package/src/parse.ts | 232 + .../eventsource-parser/package/src/stream.ts | 88 + .../eventsource-parser/package/src/types.ts | 97 + .../eventsource-parser/package/stream.js | 2 + .../third_party/mcp-sdk/mcp-sdk-tsconfig.json | 38 + front_end/third_party/mcp-sdk/mcp-sdk.ts | 213 + front_end/third_party/mcp-sdk/package/LICENSE | 21 + .../third_party/mcp-sdk/package/README.md | 117 + .../third_party/mcp-sdk/package/dist/cli.d.ts | 2 + .../mcp-sdk/package/dist/cli.d.ts.map | 1 + .../third_party/mcp-sdk/package/dist/cli.js | 129 + .../mcp-sdk/package/dist/cli.js.map | 1 + .../mcp-sdk/package/dist/client/index.d.ts | 773 + .../package/dist/client/index.d.ts.map | 1 + .../mcp-sdk/package/dist/client/index.js | 206 + .../mcp-sdk/package/dist/client/index.js.map | 1 + .../package/dist/client/index.test.d.ts | 2 + .../package/dist/client/index.test.d.ts.map | 1 + .../mcp-sdk/package/dist/client/index.test.js | 393 + .../package/dist/client/index.test.js.map | 1 + .../mcp-sdk/package/dist/client/sse.d.ts | 22 + .../mcp-sdk/package/dist/client/sse.d.ts.map | 1 + .../mcp-sdk/package/dist/client/sse.js | 91 + .../mcp-sdk/package/dist/client/sse.js.map | 1 + .../mcp-sdk/package/dist/client/stdio.d.ts | 63 + .../package/dist/client/stdio.d.ts.map | 1 + .../mcp-sdk/package/dist/client/stdio.js | 148 + .../mcp-sdk/package/dist/client/stdio.js.map | 1 + .../package/dist/client/stdio.test.d.ts | 2 + .../package/dist/client/stdio.test.d.ts.map | 1 + .../mcp-sdk/package/dist/client/stdio.test.js | 51 + .../package/dist/client/stdio.test.js.map | 1 + .../package/dist/client/websocket.d.ts | 17 + .../package/dist/client/websocket.d.ts.map | 1 + .../mcp-sdk/package/dist/client/websocket.js | 61 + .../package/dist/client/websocket.js.map | 1 + .../mcp-sdk/package/dist/inMemory.d.ts | 20 + .../mcp-sdk/package/dist/inMemory.d.ts.map | 1 + .../mcp-sdk/package/dist/inMemory.js | 47 + .../mcp-sdk/package/dist/inMemory.js.map | 1 + .../mcp-sdk/package/dist/inMemory.test.d.ts | 2 + .../package/dist/inMemory.test.d.ts.map | 1 + .../mcp-sdk/package/dist/inMemory.test.js | 74 + .../mcp-sdk/package/dist/inMemory.test.js.map | 1 + .../mcp-sdk/package/dist/server/index.d.ts | 112 + .../package/dist/server/index.d.ts.map | 1 + .../mcp-sdk/package/dist/server/index.js | 182 + .../mcp-sdk/package/dist/server/index.js.map | 1 + .../package/dist/server/index.test.d.ts | 2 + .../package/dist/server/index.test.d.ts.map | 1 + .../mcp-sdk/package/dist/server/index.test.js | 408 + .../package/dist/server/index.test.js.map | 1 + .../mcp-sdk/package/dist/server/sse.d.ts | 46 + .../mcp-sdk/package/dist/server/sse.d.ts.map | 1 + .../mcp-sdk/package/dist/server/sse.js | 116 + .../mcp-sdk/package/dist/server/sse.js.map | 1 + .../mcp-sdk/package/dist/server/stdio.d.ts | 28 + .../package/dist/server/stdio.d.ts.map | 1 + .../mcp-sdk/package/dist/server/stdio.js | 69 + .../mcp-sdk/package/dist/server/stdio.js.map | 1 + .../package/dist/server/stdio.test.d.ts | 2 + .../package/dist/server/stdio.test.d.ts.map | 1 + .../mcp-sdk/package/dist/server/stdio.test.js | 87 + .../package/dist/server/stdio.test.js.map | 1 + .../mcp-sdk/package/dist/shared/protocol.d.ts | 157 + .../package/dist/shared/protocol.d.ts.map | 1 + .../mcp-sdk/package/dist/shared/protocol.js | 297 + .../package/dist/shared/protocol.js.map | 1 + .../mcp-sdk/package/dist/shared/stdio.d.ts | 13 + .../package/dist/shared/stdio.d.ts.map | 1 + .../mcp-sdk/package/dist/shared/stdio.js | 31 + .../mcp-sdk/package/dist/shared/stdio.js.map | 1 + .../package/dist/shared/stdio.test.d.ts | 2 + .../package/dist/shared/stdio.test.d.ts.map | 1 + .../mcp-sdk/package/dist/shared/stdio.test.js | 27 + .../package/dist/shared/stdio.test.js.map | 1 + .../package/dist/shared/transport.d.ts | 39 + .../package/dist/shared/transport.d.ts.map | 1 + .../mcp-sdk/package/dist/shared/transport.js | 2 + .../package/dist/shared/transport.js.map | 1 + .../mcp-sdk/package/dist/types.d.ts | 26425 +++++++++++++ .../mcp-sdk/package/dist/types.d.ts.map | 1 + .../third_party/mcp-sdk/package/dist/types.js | 997 + .../mcp-sdk/package/dist/types.js.map | 1 + .../third_party/mcp-sdk/package/package.json | 61 + front_end/third_party/mcp-sdk/zod/LICENSE | 21 + front_end/third_party/mcp-sdk/zod/README.md | 2876 ++ .../third_party/mcp-sdk/zod/dist/cli.d.ts | 2 + .../third_party/mcp-sdk/zod/dist/cli.d.ts.map | 1 + front_end/third_party/mcp-sdk/zod/dist/cli.js | 129 + .../third_party/mcp-sdk/zod/dist/cli.js.map | 1 + .../mcp-sdk/zod/dist/client/index.d.ts | 773 + .../mcp-sdk/zod/dist/client/index.d.ts.map | 1 + .../mcp-sdk/zod/dist/client/index.js | 206 + .../mcp-sdk/zod/dist/client/index.js.map | 1 + .../mcp-sdk/zod/dist/client/index.test.d.ts | 2 + .../zod/dist/client/index.test.d.ts.map | 1 + .../mcp-sdk/zod/dist/client/index.test.js | 393 + .../mcp-sdk/zod/dist/client/index.test.js.map | 1 + .../mcp-sdk/zod/dist/client/sse.d.ts | 22 + .../mcp-sdk/zod/dist/client/sse.d.ts.map | 1 + .../mcp-sdk/zod/dist/client/sse.js | 91 + .../mcp-sdk/zod/dist/client/sse.js.map | 1 + .../mcp-sdk/zod/dist/client/stdio.d.ts | 63 + .../mcp-sdk/zod/dist/client/stdio.d.ts.map | 1 + .../mcp-sdk/zod/dist/client/stdio.js | 148 + .../mcp-sdk/zod/dist/client/stdio.js.map | 1 + .../mcp-sdk/zod/dist/client/stdio.test.d.ts | 2 + .../zod/dist/client/stdio.test.d.ts.map | 1 + .../mcp-sdk/zod/dist/client/stdio.test.js | 51 + .../mcp-sdk/zod/dist/client/stdio.test.js.map | 1 + .../mcp-sdk/zod/dist/client/websocket.d.ts | 17 + .../zod/dist/client/websocket.d.ts.map | 1 + .../mcp-sdk/zod/dist/client/websocket.js | 61 + .../mcp-sdk/zod/dist/client/websocket.js.map | 1 + .../mcp-sdk/zod/dist/inMemory.d.ts | 20 + .../mcp-sdk/zod/dist/inMemory.d.ts.map | 1 + .../third_party/mcp-sdk/zod/dist/inMemory.js | 47 + .../mcp-sdk/zod/dist/inMemory.js.map | 1 + .../mcp-sdk/zod/dist/inMemory.test.d.ts | 2 + .../mcp-sdk/zod/dist/inMemory.test.d.ts.map | 1 + .../mcp-sdk/zod/dist/inMemory.test.js | 74 + .../mcp-sdk/zod/dist/inMemory.test.js.map | 1 + .../mcp-sdk/zod/dist/server/index.d.ts | 112 + .../mcp-sdk/zod/dist/server/index.d.ts.map | 1 + .../mcp-sdk/zod/dist/server/index.js | 182 + .../mcp-sdk/zod/dist/server/index.js.map | 1 + .../mcp-sdk/zod/dist/server/index.test.d.ts | 2 + .../zod/dist/server/index.test.d.ts.map | 1 + .../mcp-sdk/zod/dist/server/index.test.js | 408 + .../mcp-sdk/zod/dist/server/index.test.js.map | 1 + .../mcp-sdk/zod/dist/server/sse.d.ts | 46 + .../mcp-sdk/zod/dist/server/sse.d.ts.map | 1 + .../mcp-sdk/zod/dist/server/sse.js | 116 + .../mcp-sdk/zod/dist/server/sse.js.map | 1 + .../mcp-sdk/zod/dist/server/stdio.d.ts | 28 + .../mcp-sdk/zod/dist/server/stdio.d.ts.map | 1 + .../mcp-sdk/zod/dist/server/stdio.js | 69 + .../mcp-sdk/zod/dist/server/stdio.js.map | 1 + .../mcp-sdk/zod/dist/server/stdio.test.d.ts | 2 + .../zod/dist/server/stdio.test.d.ts.map | 1 + .../mcp-sdk/zod/dist/server/stdio.test.js | 87 + .../mcp-sdk/zod/dist/server/stdio.test.js.map | 1 + .../mcp-sdk/zod/dist/shared/protocol.d.ts | 157 + .../mcp-sdk/zod/dist/shared/protocol.d.ts.map | 1 + .../mcp-sdk/zod/dist/shared/protocol.js | 297 + .../mcp-sdk/zod/dist/shared/protocol.js.map | 1 + .../mcp-sdk/zod/dist/shared/stdio.d.ts | 13 + .../mcp-sdk/zod/dist/shared/stdio.d.ts.map | 1 + .../mcp-sdk/zod/dist/shared/stdio.js | 31 + .../mcp-sdk/zod/dist/shared/stdio.js.map | 1 + .../mcp-sdk/zod/dist/shared/stdio.test.d.ts | 2 + .../zod/dist/shared/stdio.test.d.ts.map | 1 + .../mcp-sdk/zod/dist/shared/stdio.test.js | 27 + .../mcp-sdk/zod/dist/shared/stdio.test.js.map | 1 + .../mcp-sdk/zod/dist/shared/transport.d.ts | 39 + .../zod/dist/shared/transport.d.ts.map | 1 + .../mcp-sdk/zod/dist/shared/transport.js | 2 + .../mcp-sdk/zod/dist/shared/transport.js.map | 1 + .../third_party/mcp-sdk/zod/dist/types.d.ts | 26425 +++++++++++++ .../mcp-sdk/zod/dist/types.d.ts.map | 1 + .../third_party/mcp-sdk/zod/dist/types.js | 997 + .../third_party/mcp-sdk/zod/dist/types.js.map | 1 + front_end/third_party/mcp-sdk/zod/index.d.ts | 2 + .../third_party/mcp-sdk/zod/lib/ZodError.d.ts | 164 + .../third_party/mcp-sdk/zod/lib/ZodError.js | 137 + .../mcp-sdk/zod/lib/__tests__/Mocker.d.ts | 17 + .../mcp-sdk/zod/lib/__tests__/Mocker.js | 57 + .../mcp-sdk/zod/lib/benchmarks/datetime.d.ts | 5 + .../mcp-sdk/zod/lib/benchmarks/datetime.js | 54 + .../lib/benchmarks/discriminatedUnion.d.ts | 5 + .../zod/lib/benchmarks/discriminatedUnion.js | 79 + .../mcp-sdk/zod/lib/benchmarks/index.d.ts | 1 + .../mcp-sdk/zod/lib/benchmarks/index.js | 59 + .../mcp-sdk/zod/lib/benchmarks/ipv4.d.ts | 5 + .../mcp-sdk/zod/lib/benchmarks/ipv4.js | 54 + .../mcp-sdk/zod/lib/benchmarks/object.d.ts | 5 + .../mcp-sdk/zod/lib/benchmarks/object.js | 70 + .../zod/lib/benchmarks/primitives.d.ts | 5 + .../mcp-sdk/zod/lib/benchmarks/primitives.js | 170 + .../mcp-sdk/zod/lib/benchmarks/realworld.d.ts | 5 + .../mcp-sdk/zod/lib/benchmarks/realworld.js | 56 + .../mcp-sdk/zod/lib/benchmarks/string.d.ts | 5 + .../mcp-sdk/zod/lib/benchmarks/string.js | 55 + .../mcp-sdk/zod/lib/benchmarks/union.d.ts | 5 + .../mcp-sdk/zod/lib/benchmarks/union.js | 79 + .../third_party/mcp-sdk/zod/lib/errors.d.ts | 5 + .../third_party/mcp-sdk/zod/lib/errors.js | 17 + .../third_party/mcp-sdk/zod/lib/external.d.ts | 6 + .../third_party/mcp-sdk/zod/lib/external.js | 18 + .../mcp-sdk/zod/lib/helpers/enumUtil.d.ts | 8 + .../mcp-sdk/zod/lib/helpers/enumUtil.js | 2 + .../mcp-sdk/zod/lib/helpers/errorUtil.d.ts | 9 + .../mcp-sdk/zod/lib/helpers/errorUtil.js | 8 + .../mcp-sdk/zod/lib/helpers/parseUtil.d.ts | 78 + .../mcp-sdk/zod/lib/helpers/parseUtil.js | 125 + .../mcp-sdk/zod/lib/helpers/partialUtil.d.ts | 8 + .../mcp-sdk/zod/lib/helpers/partialUtil.js | 2 + .../mcp-sdk/zod/lib/helpers/typeAliases.d.ts | 2 + .../mcp-sdk/zod/lib/helpers/typeAliases.js | 2 + .../mcp-sdk/zod/lib/helpers/util.d.ts | 82 + .../mcp-sdk/zod/lib/helpers/util.js | 142 + .../third_party/mcp-sdk/zod/lib/index.d.ts | 4 + .../third_party/mcp-sdk/zod/lib/index.js | 29 + .../third_party/mcp-sdk/zod/lib/index.mjs | 4236 +++ .../third_party/mcp-sdk/zod/lib/index.umd.js | 4351 +++ .../mcp-sdk/zod/lib/locales/en.d.ts | 3 + .../third_party/mcp-sdk/zod/lib/locales/en.js | 129 + .../third_party/mcp-sdk/zod/lib/types.d.ts | 1127 + .../third_party/mcp-sdk/zod/lib/types.js | 3677 ++ .../third_party/mcp-sdk/zod/package.json | 119 + 1101 files changed, 194266 insertions(+), 15 deletions(-) create mode 100644 front_end/panels/ai_chat/core/AgentNodes.test.ts create mode 100644 front_end/panels/ai_chat/core/ToolNameMapping.test.ts create mode 100644 front_end/panels/ai_chat/core/ToolSurfaceProvider.test.ts create mode 100644 front_end/panels/ai_chat/core/ToolSurfaceProvider.ts create mode 100644 front_end/panels/ai_chat/mcp/MCPClientSDK.test.ts create mode 100644 front_end/panels/ai_chat/mcp/MCPConfig.ts create mode 100644 front_end/panels/ai_chat/mcp/MCPMetaTools.ts create mode 100644 front_end/panels/ai_chat/mcp/MCPRegistry.ts create mode 100644 front_end/panels/ai_chat/mcp/MCPToolAdapter.ts create mode 100644 front_end/third_party/mcp-sdk/BUILD.gn create mode 100644 front_end/third_party/mcp-sdk/LICENSE create mode 100644 front_end/third_party/mcp-sdk/README.chromium create mode 100644 front_end/third_party/mcp-sdk/ajv/.runkit_example.js create mode 100644 front_end/third_party/mcp-sdk/ajv/LICENSE create mode 100644 front_end/third_party/mcp-sdk/ajv/README.md create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/2019.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/2019.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/2019.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/2020.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/2020.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/2020.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/ajv.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/ajv.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/ajv.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/cli.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/cli.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/cli.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/cli.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/client/auth.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/client/auth.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/client/auth.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/client/auth.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/client/index.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/client/index.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/client/index.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/client/index.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/client/sse.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/client/sse.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/client/sse.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/client/sse.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/client/stdio.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/client/stdio.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/client/stdio.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/client/stdio.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/client/streamableHttp.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/client/streamableHttp.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/client/streamableHttp.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/client/streamableHttp.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/client/websocket.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/client/websocket.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/client/websocket.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/client/websocket.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/multipleClientsParallel.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/multipleClientsParallel.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/multipleClientsParallel.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/multipleClientsParallel.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/parallelToolCallsClient.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/parallelToolCallsClient.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/parallelToolCallsClient.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/parallelToolCallsClient.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/simpleOAuthClient.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/simpleOAuthClient.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/simpleOAuthClient.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/simpleOAuthClient.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/simpleStreamableHttp.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/simpleStreamableHttp.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/simpleStreamableHttp.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/simpleStreamableHttp.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/streamableHttpWithSseFallbackClient.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/streamableHttpWithSseFallbackClient.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/streamableHttpWithSseFallbackClient.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/streamableHttpWithSseFallbackClient.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/demoInMemoryOAuthProvider.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/demoInMemoryOAuthProvider.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/demoInMemoryOAuthProvider.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/demoInMemoryOAuthProvider.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/jsonResponseStreamableHttp.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/jsonResponseStreamableHttp.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/jsonResponseStreamableHttp.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/jsonResponseStreamableHttp.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/mcpServerOutputSchema.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/mcpServerOutputSchema.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/mcpServerOutputSchema.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/mcpServerOutputSchema.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleSseServer.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleSseServer.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleSseServer.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleSseServer.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleStatelessStreamableHttp.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleStatelessStreamableHttp.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleStatelessStreamableHttp.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleStatelessStreamableHttp.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleStreamableHttp.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleStreamableHttp.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleStreamableHttp.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleStreamableHttp.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/shared/inMemoryEventStore.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/shared/inMemoryEventStore.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/shared/inMemoryEventStore.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/shared/inMemoryEventStore.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/inMemory.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/inMemory.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/inMemory.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/inMemory.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/package.json create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/clients.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/clients.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/clients.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/clients.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/errors.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/errors.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/errors.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/errors.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/authorize.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/authorize.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/authorize.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/authorize.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/metadata.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/metadata.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/metadata.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/metadata.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/register.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/register.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/register.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/register.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/revoke.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/revoke.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/revoke.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/revoke.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/token.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/token.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/token.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/token.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/allowedMethods.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/allowedMethods.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/allowedMethods.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/allowedMethods.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/bearerAuth.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/bearerAuth.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/bearerAuth.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/bearerAuth.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/clientAuth.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/clientAuth.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/clientAuth.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/clientAuth.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/provider.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/provider.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/provider.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/provider.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/providers/proxyProvider.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/providers/proxyProvider.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/providers/proxyProvider.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/providers/proxyProvider.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/router.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/router.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/router.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/router.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/types.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/types.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/types.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/types.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/completable.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/completable.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/completable.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/completable.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/index.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/index.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/index.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/index.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/mcp.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/mcp.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/mcp.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/mcp.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/sse.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/sse.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/sse.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/sse.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/stdio.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/stdio.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/stdio.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/stdio.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/streamableHttp.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/streamableHttp.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/streamableHttp.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/server/streamableHttp.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/auth.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/auth.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/auth.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/auth.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/protocol.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/protocol.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/protocol.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/protocol.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/stdio.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/stdio.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/stdio.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/stdio.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/transport.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/transport.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/transport.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/transport.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/uriTemplate.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/uriTemplate.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/uriTemplate.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/uriTemplate.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/types.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/types.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/types.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/cjs/types.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/codegen/code.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/codegen/code.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/codegen/code.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/codegen/index.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/codegen/index.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/codegen/index.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/codegen/scope.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/codegen/scope.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/codegen/scope.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/errors.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/errors.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/errors.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/index.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/index.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/index.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/jtd/parse.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/jtd/parse.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/jtd/parse.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/jtd/serialize.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/jtd/serialize.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/jtd/serialize.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/jtd/types.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/jtd/types.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/jtd/types.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/names.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/names.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/names.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/ref_error.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/ref_error.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/ref_error.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/resolve.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/resolve.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/resolve.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/rules.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/rules.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/rules.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/util.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/util.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/util.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/validate/applicability.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/validate/applicability.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/validate/applicability.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/validate/boolSchema.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/validate/boolSchema.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/validate/boolSchema.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/validate/dataType.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/validate/dataType.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/validate/dataType.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/validate/defaults.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/validate/defaults.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/validate/defaults.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/validate/index.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/validate/index.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/validate/index.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/validate/keyword.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/validate/keyword.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/validate/keyword.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/validate/subschema.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/validate/subschema.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/compile/validate/subschema.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/core.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/core.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/core.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/cli.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/cli.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/cli.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/cli.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/client/auth.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/client/auth.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/client/auth.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/client/auth.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/client/index.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/client/index.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/client/index.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/client/index.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/client/sse.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/client/sse.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/client/sse.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/client/sse.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/client/stdio.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/client/stdio.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/client/stdio.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/client/stdio.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/client/streamableHttp.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/client/streamableHttp.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/client/streamableHttp.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/client/streamableHttp.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/client/websocket.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/client/websocket.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/client/websocket.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/client/websocket.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/multipleClientsParallel.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/multipleClientsParallel.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/multipleClientsParallel.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/multipleClientsParallel.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/parallelToolCallsClient.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/parallelToolCallsClient.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/parallelToolCallsClient.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/parallelToolCallsClient.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/simpleOAuthClient.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/simpleOAuthClient.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/simpleOAuthClient.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/simpleOAuthClient.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/simpleStreamableHttp.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/simpleStreamableHttp.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/simpleStreamableHttp.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/simpleStreamableHttp.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/streamableHttpWithSseFallbackClient.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/streamableHttpWithSseFallbackClient.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/streamableHttpWithSseFallbackClient.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/streamableHttpWithSseFallbackClient.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/demoInMemoryOAuthProvider.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/demoInMemoryOAuthProvider.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/demoInMemoryOAuthProvider.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/demoInMemoryOAuthProvider.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/jsonResponseStreamableHttp.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/jsonResponseStreamableHttp.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/jsonResponseStreamableHttp.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/jsonResponseStreamableHttp.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/mcpServerOutputSchema.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/mcpServerOutputSchema.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/mcpServerOutputSchema.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/mcpServerOutputSchema.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleSseServer.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleSseServer.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleSseServer.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleSseServer.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleStatelessStreamableHttp.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleStatelessStreamableHttp.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleStatelessStreamableHttp.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleStatelessStreamableHttp.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleStreamableHttp.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleStreamableHttp.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleStreamableHttp.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleStreamableHttp.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/sseAndStreamableHttpCompatibleServer.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/sseAndStreamableHttpCompatibleServer.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/sseAndStreamableHttpCompatibleServer.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/sseAndStreamableHttpCompatibleServer.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/standaloneSseWithGetStreamableHttp.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/standaloneSseWithGetStreamableHttp.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/standaloneSseWithGetStreamableHttp.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/standaloneSseWithGetStreamableHttp.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/shared/inMemoryEventStore.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/shared/inMemoryEventStore.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/shared/inMemoryEventStore.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/examples/shared/inMemoryEventStore.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/inMemory.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/inMemory.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/inMemory.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/inMemory.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/package.json create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/clients.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/clients.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/clients.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/clients.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/errors.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/errors.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/errors.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/errors.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/authorize.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/authorize.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/authorize.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/authorize.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/metadata.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/metadata.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/metadata.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/metadata.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/register.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/register.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/register.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/register.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/revoke.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/revoke.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/revoke.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/revoke.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/token.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/token.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/token.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/token.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/allowedMethods.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/allowedMethods.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/allowedMethods.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/allowedMethods.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/bearerAuth.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/bearerAuth.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/bearerAuth.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/bearerAuth.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/clientAuth.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/clientAuth.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/clientAuth.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/clientAuth.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/provider.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/provider.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/provider.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/provider.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/providers/proxyProvider.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/providers/proxyProvider.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/providers/proxyProvider.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/providers/proxyProvider.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/router.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/router.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/router.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/router.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/types.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/types.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/types.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/types.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/completable.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/completable.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/completable.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/completable.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/index.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/index.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/index.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/index.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/mcp.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/mcp.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/mcp.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/mcp.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/sse.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/sse.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/sse.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/sse.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/stdio.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/stdio.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/stdio.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/stdio.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/streamableHttp.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/streamableHttp.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/streamableHttp.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/server/streamableHttp.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/shared/auth.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/shared/auth.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/shared/auth.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/shared/auth.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/shared/protocol.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/shared/protocol.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/shared/protocol.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/shared/protocol.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/shared/stdio.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/shared/stdio.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/shared/stdio.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/shared/stdio.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/shared/transport.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/shared/transport.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/shared/transport.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/shared/transport.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/shared/uriTemplate.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/shared/uriTemplate.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/shared/uriTemplate.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/shared/uriTemplate.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/types.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/types.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/types.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/esm/types.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/jtd.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/jtd.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/jtd.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/refs/data.json create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2019-09/index.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2019-09/index.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2019-09/index.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2019-09/meta/applicator.json create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2019-09/meta/content.json create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2019-09/meta/core.json create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2019-09/meta/format.json create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2019-09/meta/validation.json create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2019-09/schema.json create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/index.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/index.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/index.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/meta/applicator.json create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/meta/content.json create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/meta/core.json create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/meta/validation.json create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/schema.json create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-draft-06.json create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-draft-07.json create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-secure.json create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/refs/jtd-schema.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/refs/jtd-schema.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/refs/jtd-schema.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/runtime/equal.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/runtime/equal.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/runtime/equal.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/runtime/parseJson.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/runtime/parseJson.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/runtime/parseJson.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/runtime/quote.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/runtime/quote.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/runtime/quote.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/runtime/re2.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/runtime/re2.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/runtime/re2.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/runtime/timestamp.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/runtime/timestamp.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/runtime/timestamp.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/runtime/ucs2length.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/runtime/ucs2length.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/runtime/ucs2length.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/runtime/uri.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/runtime/uri.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/runtime/uri.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/runtime/validation_error.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/runtime/validation_error.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/runtime/validation_error.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/standalone/index.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/standalone/index.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/standalone/index.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/standalone/instance.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/standalone/instance.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/standalone/instance.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/types/index.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/types/index.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/types/index.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/types/json-schema.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/types/json-schema.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/types/json-schema.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/types/jtd-schema.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/types/jtd-schema.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/types/jtd-schema.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/additionalItems.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/additionalItems.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/additionalItems.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/additionalProperties.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/additionalProperties.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/additionalProperties.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/allOf.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/allOf.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/allOf.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/anyOf.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/anyOf.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/anyOf.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/contains.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/contains.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/contains.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/dependencies.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/dependencies.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/dependencies.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/dependentSchemas.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/dependentSchemas.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/dependentSchemas.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/if.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/if.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/if.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/index.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/index.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/index.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/items.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/items.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/items.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/items2020.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/items2020.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/items2020.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/not.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/not.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/not.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/oneOf.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/oneOf.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/oneOf.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/patternProperties.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/patternProperties.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/patternProperties.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/prefixItems.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/prefixItems.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/prefixItems.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/properties.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/properties.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/properties.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/propertyNames.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/propertyNames.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/propertyNames.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/thenElse.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/thenElse.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/thenElse.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/code.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/code.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/code.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/core/id.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/core/id.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/core/id.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/core/index.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/core/index.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/core/index.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/core/ref.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/core/ref.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/core/ref.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/discriminator/index.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/discriminator/index.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/discriminator/index.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/discriminator/types.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/discriminator/types.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/discriminator/types.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/draft2020.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/draft2020.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/draft2020.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/draft7.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/draft7.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/draft7.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/dynamicAnchor.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/dynamicAnchor.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/dynamicAnchor.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/dynamicRef.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/dynamicRef.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/dynamicRef.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/index.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/index.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/index.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/recursiveAnchor.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/recursiveAnchor.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/recursiveAnchor.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/recursiveRef.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/recursiveRef.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/recursiveRef.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/errors.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/errors.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/errors.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/format/format.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/format/format.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/format/format.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/format/index.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/format/index.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/format/index.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/discriminator.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/discriminator.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/discriminator.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/elements.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/elements.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/elements.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/enum.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/enum.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/enum.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/error.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/error.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/error.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/index.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/index.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/index.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/metadata.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/metadata.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/metadata.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/nullable.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/nullable.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/nullable.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/optionalProperties.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/optionalProperties.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/optionalProperties.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/properties.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/properties.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/properties.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/ref.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/ref.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/ref.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/type.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/type.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/type.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/union.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/union.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/union.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/values.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/values.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/values.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/metadata.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/metadata.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/metadata.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/next.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/next.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/next.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/unevaluated/index.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/unevaluated/index.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/unevaluated/index.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/unevaluated/unevaluatedItems.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/const.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/const.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/const.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/dependentRequired.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/dependentRequired.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/dependentRequired.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/enum.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/enum.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/enum.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/index.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/index.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/index.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitContains.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitContains.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitContains.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitItems.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitItems.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitItems.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitLength.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitLength.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitLength.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitNumber.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitNumber.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitNumber.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitProperties.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitProperties.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitProperties.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/multipleOf.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/multipleOf.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/multipleOf.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/pattern.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/pattern.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/pattern.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/required.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/required.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/required.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/uniqueItems.d.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/uniqueItems.js create mode 100644 front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/uniqueItems.js.map create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/2019.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/2020.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/ajv.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/compile/codegen/code.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/compile/codegen/index.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/compile/codegen/scope.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/compile/errors.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/compile/index.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/compile/jtd/parse.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/compile/jtd/serialize.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/compile/jtd/types.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/compile/names.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/compile/ref_error.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/compile/resolve.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/compile/rules.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/compile/util.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/compile/validate/applicability.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/compile/validate/boolSchema.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/compile/validate/dataType.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/compile/validate/defaults.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/compile/validate/index.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/compile/validate/keyword.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/compile/validate/subschema.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/core.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/jtd.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/refs/data.json create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2019-09/index.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2019-09/meta/applicator.json create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2019-09/meta/content.json create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2019-09/meta/core.json create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2019-09/meta/format.json create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2019-09/meta/validation.json create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2019-09/schema.json create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2020-12/index.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2020-12/meta/applicator.json create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2020-12/meta/content.json create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2020-12/meta/core.json create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2020-12/meta/format-annotation.json create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2020-12/meta/meta-data.json create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2020-12/meta/unevaluated.json create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2020-12/meta/validation.json create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2020-12/schema.json create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-draft-06.json create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-draft-07.json create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-secure.json create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/refs/jtd-schema.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/runtime/equal.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/runtime/parseJson.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/runtime/quote.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/runtime/re2.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/runtime/timestamp.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/runtime/ucs2length.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/runtime/uri.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/runtime/validation_error.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/standalone/index.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/standalone/instance.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/types/index.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/types/json-schema.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/types/jtd-schema.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/additionalItems.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/additionalProperties.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/allOf.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/anyOf.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/contains.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/dependencies.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/dependentSchemas.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/if.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/index.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/items.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/items2020.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/not.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/oneOf.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/patternProperties.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/prefixItems.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/properties.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/propertyNames.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/thenElse.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/code.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/core/id.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/core/index.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/core/ref.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/discriminator/index.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/discriminator/types.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/draft2020.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/draft7.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/dynamic/dynamicAnchor.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/dynamic/dynamicRef.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/dynamic/index.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/dynamic/recursiveAnchor.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/dynamic/recursiveRef.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/errors.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/format/format.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/format/index.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/discriminator.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/elements.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/enum.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/error.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/index.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/metadata.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/nullable.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/optionalProperties.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/properties.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/ref.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/type.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/union.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/values.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/metadata.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/next.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/unevaluated/index.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/unevaluated/unevaluatedItems.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/unevaluated/unevaluatedProperties.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/const.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/dependentRequired.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/enum.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/index.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/limitContains.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/limitItems.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/limitLength.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/limitNumber.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/limitProperties.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/multipleOf.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/pattern.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/required.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/uniqueItems.ts create mode 100644 front_end/third_party/mcp-sdk/ajv/package.json create mode 100644 front_end/third_party/mcp-sdk/eventsource-parser/package/LICENSE create mode 100644 front_end/third_party/mcp-sdk/eventsource-parser/package/README.md create mode 100644 front_end/third_party/mcp-sdk/eventsource-parser/package/dist/index.cjs create mode 100644 front_end/third_party/mcp-sdk/eventsource-parser/package/dist/index.cjs.map create mode 100644 front_end/third_party/mcp-sdk/eventsource-parser/package/dist/index.d.cts create mode 100644 front_end/third_party/mcp-sdk/eventsource-parser/package/dist/index.d.ts create mode 100644 front_end/third_party/mcp-sdk/eventsource-parser/package/dist/index.js create mode 100644 front_end/third_party/mcp-sdk/eventsource-parser/package/dist/index.js.map create mode 100644 front_end/third_party/mcp-sdk/eventsource-parser/package/dist/stream.cjs create mode 100644 front_end/third_party/mcp-sdk/eventsource-parser/package/dist/stream.cjs.map create mode 100644 front_end/third_party/mcp-sdk/eventsource-parser/package/dist/stream.d.cts create mode 100644 front_end/third_party/mcp-sdk/eventsource-parser/package/dist/stream.d.ts create mode 100644 front_end/third_party/mcp-sdk/eventsource-parser/package/dist/stream.js create mode 100644 front_end/third_party/mcp-sdk/eventsource-parser/package/dist/stream.js.map create mode 100644 front_end/third_party/mcp-sdk/eventsource-parser/package/package.json create mode 100644 front_end/third_party/mcp-sdk/eventsource-parser/package/src/errors.ts create mode 100644 front_end/third_party/mcp-sdk/eventsource-parser/package/src/index.ts create mode 100644 front_end/third_party/mcp-sdk/eventsource-parser/package/src/parse.ts create mode 100644 front_end/third_party/mcp-sdk/eventsource-parser/package/src/stream.ts create mode 100644 front_end/third_party/mcp-sdk/eventsource-parser/package/src/types.ts create mode 100644 front_end/third_party/mcp-sdk/eventsource-parser/package/stream.js create mode 100644 front_end/third_party/mcp-sdk/mcp-sdk-tsconfig.json create mode 100644 front_end/third_party/mcp-sdk/mcp-sdk.ts create mode 100644 front_end/third_party/mcp-sdk/package/LICENSE create mode 100644 front_end/third_party/mcp-sdk/package/README.md create mode 100644 front_end/third_party/mcp-sdk/package/dist/cli.d.ts create mode 100644 front_end/third_party/mcp-sdk/package/dist/cli.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/package/dist/cli.js create mode 100644 front_end/third_party/mcp-sdk/package/dist/cli.js.map create mode 100644 front_end/third_party/mcp-sdk/package/dist/client/index.d.ts create mode 100644 front_end/third_party/mcp-sdk/package/dist/client/index.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/package/dist/client/index.js create mode 100644 front_end/third_party/mcp-sdk/package/dist/client/index.js.map create mode 100644 front_end/third_party/mcp-sdk/package/dist/client/index.test.d.ts create mode 100644 front_end/third_party/mcp-sdk/package/dist/client/index.test.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/package/dist/client/index.test.js create mode 100644 front_end/third_party/mcp-sdk/package/dist/client/index.test.js.map create mode 100644 front_end/third_party/mcp-sdk/package/dist/client/sse.d.ts create mode 100644 front_end/third_party/mcp-sdk/package/dist/client/sse.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/package/dist/client/sse.js create mode 100644 front_end/third_party/mcp-sdk/package/dist/client/sse.js.map create mode 100644 front_end/third_party/mcp-sdk/package/dist/client/stdio.d.ts create mode 100644 front_end/third_party/mcp-sdk/package/dist/client/stdio.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/package/dist/client/stdio.js create mode 100644 front_end/third_party/mcp-sdk/package/dist/client/stdio.js.map create mode 100644 front_end/third_party/mcp-sdk/package/dist/client/stdio.test.d.ts create mode 100644 front_end/third_party/mcp-sdk/package/dist/client/stdio.test.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/package/dist/client/stdio.test.js create mode 100644 front_end/third_party/mcp-sdk/package/dist/client/stdio.test.js.map create mode 100644 front_end/third_party/mcp-sdk/package/dist/client/websocket.d.ts create mode 100644 front_end/third_party/mcp-sdk/package/dist/client/websocket.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/package/dist/client/websocket.js create mode 100644 front_end/third_party/mcp-sdk/package/dist/client/websocket.js.map create mode 100644 front_end/third_party/mcp-sdk/package/dist/inMemory.d.ts create mode 100644 front_end/third_party/mcp-sdk/package/dist/inMemory.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/package/dist/inMemory.js create mode 100644 front_end/third_party/mcp-sdk/package/dist/inMemory.js.map create mode 100644 front_end/third_party/mcp-sdk/package/dist/inMemory.test.d.ts create mode 100644 front_end/third_party/mcp-sdk/package/dist/inMemory.test.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/package/dist/inMemory.test.js create mode 100644 front_end/third_party/mcp-sdk/package/dist/inMemory.test.js.map create mode 100644 front_end/third_party/mcp-sdk/package/dist/server/index.d.ts create mode 100644 front_end/third_party/mcp-sdk/package/dist/server/index.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/package/dist/server/index.js create mode 100644 front_end/third_party/mcp-sdk/package/dist/server/index.js.map create mode 100644 front_end/third_party/mcp-sdk/package/dist/server/index.test.d.ts create mode 100644 front_end/third_party/mcp-sdk/package/dist/server/index.test.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/package/dist/server/index.test.js create mode 100644 front_end/third_party/mcp-sdk/package/dist/server/index.test.js.map create mode 100644 front_end/third_party/mcp-sdk/package/dist/server/sse.d.ts create mode 100644 front_end/third_party/mcp-sdk/package/dist/server/sse.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/package/dist/server/sse.js create mode 100644 front_end/third_party/mcp-sdk/package/dist/server/sse.js.map create mode 100644 front_end/third_party/mcp-sdk/package/dist/server/stdio.d.ts create mode 100644 front_end/third_party/mcp-sdk/package/dist/server/stdio.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/package/dist/server/stdio.js create mode 100644 front_end/third_party/mcp-sdk/package/dist/server/stdio.js.map create mode 100644 front_end/third_party/mcp-sdk/package/dist/server/stdio.test.d.ts create mode 100644 front_end/third_party/mcp-sdk/package/dist/server/stdio.test.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/package/dist/server/stdio.test.js create mode 100644 front_end/third_party/mcp-sdk/package/dist/server/stdio.test.js.map create mode 100644 front_end/third_party/mcp-sdk/package/dist/shared/protocol.d.ts create mode 100644 front_end/third_party/mcp-sdk/package/dist/shared/protocol.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/package/dist/shared/protocol.js create mode 100644 front_end/third_party/mcp-sdk/package/dist/shared/protocol.js.map create mode 100644 front_end/third_party/mcp-sdk/package/dist/shared/stdio.d.ts create mode 100644 front_end/third_party/mcp-sdk/package/dist/shared/stdio.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/package/dist/shared/stdio.js create mode 100644 front_end/third_party/mcp-sdk/package/dist/shared/stdio.js.map create mode 100644 front_end/third_party/mcp-sdk/package/dist/shared/stdio.test.d.ts create mode 100644 front_end/third_party/mcp-sdk/package/dist/shared/stdio.test.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/package/dist/shared/stdio.test.js create mode 100644 front_end/third_party/mcp-sdk/package/dist/shared/stdio.test.js.map create mode 100644 front_end/third_party/mcp-sdk/package/dist/shared/transport.d.ts create mode 100644 front_end/third_party/mcp-sdk/package/dist/shared/transport.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/package/dist/shared/transport.js create mode 100644 front_end/third_party/mcp-sdk/package/dist/shared/transport.js.map create mode 100644 front_end/third_party/mcp-sdk/package/dist/types.d.ts create mode 100644 front_end/third_party/mcp-sdk/package/dist/types.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/package/dist/types.js create mode 100644 front_end/third_party/mcp-sdk/package/dist/types.js.map create mode 100644 front_end/third_party/mcp-sdk/package/package.json create mode 100644 front_end/third_party/mcp-sdk/zod/LICENSE create mode 100644 front_end/third_party/mcp-sdk/zod/README.md create mode 100644 front_end/third_party/mcp-sdk/zod/dist/cli.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/dist/cli.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/zod/dist/cli.js create mode 100644 front_end/third_party/mcp-sdk/zod/dist/cli.js.map create mode 100644 front_end/third_party/mcp-sdk/zod/dist/client/index.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/dist/client/index.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/zod/dist/client/index.js create mode 100644 front_end/third_party/mcp-sdk/zod/dist/client/index.js.map create mode 100644 front_end/third_party/mcp-sdk/zod/dist/client/index.test.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/dist/client/index.test.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/zod/dist/client/index.test.js create mode 100644 front_end/third_party/mcp-sdk/zod/dist/client/index.test.js.map create mode 100644 front_end/third_party/mcp-sdk/zod/dist/client/sse.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/dist/client/sse.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/zod/dist/client/sse.js create mode 100644 front_end/third_party/mcp-sdk/zod/dist/client/sse.js.map create mode 100644 front_end/third_party/mcp-sdk/zod/dist/client/stdio.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/dist/client/stdio.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/zod/dist/client/stdio.js create mode 100644 front_end/third_party/mcp-sdk/zod/dist/client/stdio.js.map create mode 100644 front_end/third_party/mcp-sdk/zod/dist/client/stdio.test.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/dist/client/stdio.test.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/zod/dist/client/stdio.test.js create mode 100644 front_end/third_party/mcp-sdk/zod/dist/client/stdio.test.js.map create mode 100644 front_end/third_party/mcp-sdk/zod/dist/client/websocket.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/dist/client/websocket.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/zod/dist/client/websocket.js create mode 100644 front_end/third_party/mcp-sdk/zod/dist/client/websocket.js.map create mode 100644 front_end/third_party/mcp-sdk/zod/dist/inMemory.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/dist/inMemory.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/zod/dist/inMemory.js create mode 100644 front_end/third_party/mcp-sdk/zod/dist/inMemory.js.map create mode 100644 front_end/third_party/mcp-sdk/zod/dist/inMemory.test.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/dist/inMemory.test.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/zod/dist/inMemory.test.js create mode 100644 front_end/third_party/mcp-sdk/zod/dist/inMemory.test.js.map create mode 100644 front_end/third_party/mcp-sdk/zod/dist/server/index.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/dist/server/index.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/zod/dist/server/index.js create mode 100644 front_end/third_party/mcp-sdk/zod/dist/server/index.js.map create mode 100644 front_end/third_party/mcp-sdk/zod/dist/server/index.test.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/dist/server/index.test.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/zod/dist/server/index.test.js create mode 100644 front_end/third_party/mcp-sdk/zod/dist/server/index.test.js.map create mode 100644 front_end/third_party/mcp-sdk/zod/dist/server/sse.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/dist/server/sse.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/zod/dist/server/sse.js create mode 100644 front_end/third_party/mcp-sdk/zod/dist/server/sse.js.map create mode 100644 front_end/third_party/mcp-sdk/zod/dist/server/stdio.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/dist/server/stdio.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/zod/dist/server/stdio.js create mode 100644 front_end/third_party/mcp-sdk/zod/dist/server/stdio.js.map create mode 100644 front_end/third_party/mcp-sdk/zod/dist/server/stdio.test.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/dist/server/stdio.test.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/zod/dist/server/stdio.test.js create mode 100644 front_end/third_party/mcp-sdk/zod/dist/server/stdio.test.js.map create mode 100644 front_end/third_party/mcp-sdk/zod/dist/shared/protocol.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/dist/shared/protocol.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/zod/dist/shared/protocol.js create mode 100644 front_end/third_party/mcp-sdk/zod/dist/shared/protocol.js.map create mode 100644 front_end/third_party/mcp-sdk/zod/dist/shared/stdio.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/dist/shared/stdio.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/zod/dist/shared/stdio.js create mode 100644 front_end/third_party/mcp-sdk/zod/dist/shared/stdio.js.map create mode 100644 front_end/third_party/mcp-sdk/zod/dist/shared/stdio.test.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/dist/shared/stdio.test.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/zod/dist/shared/stdio.test.js create mode 100644 front_end/third_party/mcp-sdk/zod/dist/shared/stdio.test.js.map create mode 100644 front_end/third_party/mcp-sdk/zod/dist/shared/transport.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/dist/shared/transport.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/zod/dist/shared/transport.js create mode 100644 front_end/third_party/mcp-sdk/zod/dist/shared/transport.js.map create mode 100644 front_end/third_party/mcp-sdk/zod/dist/types.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/dist/types.d.ts.map create mode 100644 front_end/third_party/mcp-sdk/zod/dist/types.js create mode 100644 front_end/third_party/mcp-sdk/zod/dist/types.js.map create mode 100644 front_end/third_party/mcp-sdk/zod/index.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/lib/ZodError.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/lib/ZodError.js create mode 100644 front_end/third_party/mcp-sdk/zod/lib/__tests__/Mocker.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/lib/__tests__/Mocker.js create mode 100644 front_end/third_party/mcp-sdk/zod/lib/benchmarks/datetime.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/lib/benchmarks/datetime.js create mode 100644 front_end/third_party/mcp-sdk/zod/lib/benchmarks/discriminatedUnion.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/lib/benchmarks/discriminatedUnion.js create mode 100644 front_end/third_party/mcp-sdk/zod/lib/benchmarks/index.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/lib/benchmarks/index.js create mode 100644 front_end/third_party/mcp-sdk/zod/lib/benchmarks/ipv4.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/lib/benchmarks/ipv4.js create mode 100644 front_end/third_party/mcp-sdk/zod/lib/benchmarks/object.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/lib/benchmarks/object.js create mode 100644 front_end/third_party/mcp-sdk/zod/lib/benchmarks/primitives.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/lib/benchmarks/primitives.js create mode 100644 front_end/third_party/mcp-sdk/zod/lib/benchmarks/realworld.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/lib/benchmarks/realworld.js create mode 100644 front_end/third_party/mcp-sdk/zod/lib/benchmarks/string.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/lib/benchmarks/string.js create mode 100644 front_end/third_party/mcp-sdk/zod/lib/benchmarks/union.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/lib/benchmarks/union.js create mode 100644 front_end/third_party/mcp-sdk/zod/lib/errors.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/lib/errors.js create mode 100644 front_end/third_party/mcp-sdk/zod/lib/external.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/lib/external.js create mode 100644 front_end/third_party/mcp-sdk/zod/lib/helpers/enumUtil.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/lib/helpers/enumUtil.js create mode 100644 front_end/third_party/mcp-sdk/zod/lib/helpers/errorUtil.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/lib/helpers/errorUtil.js create mode 100644 front_end/third_party/mcp-sdk/zod/lib/helpers/parseUtil.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/lib/helpers/parseUtil.js create mode 100644 front_end/third_party/mcp-sdk/zod/lib/helpers/partialUtil.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/lib/helpers/partialUtil.js create mode 100644 front_end/third_party/mcp-sdk/zod/lib/helpers/typeAliases.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/lib/helpers/typeAliases.js create mode 100644 front_end/third_party/mcp-sdk/zod/lib/helpers/util.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/lib/helpers/util.js create mode 100644 front_end/third_party/mcp-sdk/zod/lib/index.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/lib/index.js create mode 100644 front_end/third_party/mcp-sdk/zod/lib/index.mjs create mode 100644 front_end/third_party/mcp-sdk/zod/lib/index.umd.js create mode 100644 front_end/third_party/mcp-sdk/zod/lib/locales/en.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/lib/locales/en.js create mode 100644 front_end/third_party/mcp-sdk/zod/lib/types.d.ts create mode 100644 front_end/third_party/mcp-sdk/zod/lib/types.js create mode 100644 front_end/third_party/mcp-sdk/zod/package.json diff --git a/config/gni/devtools_grd_files.gni b/config/gni/devtools_grd_files.gni index 39d0f41d99..ea120f0deb 100644 --- a/config/gni/devtools_grd_files.gni +++ b/config/gni/devtools_grd_files.gni @@ -633,6 +633,7 @@ grd_files_bundled_sources = [ "front_end/panels/ai_chat/core/PageInfoManager.js", "front_end/panels/ai_chat/core/AgentNodes.js", "front_end/panels/ai_chat/core/GraphHelpers.js", + "front_end/panels/ai_chat/core/ToolSurfaceProvider.js", "front_end/panels/ai_chat/core/StateGraph.js", "front_end/panels/ai_chat/core/Logger.js", "front_end/panels/ai_chat/core/AgentErrorHandler.js", @@ -700,6 +701,11 @@ grd_files_bundled_sources = [ "front_end/panels/ai_chat/evaluation/utils/PromptTemplates.js", "front_end/panels/ai_chat/evaluation/utils/ResponseParsingUtils.js", "front_end/panels/ai_chat/evaluation/utils/SanitizationUtils.js", + "front_end/panels/ai_chat/mcp/MCPConfig.js", + "front_end/panels/ai_chat/mcp/MCPRegistry.js", + "front_end/panels/ai_chat/mcp/MCPToolAdapter.js", + "front_end/panels/ai_chat/mcp/MCPMetaTools.js", + "front_end/panels/ai_chat/tools/LLMTracingWrapper.js", "front_end/panels/animation/animation-meta.js", "front_end/panels/animation/animation.js", "front_end/panels/application/application-meta.js", @@ -837,6 +843,17 @@ grd_files_bundled_sources = [ "front_end/third_party/lighthouse/lighthouse-dt-bundle.js", "front_end/third_party/lighthouse/report/report.js", "front_end/third_party/lit/lit.js", + "front_end/third_party/mcp-sdk/ajv/dist/ajv.js", + "front_end/third_party/mcp-sdk/zod/lib/index.js", + "front_end/third_party/mcp-sdk/zod/lib/index.mjs", + "front_end/third_party/mcp-sdk/eventsource-parser/package/dist/index.js", + "front_end/third_party/mcp-sdk/eventsource-parser/package/dist/stream.js", + "front_end/third_party/mcp-sdk/mcp-sdk.js", + "front_end/third_party/mcp-sdk/package/dist/client/index.js", + "front_end/third_party/mcp-sdk/package/dist/client/sse.js", + "front_end/third_party/mcp-sdk/package/dist/shared/protocol.js", + "front_end/third_party/mcp-sdk/package/dist/shared/transport.js", + "front_end/third_party/mcp-sdk/package/dist/types.js", "front_end/third_party/marked/marked.js", "front_end/third_party/puppeteer-replay/puppeteer-replay.js", "front_end/third_party/puppeteer/puppeteer.js", diff --git a/front_end/panels/ai_chat/BUILD.gn b/front_end/panels/ai_chat/BUILD.gn index 0ae6cecf55..bf8d12a204 100644 --- a/front_end/panels/ai_chat/BUILD.gn +++ b/front_end/panels/ai_chat/BUILD.gn @@ -34,6 +34,7 @@ devtools_module("ai_chat") { "core/PageInfoManager.ts", "core/AgentNodes.ts", "core/GraphHelpers.ts", + "core/ToolSurfaceProvider.ts", "core/StateGraph.ts", "core/Logger.ts", "core/AgentErrorHandler.ts", @@ -99,6 +100,10 @@ devtools_module("ai_chat") { "tracing/TracingConfig.ts", "auth/PKCEUtils.ts", "auth/OpenRouterOAuth.ts", + "mcp/MCPConfig.ts", + "mcp/MCPToolAdapter.ts", + "mcp/MCPRegistry.ts", + "mcp/MCPMetaTools.ts", ] deps = [ @@ -108,6 +113,7 @@ devtools_module("ai_chat") { "../../core/sdk:bundle", "../../generated:protocol", "../../models/logs:bundle", + "../../third_party/mcp-sdk:bundle", "../../ui/components/helpers:bundle", "../../ui/components/markdown_view:bundle", "../../ui/components/snackbars:bundle", @@ -139,6 +145,7 @@ _ai_chat_sources = [ "core/PageInfoManager.ts", "core/AgentNodes.ts", "core/GraphHelpers.ts", + "core/ToolSurfaceProvider.ts", "core/StateGraph.ts", "core/Logger.ts", "core/AgentErrorHandler.ts", @@ -203,6 +210,10 @@ _ai_chat_sources = [ "tracing/TracingConfig.ts", "auth/PKCEUtils.ts", "auth/OpenRouterOAuth.ts", + "mcp/MCPConfig.ts", + "mcp/MCPToolAdapter.ts", + "mcp/MCPRegistry.ts", + "mcp/MCPMetaTools.ts", ] # Construct the expected JS output paths for the metadata @@ -287,6 +298,9 @@ ts_library("unittests") { sources = [ "common/utils.test.ts", + "mcp/MCPClientSDK.test.ts", + "core/ToolSurfaceProvider.test.ts", + "core/ToolNameMapping.test.ts", ] deps = [ diff --git a/front_end/panels/ai_chat/agent_framework/ConfigurableAgentTool.ts b/front_end/panels/ai_chat/agent_framework/ConfigurableAgentTool.ts index f20b99b816..63ec6b5e02 100644 --- a/front_end/panels/ai_chat/agent_framework/ConfigurableAgentTool.ts +++ b/front_end/panels/ai_chat/agent_framework/ConfigurableAgentTool.ts @@ -182,7 +182,7 @@ export class ToolRegistry { try { const instance = factory(); this.registeredTools.set(name, instance); - logger.info('Registered and instantiated tool: ${name}'); + logger.info(`Registered and instantiated tool: ${name}`); } catch (error) { logger.error(`Failed to instantiate tool '${name}' during registration:`, error); // Remove the factory entry if instantiation fails diff --git a/front_end/panels/ai_chat/agent_framework/implementation/ConfiguredAgents.ts b/front_end/panels/ai_chat/agent_framework/implementation/ConfiguredAgents.ts index 60d437cbba..891f4c78cf 100644 --- a/front_end/panels/ai_chat/agent_framework/implementation/ConfiguredAgents.ts +++ b/front_end/panels/ai_chat/agent_framework/implementation/ConfiguredAgents.ts @@ -19,6 +19,7 @@ import { import { WaitTool } from '../../tools/Tools.js'; import { ThinkingTool } from '../../tools/ThinkingTool.js'; import type { Tool } from '../../tools/Tools.js'; +import { registerMCPMetaTools } from '../../mcp/MCPMetaTools.js'; /** * Configuration for the Direct URL Navigator Agent @@ -94,6 +95,8 @@ Remember: Always use navigate_url to actually go to the constructed URLs. Return * Initialize all configured agents */ export function initializeConfiguredAgents(): void { + // Ensure MCP meta-tools are available regardless of mode; selection logic decides if they are surfaced + registerMCPMetaTools(); // Register core tools ToolRegistry.registerToolFactory('navigate_url', () => new NavigateURLTool()); ToolRegistry.registerToolFactory('navigate_back', () => new NavigateBackTool()); diff --git a/front_end/panels/ai_chat/core/AgentNodes.test.ts b/front_end/panels/ai_chat/core/AgentNodes.test.ts new file mode 100644 index 0000000000..0cfc2cdf83 --- /dev/null +++ b/front_end/panels/ai_chat/core/AgentNodes.test.ts @@ -0,0 +1,204 @@ +// Copyright 2025 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import { createToolExecutorNode } from './AgentNodes.js'; +import { ConfigurableAgentTool } from '../agent_framework/ConfigurableAgentTool.js'; +import { ChatMessageEntity } from '../ui/ChatView.js'; +import type { AgentState } from './State.js'; +import type { ConfigurableAgentResult } from '../agent_framework/ConfigurableAgentTool.js'; + +declare global { + function describe(name: string, fn: () => void): void; + function it(name: string, fn: () => void): void; + function beforeEach(fn: () => void): void; + function afterEach(fn: () => void): void; + namespace assert { + function strictEqual(actual: unknown, expected: unknown): void; + function deepEqual(actual: unknown, expected: unknown): void; + function isTrue(value: unknown): void; + function isFalse(value: unknown): void; + function doesNotMatch(actual: string, regexp: RegExp): void; + } +} + +describe('AgentNodes ToolExecutorNode', () => { + describe('ConfigurableAgentTool result filtering', () => { + it('should filter out agentSession data from error results', async () => { + // Create a mock ConfigurableAgentTool that returns error with intermediateSteps + const mockAgentSession = { + sessionId: 'test-session-123', + agentName: 'test-agent', + status: 'error', + messages: [ + { id: '1', type: 'tool_call', content: { toolName: 'test_tool' } }, + { id: '2', type: 'tool_result', content: { result: 'test result' } } + ], + // This contains sensitive data that should not leak to LLM + nestedSessions: [], + tools: [], + startTime: new Date(), + endTime: new Date(), + terminationReason: 'max_iterations' + }; + + const errorResultWithSession: ConfigurableAgentResult & { agentSession: any } = { + success: false, + error: 'Agent reached maximum iterations', + terminationReason: 'max_iterations', + // This is the problematic field that contains session data + intermediateSteps: [ + { entity: ChatMessageEntity.USER, text: 'test query' }, + { entity: ChatMessageEntity.AGENT_SESSION, agentSession: mockAgentSession, summary: 'test' } + ], + agentSession: mockAgentSession + }; + + // Create mock ConfigurableAgentTool + class MockConfigurableAgentTool extends ConfigurableAgentTool { + constructor() { + super({ + name: 'mock_agent', + description: 'Mock agent for testing', + systemPrompt: 'Test prompt', + tools: [], + schema: { type: 'object', properties: {}, required: [] } + }); + } + + async execute(): Promise { + return errorResultWithSession; + } + } + + const mockTool = new MockConfigurableAgentTool(); + + // Create initial state with a tool call message + const initialState: AgentState = { + messages: [ + { + entity: ChatMessageEntity.MODEL, + action: 'tool', + toolName: 'mock_agent', + toolArgs: { query: 'test' }, + toolCallId: 'test-call-id', + isFinalAnswer: false + } + ], + agentType: 'web_task', + context: {} + }; + + // Create modified state with mock tool in registry + const stateWithMockTool = { + ...initialState, + // We need to mock the tool registry or provide tools directly + tools: [mockTool] + }; + + // Create ToolExecutorNode + const toolExecutorNode = createToolExecutorNode(stateWithMockTool); + + // Execute the node + const result = await toolExecutorNode.invoke(stateWithMockTool); + + // Verify the result + assert.isTrue(result.messages.length > initialState.messages.length, 'Should add tool result message'); + + const toolResultMessage = result.messages[result.messages.length - 1]; + assert.strictEqual(toolResultMessage.entity, ChatMessageEntity.TOOL_RESULT); + + // The critical test: resultText should NOT contain agentSession data + const resultText = (toolResultMessage as any).resultText; + assert.strictEqual(resultText, 'Error: Agent reached maximum iterations'); + + // Verify that the resultText does not contain session data + assert.doesNotMatch(resultText, /sessionId/); + assert.doesNotMatch(resultText, /test-session-123/); + assert.doesNotMatch(resultText, /intermediateSteps/); + assert.doesNotMatch(resultText, /agentSession/); + assert.doesNotMatch(resultText, /nestedSessions/); + + // The resultText should be clean and only contain the error message + assert.strictEqual(resultText.includes('test-session-123'), false); + }); + + it('should filter out agentSession data from success results', async () => { + // Create a success result with intermediateSteps containing session data + const mockAgentSession = { + sessionId: 'success-session-456', + agentName: 'success-agent', + status: 'completed', + messages: [], + nestedSessions: [], + tools: [], + startTime: new Date(), + endTime: new Date(), + terminationReason: 'final_answer' + }; + + const successResultWithSession: ConfigurableAgentResult & { agentSession: any } = { + success: true, + output: 'Task completed successfully', + terminationReason: 'final_answer', + // This should not leak to LLM + intermediateSteps: [ + { entity: ChatMessageEntity.AGENT_SESSION, agentSession: mockAgentSession, summary: 'test' } + ], + agentSession: mockAgentSession + }; + + class MockSuccessAgentTool extends ConfigurableAgentTool { + constructor() { + super({ + name: 'mock_success_agent', + description: 'Mock success agent for testing', + systemPrompt: 'Test prompt', + tools: [], + schema: { type: 'object', properties: {}, required: [] } + }); + } + + async execute(): Promise { + return successResultWithSession; + } + } + + const mockTool = new MockSuccessAgentTool(); + + const initialState: AgentState = { + messages: [ + { + entity: ChatMessageEntity.MODEL, + action: 'tool', + toolName: 'mock_success_agent', + toolArgs: { query: 'test' }, + toolCallId: 'test-call-id-2', + isFinalAnswer: false + } + ], + agentType: 'web_task', + context: {} + }; + + const stateWithMockTool = { + ...initialState, + tools: [mockTool] + }; + + const toolExecutorNode = createToolExecutorNode(stateWithMockTool); + const result = await toolExecutorNode.invoke(stateWithMockTool); + + const toolResultMessage = result.messages[result.messages.length - 1]; + const resultText = (toolResultMessage as any).resultText; + + // Should contain only the clean output + assert.strictEqual(resultText, 'Task completed successfully'); + + // Should NOT contain session data + assert.doesNotMatch(resultText, /success-session-456/); + assert.doesNotMatch(resultText, /intermediateSteps/); + assert.doesNotMatch(resultText, /agentSession/); + }); + }); +}); \ No newline at end of file diff --git a/front_end/panels/ai_chat/core/AgentNodes.ts b/front_end/panels/ai_chat/core/AgentNodes.ts index 560e517f1f..ba0d2ea4ad 100644 --- a/front_end/panels/ai_chat/core/AgentNodes.ts +++ b/front_end/panels/ai_chat/core/AgentNodes.ts @@ -4,12 +4,13 @@ import type { getTools } from '../tools/Tools.js'; import { ChatMessageEntity, type ModelChatMessage, type ToolResultMessage, type ChatMessage, type AgentSessionMessage } from '../ui/ChatView.js'; -import { ConfigurableAgentTool } from '../agent_framework/ConfigurableAgentTool.js'; +import { ConfigurableAgentTool, ToolRegistry } from '../agent_framework/ConfigurableAgentTool.js'; import { LLMClient } from '../LLM/LLMClient.js'; import type { LLMMessage } from '../LLM/LLMTypes.js'; import { AIChatPanel } from '../ui/AIChatPanel.js'; import { createSystemPromptAsync, getAgentToolsFromState } from './GraphHelpers.js'; +import { ToolSurfaceProvider } from './ToolSurfaceProvider.js'; import { createLogger } from './Logger.js'; import type { AgentState } from './State.js'; import type { Runnable } from './Types.js'; @@ -142,12 +143,17 @@ export function createAgentNode(modelName: string, temperature: number): Runnabl try { const llm = LLMClient.getInstance(); - + // Get provider for the specific model const provider = AIChatPanel.getProviderForModel(this.modelName); - - // Get tools for the current agent type - const tools = getAgentToolsFromState(state); + + // Select tools based on MCP mode (all/router/meta) + const baseTools = getAgentToolsFromState(state); + const selection = await ToolSurfaceProvider.select(state, baseTools, { maxToolsPerTurn: 20, maxMcpPerTurn: 8 }); + // Persist selection in context so ToolExecutorNode can resolve the same set + if (!state.context) { (state as any).context = {}; } + (state.context as any).selectedToolNames = selection.selectedNames; + const tools = selection.tools; // Convert ChatMessage[] to LLMMessage[] const llmMessages = this.convertChatMessagesToLLMMessages(state.messages); @@ -421,9 +427,21 @@ export function createAgentNode(modelName: string, temperature: number): Runnabl } export function createToolExecutorNode(state: AgentState): Runnable { - const tools = getAgentToolsFromState(state); // Adjusted to use getAgentToolsFromState + // If AgentNode has pre-selected tool names, honor that set to ensure consistency + const selectedNames: string[] | undefined = (state.context as any)?.selectedToolNames; + let tools: ReturnType; + if (selectedNames && selectedNames.length > 0) { + const resolved: any[] = []; + for (const name of selectedNames) { + const inst = ToolRegistry.getRegisteredTool(name as any); + if (inst) { resolved.push(inst as any); } + } + tools = resolved as any; + } else { + tools = getAgentToolsFromState(state) as any; + } const toolMap = new Map[number]>(); - tools.forEach((tool: ReturnType[number]) => toolMap.set(tool.name, tool)); + (tools as any[]).forEach((tool: any) => toolMap.set(tool.name, tool)); const toolExecutorNode = new class ToolExecutorNode implements Runnable { private toolMap: Map[number]>; diff --git a/front_end/panels/ai_chat/core/ToolNameMapping.test.ts b/front_end/panels/ai_chat/core/ToolNameMapping.test.ts new file mode 100644 index 0000000000..67909db51a --- /dev/null +++ b/front_end/panels/ai_chat/core/ToolNameMapping.test.ts @@ -0,0 +1,81 @@ +// Copyright 2025 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import { createToolExecutorNode } from './AgentNodes.js'; +import type { AgentState } from './State.js'; +import type { Tool } from '../tools/Tools.js'; +import { ChatMessageEntity } from '../ui/ChatView.js'; + +/* eslint-env mocha */ + +class RecordingTool implements Tool, unknown> { + public calls = 0; + constructor(public name: string) {} + description = 'records calls'; + schema = { type: 'object', properties: {} }; + async execute(_args: Record): Promise { + this.calls += 1; + return { ok: true, executed: this.name }; + } +} + +describe('AgentNodes sanitized tool name mapping', () => { + let mockLocalStorage: Map; + + beforeEach(() => { + // Mock localStorage in case anything touches it + mockLocalStorage = new Map(); + Object.defineProperty(window, 'localStorage', { + value: { + getItem: (key: string) => mockLocalStorage.get(key) || null, + setItem: (key: string, value: string) => mockLocalStorage.set(key, value), + removeItem: (key: string) => mockLocalStorage.delete(key), + clear: () => mockLocalStorage.clear(), + }, + writable: true, + }); + }); + + afterEach(() => { + mockLocalStorage.clear(); + }); + + it('resolves sanitized model tool names back to actual tool instances for execution', async () => { + // Original tool name contains invalid chars for LLM function calling + const originalName = 'mcp:default:alpha'; + const sanitizedName = 'mcp_default_alpha'; + const tool = new RecordingTool(originalName); + + const state: AgentState = { + messages: [ + { + entity: ChatMessageEntity.MODEL, + action: 'tool', + toolName: sanitizedName, + toolArgs: { x: 1 }, + toolCallId: 'call-1', + isFinalAnswer: false, + } as any + ], + agentType: 'deep-research' as any, + context: { + selectedToolNames: [sanitizedName], + selectedTools: [tool], + toolNameMap: { [sanitizedName]: originalName } + } + } as any; + + const node = createToolExecutorNode(state); + const result = await node.invoke(state); + + // Tool execute should have been called once + assert.strictEqual(tool.calls, 1); + + // Should append a tool result message + const last = result.messages[result.messages.length - 1]; + assert.strictEqual(last.entity, ChatMessageEntity.TOOL_RESULT); + assert.strictEqual((last as any).toolName, sanitizedName); + assert.ok((last as any).resultText); + }); +}); diff --git a/front_end/panels/ai_chat/core/ToolSurfaceProvider.test.ts b/front_end/panels/ai_chat/core/ToolSurfaceProvider.test.ts new file mode 100644 index 0000000000..6b6d7c90a4 --- /dev/null +++ b/front_end/panels/ai_chat/core/ToolSurfaceProvider.test.ts @@ -0,0 +1,136 @@ +// Copyright 2025 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import { ToolSurfaceProvider } from './ToolSurfaceProvider.js'; +import type { AgentState } from './State.js'; +import type { Tool } from '../tools/Tools.js'; +import { ToolRegistry } from '../agent_framework/ConfigurableAgentTool.js'; +import { MCPRegistry } from '../mcp/MCPRegistry.js'; +import { registerMCPMetaTools } from '../mcp/MCPMetaTools.js'; + +/* eslint-env mocha */ + +class DummyTool implements Tool, unknown> { + constructor(public name: string, public description: string) {} + schema = { type: 'object', properties: {} }; + async execute(): Promise { return { ok: true, name: this.name }; } +} + +describe('ToolSurfaceProvider selection', () => { + let mockLocalStorage: Map; + let originalGetStatus: typeof MCPRegistry.getStatus; + + beforeEach(() => { + // Mock localStorage + mockLocalStorage = new Map(); + Object.defineProperty(window, 'localStorage', { + value: { + getItem: (key: string) => mockLocalStorage.get(key) || null, + setItem: (key: string, value: string) => mockLocalStorage.set(key, value), + removeItem: (key: string) => mockLocalStorage.delete(key), + clear: () => mockLocalStorage.clear(), + }, + writable: true, + }); + + // Enable MCP in config + localStorage.setItem('ai_chat_mcp_enabled', 'true'); + + // Save original MCPRegistry.getStatus + originalGetStatus = MCPRegistry.getStatus.bind(MCPRegistry); + + // Clear registry state for deterministic tests + // No explicit clear API; test registers use unique names + }); + + afterEach(() => { + // Restore MCPRegistry.getStatus + (MCPRegistry as any).getStatus = originalGetStatus; + mockLocalStorage.clear(); + }); + + it('router mode selects top-K MCP tools by simple relevance and enforces caps', async () => { + // Arrange router config and caps + localStorage.setItem('ai_chat_mcp_tool_mode', 'router'); + const maxMcpPerTurn = '2'; + const maxToolsPerTurn = '4'; + localStorage.setItem('ai_chat_mcp_max_mcp_per_turn', maxMcpPerTurn); + localStorage.setItem('ai_chat_mcp_max_tools_per_turn', maxToolsPerTurn); + + // Register dummy MCP tools in ToolRegistry + const mcpToolNames = [ + 'mcp:default:alpha', + 'mcp:default:beta', + 'mcp:default:gamma' + ]; + ToolRegistry.registerToolFactory(mcpToolNames[0], () => new DummyTool(mcpToolNames[0], 'Alpha compute util')); + ToolRegistry.registerToolFactory(mcpToolNames[1], () => new DummyTool(mcpToolNames[1], 'Beta helper')); + ToolRegistry.registerToolFactory(mcpToolNames[2], () => new DummyTool(mcpToolNames[2], 'Gamma helper')); + + // Stub MCP registry status to advertise these tools + (MCPRegistry as any).getStatus = () => ({ + enabled: true, + servers: [], + registeredToolNames: mcpToolNames, + lastError: undefined, + lastErrorType: undefined, + }); + + // Base tools for the agent + const baseTools: Tool[] = [new DummyTool('core_tool_A', 'Core A'), new DummyTool('core_tool_B', 'Core B')]; + + // Query mentions alpha to bias selection toward alpha + const state: AgentState = { + messages: [{ entity: 0 as any, text: 'please run alpha operation' }], + context: {}, + selectedAgentType: 'deep-research' as any + } as any; + + // Act + const selection = await ToolSurfaceProvider.select(state, baseTools, { maxMcpPerTurn: 2, maxToolsPerTurn: 4 }); + + const names = selection.tools.map(t => t.name); + + // Assert caps + assert.ok(names.includes('core_tool_A')); + assert.ok(names.includes('core_tool_B')); + const selectedMcp = names.filter(n => n.startsWith('mcp:default:')); + assert.strictEqual(selectedMcp.length, 2); + // Alpha should be preferred due to query match + assert.ok(selectedMcp.includes('mcp:default:alpha')); + }); + + it('meta mode surfaces only meta-tools plus base tools', async () => { + // Arrange meta config + localStorage.setItem('ai_chat_mcp_tool_mode', 'meta'); + localStorage.setItem('ai_chat_mcp_max_mcp_per_turn', '8'); + localStorage.setItem('ai_chat_mcp_max_tools_per_turn', '6'); + + // Register meta tools + registerMCPMetaTools(); + + // Also register some MCP tools + const mcpToolNames = ['mcp:default:delta']; + ToolRegistry.registerToolFactory(mcpToolNames[0], () => new DummyTool(mcpToolNames[0], 'Delta')); + (MCPRegistry as any).getStatus = () => ({ + enabled: true, + servers: [], + registeredToolNames: mcpToolNames, + lastError: undefined, + lastErrorType: undefined, + }); + + const baseTools: Tool[] = [new DummyTool('core_tool_A', 'Core A')]; + const state: AgentState = { messages: [], context: {}, selectedAgentType: 'deep-research' as any } as any; + + const selection = await ToolSurfaceProvider.select(state, baseTools, { maxMcpPerTurn: 8, maxToolsPerTurn: 6 }); + + const names = selection.tools.map(t => t.name); + assert.ok(names.includes('core_tool_A')); + assert.ok(names.includes('mcp.search')); + assert.ok(names.includes('mcp.invoke')); + // Should NOT include raw MCP tool(s) in meta mode + assert.isFalse(names.includes('mcp:default:delta')); + }); +}); diff --git a/front_end/panels/ai_chat/core/ToolSurfaceProvider.ts b/front_end/panels/ai_chat/core/ToolSurfaceProvider.ts new file mode 100644 index 0000000000..f16b6903ff --- /dev/null +++ b/front_end/panels/ai_chat/core/ToolSurfaceProvider.ts @@ -0,0 +1,216 @@ +// Copyright 2025 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import type { AgentState } from './State.js'; +import { createLogger } from './Logger.js'; +import type { Tool } from '../tools/Tools.js'; +import { ToolRegistry } from '../agent_framework/ConfigurableAgentTool.js'; +import { MCPRegistry } from '../mcp/MCPRegistry.js'; +import { getMCPConfig } from '../mcp/MCPConfig.js'; +import { MCPToolAdapter } from '../mcp/MCPToolAdapter.js'; + +const logger = createLogger('ToolSurfaceProvider'); + +export interface ToolSelectionOptions { + maxToolsPerTurn?: number; + maxMcpPerTurn?: number; +} + +function uniqByName(tools: Tool[]): Tool[] { + const seen = new Set(); + const out: Tool[] = []; + for (const t of tools) { + if (!seen.has(t.name)) { + seen.add(t.name); + out.push(t); + } + } + return out; +} + +function getAllMcpTools(): Tool[] { + try { + const status = MCPRegistry.getStatus(); + console.log('[TOOL_SELECTION_DEBUG] MCPRegistry status:', { + enabled: status.enabled, + serverCount: status.servers.length, + servers: status.servers, + registeredToolNames: status.registeredToolNames, + lastError: status.lastError, + lastErrorType: status.lastErrorType + }); + + const tools: Tool[] = []; + for (const name of status.registeredToolNames) { + const tool = ToolRegistry.getRegisteredTool(name); + if (tool) { + tools.push(tool); + } else { + console.log('[TOOL_SELECTION_DEBUG] Tool registered but not found:', name); + } + } + console.log('[TOOL_SELECTION_DEBUG] getAllMcpTools result:', { + availableToolsCount: tools.length, + availableToolNames: tools.map(t => t.name) + }); + return tools; + } catch (error) { + console.error('[TOOL_SELECTION_DEBUG] Error in getAllMcpTools:', error); + return []; + } +} + +function scoreTool(query: string, agentType: string | null | undefined, tool: Tool): number { + const q = (query || '').toLowerCase(); + const a = (agentType || '').toLowerCase(); + const name = (tool.name || '').toLowerCase(); + const desc = (tool.description || '').toLowerCase(); + let score = 0; + if (q && name.includes(q)) score += 10; + if (q && desc.includes(q)) score += 3; + if (a && name.includes(a)) score += 2; + if (a && desc.includes(a)) score += 1; + // Prefer MCP tools only slightly lower than strong name matches + if (tool instanceof MCPToolAdapter) score += 0.5; + return score; +} + +// DEBUG: Add a utility function to test MCP modes from console +(globalThis as any).debugToolSelection = { + getCurrentMCPConfig: () => { + const cfg = getMCPConfig(); + console.log('Current MCP Config:', cfg); + return cfg; + }, + testMode: async (mode: 'all' | 'router' | 'meta') => { + const originalConfig = getMCPConfig(); + console.log(`Testing mode: ${mode}`); + // Temporarily set the mode + localStorage.setItem('ai_chat_mcp_tool_mode', mode); + // Test with mock state + const mockState = { + selectedAgentType: 'deep-research', + messages: [{ entity: 'user' as const, text: 'test query' }] + } as any; + const mockBaseTools: any[] = []; + const result = await ToolSurfaceProvider.select(mockState, mockBaseTools); + // Restore original mode + if (originalConfig.toolMode) { + localStorage.setItem('ai_chat_mcp_tool_mode', originalConfig.toolMode); + } + console.log(`Mode ${mode} result:`, result); + return result; + }, + getMCPRegistryStatus: () => { + const status = MCPRegistry.getStatus(); + console.log('MCP Registry Status:', status); + return status; + } +}; + +export const ToolSurfaceProvider = { + async select(state: AgentState, baseTools: Tool[], opts?: ToolSelectionOptions): Promise<{ tools: Tool[]; selectedNames: string[] }> { + const { maxToolsPerTurn = 20, maxMcpPerTurn = 8 } = opts || {}; + const cfg = getMCPConfig(); + const mode = cfg.toolMode || 'router'; + + // DEBUG: Log current MCP configuration and tool selection parameters + console.log('[TOOL_SELECTION_DEBUG] ToolSurfaceProvider.select called with:', { + maxToolsPerTurn, + maxMcpPerTurn, + mcpConfig: cfg, + toolMode: mode, + baseToolsCount: baseTools.length, + baseToolNames: baseTools.map(t => t.name), + selectedAgentType: state.selectedAgentType + }); + + // Start from provided baseTools (curated per-agent), not global registry + let resultTools: Tool[] = uniqByName([...baseTools]); + const selectedNames: string[] = []; + + console.log('[TOOL_SELECTION_DEBUG] Base tools provided:', { + agentType: state.selectedAgentType, + baseToolsCount: baseTools.length, + baseToolNames: baseTools.map(t => t.name) + }); + + if (!cfg.enabled) { + console.log('[TOOL_SELECTION_DEBUG] MCP disabled, returning core tools only'); + const uniq = uniqByName(resultTools).slice(0, maxToolsPerTurn); + console.log('[TOOL_SELECTION_DEBUG] Final result (MCP disabled):', { + toolCount: uniq.length, + toolNames: uniq.map(t => t.name) + }); + return { tools: uniq, selectedNames: uniq.map(t => t.name) }; + } + + if (mode === 'all') { + console.log('[TOOL_SELECTION_DEBUG] Using ALL mode'); + const mcpTools = getAllMcpTools(); + console.log('[TOOL_SELECTION_DEBUG] MCP tools found:', { + mcpToolsCount: mcpTools.length, + mcpToolNames: mcpTools.map(t => t.name) + }); + resultTools = uniqByName([...resultTools, ...mcpTools]).slice(0, maxToolsPerTurn); + console.log('[TOOL_SELECTION_DEBUG] Final result (ALL mode):', { + toolCount: resultTools.length, + toolNames: resultTools.map(t => t.name) + }); + return { tools: resultTools, selectedNames: resultTools.map(t => t.name) }; + } + + if (mode === 'meta') { + console.log('[TOOL_SELECTION_DEBUG] Using META mode'); + // Include only meta-tools for MCP alongside core tools + const search = ToolRegistry.getRegisteredTool('mcp.search'); + const invoke = ToolRegistry.getRegisteredTool('mcp.invoke'); + const metaTools = [search, invoke].filter(Boolean) as Tool[]; + console.log('[TOOL_SELECTION_DEBUG] Meta tools found:', { + metaToolsCount: metaTools.length, + metaToolNames: metaTools.map(t => t.name), + searchTool: !!search, + invokeTool: !!invoke + }); + resultTools = uniqByName([...resultTools, ...metaTools]).slice(0, maxToolsPerTurn); + console.log('[TOOL_SELECTION_DEBUG] Final result (META mode):', { + toolCount: resultTools.length, + toolNames: resultTools.map(t => t.name) + }); + return { tools: resultTools, selectedNames: resultTools.map(t => t.name) }; + } + + // Router mode (heuristic pre-call selection) + console.log('[TOOL_SELECTION_DEBUG] Using ROUTER mode'); + const mcpTools = getAllMcpTools(); + console.log('[TOOL_SELECTION_DEBUG] MCP tools available for scoring:', { + mcpToolsCount: mcpTools.length, + mcpToolNames: mcpTools.map(t => t.name) + }); + + const lastUserMsg = [...state.messages].reverse().find(m => m.entity === 'user' || (m as any).entity === 0) as any; + const queryText = lastUserMsg?.text || ''; + console.log('[TOOL_SELECTION_DEBUG] Query text for scoring:', queryText); + + const scored = mcpTools + .map(t => ({ t, s: scoreTool(queryText, state.selectedAgentType, t) })) + .sort((a, b) => b.s - a.s) + .slice(0, maxMcpPerTurn) + .map(({ t }) => t); + + console.log('[TOOL_SELECTION_DEBUG] Top scored MCP tools:', { + scoredToolsCount: scored.length, + scoredToolNames: scored.map(t => t.name), + maxMcpPerTurn + }); + + resultTools = uniqByName([...resultTools, ...scored]).slice(0, maxToolsPerTurn); + console.log('[TOOL_SELECTION_DEBUG] Final result (ROUTER mode):', { + toolCount: resultTools.length, + toolNames: resultTools.map(t => t.name), + maxToolsPerTurn + }); + return { tools: resultTools, selectedNames: resultTools.map(t => t.name) }; + } +}; diff --git a/front_end/panels/ai_chat/mcp/MCPClientSDK.test.ts b/front_end/panels/ai_chat/mcp/MCPClientSDK.test.ts new file mode 100644 index 0000000000..7298942d78 --- /dev/null +++ b/front_end/panels/ai_chat/mcp/MCPClientSDK.test.ts @@ -0,0 +1,136 @@ +// Copyright 2025 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import { MCPClientSDK } from '../../../third_party/mcp-sdk/mcp-sdk.js'; +import type { MCPServer } from '../../../third_party/mcp-sdk/mcp-sdk.js'; + +describe('MCPClientSDK', () => { + let client: MCPClientSDK; + + beforeEach(() => { + client = new MCPClientSDK(); + }); + + afterEach(() => { + // Clean up any connections + try { + client.disconnect('test-server'); + } catch { + // Ignore cleanup errors + } + }); + + it('can be instantiated', () => { + assert.ok(client instanceof MCPClientSDK); + }); + + it('reports not connected initially', () => { + assert.strictEqual(client.isConnected('non-existent-server'), false); + }); + + // Skip connection tests in unit tests as they require a running server + // Integration tests with real servers should be in live test files + + it('throws error for missing server when listing tools', async () => { + try { + await client.listTools('non-existent-server'); + throw new Error('Should have thrown error'); + } catch (error) { + assert.ok(error.message.includes('No connection for server')); + } + }); + + it('throws error for missing server when calling tools', async () => { + try { + await client.callTool('non-existent-server', 'test-tool', {}); + throw new Error('Should have thrown error'); + } catch (error) { + assert.ok(error.message.includes('No connection for server')); + } + }); + + describe('connects to local Hacker News MCP server via SDK', function() { + this.timeout(30000); // Longer timeout for integration test + + const HACKER_NEWS_SERVER: MCPServer = { + id: 'local-hn-sdk', + endpoint: 'http://localhost:5001/sse', + }; + + it('connects and lists tools', async function() { + console.log('=== Testing Local Hacker News MCP Server with SDK ==='); + + try { + // Step 1: Connect + console.log('Step 1: Connecting to MCP server via SDK...'); + await client.connect(HACKER_NEWS_SERVER); + assert.strictEqual(client.isConnected(HACKER_NEWS_SERVER.id), true, 'Should be connected'); + console.log('✓ Connection established via SDK'); + + // Step 2: List tools + console.log('Step 2: Listing available tools via SDK...'); + const tools = await client.listTools(HACKER_NEWS_SERVER.id); + console.log(`✓ Retrieved ${tools.length} tools via SDK`); + + // Verify tools structure + assert.ok(Array.isArray(tools), 'Tools should be an array'); + if (tools.length > 0) { + const tool = tools[0]; + assert.ok(tool.hasOwnProperty('name'), 'Tool should have name'); + assert.ok(tool.hasOwnProperty('description'), 'Tool should have description'); + assert.ok(tool.hasOwnProperty('inputSchema'), 'Tool should have inputSchema'); + console.log(`✓ Tool structure valid: ${tool.name}`); + } + + // Step 3: Call a tool (if available) + if (tools.length > 0) { + const firstTool = tools[0]; + console.log(`Step 3: Testing tool call: ${firstTool.name}`); + + try { + // Create minimal args for the tool + const args: Record = {}; + + // Add required parameters if the tool has them + if (firstTool.inputSchema && typeof firstTool.inputSchema === 'object') { + const schema = firstTool.inputSchema as any; + if (schema.required && Array.isArray(schema.required)) { + for (const reqParam of schema.required) { + if (reqParam === 'count' || reqParam.includes('count')) { + args[reqParam] = 3; // Use small count for testing + } else if (reqParam === 'item_id') { + args[reqParam] = 8863; // Classic HN item + } else if (reqParam === 'username') { + args[reqParam] = 'pg'; // Paul Graham + } + } + } + } + + console.log(`Calling ${firstTool.name} with args:`, args); + const result = await client.callTool(HACKER_NEWS_SERVER.id, firstTool.name, args); + + console.log('Tool call result via SDK:', typeof result); + assert.ok(result !== undefined, 'Tool call should return a result'); + console.log('✓ Tool call successful via SDK'); + + } catch (err) { + console.error(`Tool call failed for ${firstTool.name}:`, err); + // Don't fail the test if tool call fails - might be expected with test data + console.log('Tool call failed, but connection and tools/list worked'); + } + } + + console.log('✓ All SDK tests passed!'); + + } catch (error) { + console.error('SDK test failed:', error); + throw error; + } finally { + // Cleanup + client.disconnect(HACKER_NEWS_SERVER.id); + } + }); + }); +}); \ No newline at end of file diff --git a/front_end/panels/ai_chat/mcp/MCPConfig.ts b/front_end/panels/ai_chat/mcp/MCPConfig.ts new file mode 100644 index 0000000000..06f6735c97 --- /dev/null +++ b/front_end/panels/ai_chat/mcp/MCPConfig.ts @@ -0,0 +1,95 @@ +import { createLogger } from '../core/Logger.js'; + +const logger = createLogger('MCPConfig'); + +export interface MCPConfigData { + enabled: boolean; + endpoint?: string; // MVP: single endpoint; Phase 2 can support multiple + token?: string; + toolAllowlist?: string[]; + autostart?: boolean; + toolMode?: 'all' | 'router' | 'meta'; + maxToolsPerTurn?: number; + maxMcpPerTurn?: number; +} + +const KEYS = { + enabled: 'ai_chat_mcp_enabled', + endpoint: 'ai_chat_mcp_endpoint', + token: 'ai_chat_mcp_token', + allowlist: 'ai_chat_mcp_tool_allowlist', + autostart: 'ai_chat_mcp_autostart', + toolMode: 'ai_chat_mcp_tool_mode', + maxToolsPerTurn: 'ai_chat_mcp_max_tools_per_turn', + maxMcpPerTurn: 'ai_chat_mcp_max_mcp_per_turn', +} as const; + +export function getMCPConfig(): MCPConfigData { + try { + const enabled = localStorage.getItem(KEYS.enabled) === 'true'; + const endpoint = localStorage.getItem(KEYS.endpoint) || undefined; + const token = localStorage.getItem(KEYS.token) || undefined; + let toolAllowlist: string[] | undefined; + const raw = localStorage.getItem(KEYS.allowlist); + if (raw) { + try { toolAllowlist = JSON.parse(raw); } catch { toolAllowlist = undefined; } + } + const autostart = localStorage.getItem(KEYS.autostart) === 'true'; + const toolMode = (localStorage.getItem(KEYS.toolMode) as MCPConfigData['toolMode']) || 'router'; + const maxToolsPerTurn = parseInt(localStorage.getItem(KEYS.maxToolsPerTurn) || '20', 10); + const maxMcpPerTurn = parseInt(localStorage.getItem(KEYS.maxMcpPerTurn) || '8', 10); + return { enabled, endpoint, token, toolAllowlist, autostart, toolMode, maxToolsPerTurn, maxMcpPerTurn }; + } catch (err) { + logger.error('Failed to load MCP config', err); + return { enabled: false }; + } +} + +export function setMCPConfig(config: MCPConfigData): void { + try { + localStorage.setItem(KEYS.enabled, String(!!config.enabled)); + if (config.endpoint !== undefined) { + localStorage.setItem(KEYS.endpoint, config.endpoint); + } + if (config.token !== undefined) { + localStorage.setItem(KEYS.token, config.token); + } + if (config.toolAllowlist) { + localStorage.setItem(KEYS.allowlist, JSON.stringify(config.toolAllowlist)); + } + if (config.autostart !== undefined) { + localStorage.setItem(KEYS.autostart, String(!!config.autostart)); + } + if (config.toolMode !== undefined) { + localStorage.setItem(KEYS.toolMode, config.toolMode); + } + if (config.maxToolsPerTurn !== undefined) { + localStorage.setItem(KEYS.maxToolsPerTurn, String(config.maxToolsPerTurn)); + } + if (config.maxMcpPerTurn !== undefined) { + localStorage.setItem(KEYS.maxMcpPerTurn, String(config.maxMcpPerTurn)); + } + } catch (err) { + logger.error('Failed to save MCP config', err); + } finally { + dispatchMCPConfigChanged(); + } +} + +export function isMCPEnabled(): boolean { + return getMCPConfig().enabled; +} + +export function onMCPConfigChange(handler: () => void): () => void { + const cb = () => handler(); + window.addEventListener('ai_chat_mcp_config_changed', cb); + return () => window.removeEventListener('ai_chat_mcp_config_changed', cb); +} + +function dispatchMCPConfigChanged(): void { + try { + window.dispatchEvent(new CustomEvent('ai_chat_mcp_config_changed')); + } catch (err) { + logger.warn('Failed to dispatch MCP config change event', err); + } +} diff --git a/front_end/panels/ai_chat/mcp/MCPMetaTools.ts b/front_end/panels/ai_chat/mcp/MCPMetaTools.ts new file mode 100644 index 0000000000..74bf8852df --- /dev/null +++ b/front_end/panels/ai_chat/mcp/MCPMetaTools.ts @@ -0,0 +1,204 @@ +// Copyright 2025 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import type { Tool } from '../tools/Tools.js'; +import { createLogger } from '../core/Logger.js'; +import { MCPRegistry } from './MCPRegistry.js'; +import { MCPToolAdapter } from './MCPToolAdapter.js'; +import { LLMClient } from '../LLM/LLMClient.js'; +import { AIChatPanel } from '../ui/AIChatPanel.js'; + +const logger = createLogger('MCPMetaTools'); + +export class MCPMetaSearchTool implements Tool<{ query: string; k?: number; strategy?: 'heuristic' | 'llm' | 'hybrid'; serverId?: string | string[]; tags?: string[] }, { tools: Array<{ key: string; name: string; description: string; serverId: string }> }> { + name = 'mcp.search'; + description = 'Search discovered MCP tools by relevance to a query and return top candidates.'; + schema = { + type: 'object', + properties: { + query: { type: 'string', description: 'User intent or query describing desired capability' }, + k: { type: 'number', description: 'Max results to return (default 8)' }, + strategy: { type: 'string', description: 'heuristic | llm | hybrid (heuristic default)' }, + serverId: { type: 'string', description: 'Filter by serverId (or array of ids)' }, + tags: { type: 'array', items: { type: 'string' }, description: 'Optional tags for filtering (unused in MVP)' }, + }, + required: ['query'], + }; + + private async rankWithLLM(candidates: Array<{ key: string; name: string; description: string; serverId: string }>, query: string, k: number): Promise> { + try { + const { model, provider } = AIChatPanel.getNanoModelWithProvider(); + const llm = LLMClient.getInstance(); + + const systemPrompt = `You are ranking MCP tools for a separate assistant. Given a user query and candidate tools, return the most relevant tool keys (max ${k}). Prefer exact/near-match names and descriptions; penalize off-domain tools.`; + + const candidateList = candidates.map(c => ({ + key: c.key, + name: c.name, + description: c.description + })); + + const userMessage = JSON.stringify({ + query, + k, + candidates: candidateList + }); + + const response = await llm.call({ + provider, + model, + messages: [ + { role: 'system', content: systemPrompt }, + { role: 'user', content: userMessage } + ], + systemPrompt: systemPrompt, + // Use standard function-calling tool shape expected by providers + tools: [{ + type: 'function', + function: { + name: 'select_tools', + description: 'Select the most relevant tools', + parameters: { + type: 'object', + properties: { + selected: { + type: 'array', + items: { type: 'string' }, + description: 'Array of selected tool keys', + maxItems: k + }, + rationale: { + type: 'string', + description: 'Brief explanation for selections' + } + }, + required: ['selected'] + } + } + }] + }); + + if (!response.functionCall) { + throw new Error('No function call in LLM response'); + } + + const functionCall = response.functionCall; + const selectedKeys = (functionCall.arguments as any)?.selected || []; + + // Return candidates in the order selected by LLM, filtering to only selected keys + const selectedSet = new Set(selectedKeys); + return candidates.filter(c => selectedSet.has(c.key)); + + } catch (err) { + logger.warn('LLM ranking failed, falling back to heuristic', err); + // Fallback to heuristic ranking + return this.rankHeuristic(candidates, query, k); + } + } + + private rankHeuristic(candidates: Array<{ key: string; name: string; description: string; serverId: string }>, query: string, k: number): Array<{ key: string; name: string; description: string; serverId: string }> { + const q = query.toLowerCase(); + return candidates + .map(c => { + const n = c.name.toLowerCase(); + const d = (c.description || '').toLowerCase(); + let s = 0; + if (q && n.includes(q)) s += 10; + if (q && d.includes(q)) s += 3; + return { c, s }; + }) + .sort((a, b) => b.s - a.s) + .slice(0, k) + .map(({ c }) => c); + } + + async execute(args: { query: string; k?: number; strategy?: 'heuristic' | 'llm' | 'hybrid'; serverId?: string | string[]; tags?: string[] }): Promise<{ tools: Array<{ key: string; name: string; description: string; serverId: string }> }> { + const status = MCPRegistry.getStatus(); + const allow = new Set(status.registeredToolNames || []); + const k = Math.max(1, Math.min(64, Math.floor(args.k ?? 8))); + const serverFilter = Array.isArray(args.serverId) ? new Set(args.serverId) : args.serverId ? new Set([args.serverId]) : null; + const q = (args.query || '').toLowerCase(); + + // Build candidates from registered MCP tools + const candidates: Array<{ key: string; name: string; description: string; serverId: string }> = []; + const { ToolRegistry } = await import('../agent_framework/ConfigurableAgentTool.js'); + for (const key of allow) { + if (!key.startsWith('mcp:')) continue; + if (serverFilter) { + const serverId = key.split(':')[1] || ''; + if (!serverFilter.has(serverId)) continue; + } + const tool = ToolRegistry.getRegisteredTool(key); + if (!tool) continue; + if (tool instanceof MCPToolAdapter) { + const serverId = tool.getServerId(); + const name = tool.getOriginalToolName(); + const description = tool.description || ''; + candidates.push({ key, name, description, serverId }); + } + } + + // Choose ranking strategy + const strategy = args.strategy || 'heuristic'; + let rankedTools: Array<{ key: string; name: string; description: string; serverId: string }>; + + switch (strategy) { + case 'llm': + rankedTools = await this.rankWithLLM(candidates, args.query, k); + break; + case 'hybrid': + // For hybrid: use heuristic pre-filtering then LLM ranking on top candidates + const prefilterLimit = Math.min(candidates.length, k * 5); // 5x expansion for LLM to choose from + const prefiltered = this.rankHeuristic(candidates, args.query, prefilterLimit); + rankedTools = prefiltered.length <= k ? prefiltered : await this.rankWithLLM(prefiltered, args.query, k); + break; + default: // 'heuristic' + rankedTools = this.rankHeuristic(candidates, args.query, k); + break; + } + + return { tools: rankedTools }; + } +} + +export class MCPMetaInvokeTool implements Tool<{ serverId: string; toolName: string; args?: Record }, unknown> { + name = 'mcp.invoke'; + description = 'Invoke a specific MCP tool by serverId and toolName with provided arguments.'; + schema = { + type: 'object', + properties: { + serverId: { type: 'string', description: 'Server identifier (namespace)' }, + toolName: { type: 'string', description: 'Original MCP tool name (not namespaced)' }, + args: { type: 'object', description: 'Arguments for the tool', additionalProperties: true }, + }, + required: ['serverId', 'toolName'], + }; + + async execute(args: { serverId: string; toolName: string; args?: Record }): Promise { + const key = `mcp:${args.serverId}:${args.toolName}`; + const status = MCPRegistry.getStatus(); + if (!status.registeredToolNames.includes(key)) { + throw new Error(`MCP tool not available or not allowlisted: ${key}`); + } + const { ToolRegistry } = await import('../agent_framework/ConfigurableAgentTool.js'); + const tool = ToolRegistry.getRegisteredTool(key); + if (!tool) { + throw new Error(`MCP tool not registered: ${key}`); + } + return tool.execute(args.args || {}); + } +} + +export function registerMCPMetaTools(): void { + // Defer import of ToolRegistry to avoid circular init during module load + (async () => { + try { + const { ToolRegistry } = await import('../agent_framework/ConfigurableAgentTool.js'); + ToolRegistry.registerToolFactory('mcp.search', () => new MCPMetaSearchTool()); + ToolRegistry.registerToolFactory('mcp.invoke', () => new MCPMetaInvokeTool()); + } catch (e) { + logger.warn('Failed to register MCP meta-tools', e); + } + })(); +} diff --git a/front_end/panels/ai_chat/mcp/MCPRegistry.ts b/front_end/panels/ai_chat/mcp/MCPRegistry.ts new file mode 100644 index 0000000000..9fbeeb0c75 --- /dev/null +++ b/front_end/panels/ai_chat/mcp/MCPRegistry.ts @@ -0,0 +1,153 @@ +import { createLogger } from '../core/Logger.js'; +import { ToolRegistry } from '../agent_framework/ConfigurableAgentTool.js'; +import type { MCPToolDef, MCPServer } from '../../../third_party/mcp-sdk/mcp-sdk.js'; +import { MCPClient } from '../../../third_party/mcp-sdk/mcp-sdk.js'; +import { getMCPConfig } from './MCPConfig.js'; +import { MCPToolAdapter } from './MCPToolAdapter.js'; + +const logger = createLogger('MCPRegistry'); + +export interface MCPRegistryStatus { + enabled: boolean; + servers: Array<{ id: string; endpoint: string; connected: boolean; toolCount: number }>; + registeredToolNames: string[]; + lastError?: string; + lastErrorType?: 'connection' | 'authentication' | 'configuration' | 'network' | 'server_error' | 'unknown'; + lastConnected?: Date; + lastDisconnected?: Date; +} + +class RegistryImpl { + private client = new MCPClient(); + private servers: MCPServer[] = []; + private registeredTools: string[] = []; + private lastError?: string; + private lastErrorType?: 'connection' | 'authentication' | 'configuration' | 'network' | 'server_error' | 'unknown'; + private lastConnected?: Date; + private lastDisconnected?: Date; + + private categorizeError(error: unknown): 'connection' | 'authentication' | 'configuration' | 'network' | 'server_error' | 'unknown' { + const message = error instanceof Error ? error.message.toLowerCase() : String(error).toLowerCase(); + + if (message.includes('unauthorized') || message.includes('authentication') || message.includes('auth') || message.includes('token')) { + return 'authentication'; + } + if (message.includes('network') || message.includes('timeout') || message.includes('connection reset') || message.includes('econnreset')) { + return 'network'; + } + if (message.includes('connection') || message.includes('connect') || message.includes('econnrefused') || message.includes('websocket')) { + return 'connection'; + } + if (message.includes('invalid') || message.includes('malformed') || message.includes('endpoint') || message.includes('url')) { + return 'configuration'; + } + if (message.includes('server error') || message.includes('internal error') || message.includes('500') || message.includes('503')) { + return 'server_error'; + } + return 'unknown'; + } + + private setError(error: unknown): void { + this.lastError = error instanceof Error ? error.message : String(error); + this.lastErrorType = this.categorizeError(error); + } + + async init(): Promise { + const cfg = getMCPConfig(); + this.registeredTools = []; + this.lastError = undefined; + this.lastErrorType = undefined; + + if (!cfg.enabled) { + logger.info('MCP disabled'); + return; + } + if (!cfg.endpoint) { + logger.warn('MCP endpoint not configured'); + return; + } + + const server: MCPServer = { + id: 'default', + endpoint: cfg.endpoint, + token: cfg.token, + }; + this.servers = [server]; + + try { + await this.client.connect(server); + this.lastConnected = new Date(); + logger.info('MCP connected', { endpoint: server.endpoint }); + } catch (err) { + this.setError(err); + logger.error('MCP connect failed', err); + } + } + + async refresh(): Promise { + const cfg = getMCPConfig(); + if (!cfg.enabled || this.servers.length === 0) { + return; + } + + // Clear previously registered tools (ToolRegistry will overwrite on re-registration) + this.registeredTools = []; + + const allow = new Set(cfg.toolAllowlist || []); + + for (const srv of this.servers) { + if (!this.client.isConnected(srv.id)) { + continue; + } + let tools: MCPToolDef[] = []; + try { + tools = await this.client.listTools(srv.id); + } catch (err) { + this.setError(err); + logger.error('listTools failed', err); + continue; + } + + for (const def of tools) { + const namespaced = `mcp:${srv.id}:${def.name}`; + if (allow.size > 0 && !allow.has(namespaced) && !allow.has(def.name)) { + continue; + } + try { + const factoryName = namespaced; + ToolRegistry.registerToolFactory(factoryName, () => new MCPToolAdapter(srv.id, this.client, def, namespaced)); + this.registeredTools.push(factoryName); + } catch (err) { + logger.error('Failed to register MCP tool', { tool: def.name, err }); + } + } + } + } + + dispose(): void { + for (const srv of this.servers) { + try { this.client.disconnect(srv.id); } catch {} + } + this.lastDisconnected = new Date(); + this.servers = []; + } + + getStatus(): MCPRegistryStatus { + return { + enabled: getMCPConfig().enabled, + servers: this.servers.map(s => ({ + id: s.id, + endpoint: s.endpoint, + connected: this.client.isConnected(s.id), + toolCount: 0, + })), + registeredToolNames: [...this.registeredTools], + lastError: this.lastError, + lastErrorType: this.lastErrorType, + lastConnected: this.lastConnected, + lastDisconnected: this.lastDisconnected, + }; + } +} + +export const MCPRegistry = new RegistryImpl(); diff --git a/front_end/panels/ai_chat/mcp/MCPToolAdapter.ts b/front_end/panels/ai_chat/mcp/MCPToolAdapter.ts new file mode 100644 index 0000000000..bad2b54d5f --- /dev/null +++ b/front_end/panels/ai_chat/mcp/MCPToolAdapter.ts @@ -0,0 +1,54 @@ +import type { Tool } from '../tools/Tools.js'; +import { createLogger } from '../core/Logger.js'; +import type { MCPClient, MCPToolDef } from '../../../third_party/mcp-sdk/mcp-sdk.js'; + +const logger = createLogger('MCPToolAdapter'); + +export class MCPToolAdapter implements Tool, unknown> { + name: string; + description: string; + schema: any; + + constructor( + private serverId: string, + private client: MCPClient, + private def: MCPToolDef, + private displayName?: string, + ) { + this.name = this.displayName || def.name; + this.description = def.description; + // Pass through the MCP tool's input schema as-is. MCP servers provide a valid JSON Schema + // for the tool arguments (type: 'object', properties: { ... }, required: [...] ). + // The LLM providers expect a proper JSON Schema at the `parameters` field, not nested under `properties`. + // If the schema is missing or malformed, fall back to a minimal object schema. + const schema = def.inputSchema as any; + if (schema && typeof schema === 'object') { + this.schema = schema; + } else { + this.schema = { type: 'object', properties: {} }; + } + } + + async execute(args: Record): Promise { + const sanitized = this.sanitize(args); + logger.info('Executing MCP tool', { name: this.name, serverId: this.serverId }); + return this.client.callTool(this.serverId, this.def.name, sanitized, { timeoutMs: 30000 }); + } + + // Expose metadata for discovery/search + getServerId(): string { return this.serverId; } + getOriginalToolName(): string { return this.def.name; } + + private sanitize(input: Record): Record { + const sensitive = ['token', 'api_key', 'password', 'secret', 'authorization']; + const out: Record = {}; + for (const [k, v] of Object.entries(input || {})) { + if (typeof v === 'string' && sensitive.some(s => k.toLowerCase().includes(s))) { + out[k] = '[redacted]'; + } else { + out[k] = v; + } + } + return out; + } +} diff --git a/front_end/panels/ai_chat/ui/AIChatPanel.ts b/front_end/panels/ai_chat/ui/AIChatPanel.ts index 18a999ede3..c8b3f15359 100644 --- a/front_end/panels/ai_chat/ui/AIChatPanel.ts +++ b/front_end/panels/ai_chat/ui/AIChatPanel.ts @@ -88,6 +88,10 @@ import { HelpDialog } from './HelpDialog.js'; import { SettingsDialog, isVectorDBEnabled } from './SettingsDialog.js'; import { EvaluationDialog } from './EvaluationDialog.js'; import * as Snackbars from '../../../ui/components/snackbars/snackbars.js'; +// MCP integration +import { MCPRegistry } from '../mcp/MCPRegistry.js'; +import { getMCPConfig } from '../mcp/MCPConfig.js'; +import { onMCPConfigChange } from '../mcp/MCPConfig.js'; const {html} = Lit; @@ -718,6 +722,7 @@ export class AIChatPanel extends UI.Panel.Panel { #liteLLMEndpoint: string | null = null; // LiteLLM endpoint #apiKey: string | null = null; // Regular API key #evaluationAgent: EvaluationAgent | null = null; // Evaluation agent for this tab + #mcpUnsubscribe: (() => void) | null = null; constructor() { super(AIChatPanel.panelName); @@ -732,6 +737,8 @@ export class AIChatPanel extends UI.Panel.Panel { this.#createEvaluationAgentIfNeeded(); this.performUpdate(); this.#fetchLiteLLMModelsOnLoad(); + // Initialize MCP integration (connect + discover tools if enabled) + this.#setupMCPIntegration(); } /** @@ -766,6 +773,31 @@ export class AIChatPanel extends UI.Panel.Panel { this.#chatView.addEventListener('manual-setup-requested', this.#handleManualSetupRequest.bind(this)); } + /** + * Initialize MCP integration: connect and discover tools if enabled, + * and react to MCP config changes from Settings. + */ + #setupMCPIntegration(): void { + const initAndRefresh = async () => { + try { + const mcpConfig = getMCPConfig(); + // Only auto-connect if both enabled and autostart are true + if (mcpConfig.enabled && mcpConfig.autostart) { + await MCPRegistry.init(); + await MCPRegistry.refresh(); + const status = MCPRegistry.getStatus(); + logger.info('MCP autostart completed', status); + } + } catch (err) { + logger.error('Failed to initialize MCP', err); + } + }; + + void initAndRefresh(); + // Subscribe to config changes + this.#mcpUnsubscribe = onMCPConfigChange(() => { void initAndRefresh(); }); + } + /** * Sets up the initial state from localStorage */ @@ -2113,6 +2145,13 @@ export class AIChatPanel extends UI.Panel.Panel { this.#validateAndFixModelSelections(); this.#initializeAgentService(); + // Re-initialize MCP based on latest settings + try { + await MCPRegistry.init(); + await MCPRegistry.refresh(); + } catch (err) { + logger.error('Failed to reinitialize MCP after settings change', err); + } // Update toolbar to reflect vector DB enabled state this.#updateToolbar(); } @@ -2203,4 +2242,4 @@ export class ActionDelegate implements UI.ActionRegistration.ActionDelegate { } return false; } -} \ No newline at end of file +} diff --git a/front_end/panels/ai_chat/ui/ChatView.ts b/front_end/panels/ai_chat/ui/ChatView.ts index ecdf34aa95..2628cb58c2 100644 --- a/front_end/panels/ai_chat/ui/ChatView.ts +++ b/front_end/panels/ai_chat/ui/ChatView.ts @@ -1784,7 +1784,7 @@ export class ChatView extends HTMLElement { class="view-document-btn" @click=${() => this.#openInAIAssistantViewer(structuredResponse.markdownReport)} title="Open full report in document viewer"> - 📄 View Full Report + 📄 View Full Screen ` : html` @@ -1802,7 +1802,7 @@ export class ChatView extends HTMLElement { class="view-document-btn" @click=${() => this.#openInAIAssistantViewer(structuredResponse.markdownReport)} title="Open full report in document viewer"> - 📄 ${isLastMessage ? '' : 'View Full Report'} + 📄 ${isLastMessage ? '' : 'View Full Screen'} `} diff --git a/front_end/panels/ai_chat/ui/SettingsDialog.ts b/front_end/panels/ai_chat/ui/SettingsDialog.ts index 91f7739c2c..97685dd292 100644 --- a/front_end/panels/ai_chat/ui/SettingsDialog.ts +++ b/front_end/panels/ai_chat/ui/SettingsDialog.ts @@ -8,6 +8,8 @@ import { getEvaluationConfig, setEvaluationConfig, isEvaluationEnabled, connectT import { createLogger } from '../core/Logger.js'; import { LLMClient } from '../LLM/LLMClient.js'; import { getTracingConfig, setTracingConfig, isTracingEnabled } from '../tracing/TracingConfig.js'; +import { getMCPConfig, setMCPConfig, isMCPEnabled } from '../mcp/MCPConfig.js'; +import { MCPRegistry } from '../mcp/MCPRegistry.js'; import { DEFAULT_PROVIDER_MODELS } from './AIChatPanel.js'; @@ -346,6 +348,94 @@ const UIStrings = { *@description Evaluation connection status */ evaluationConnectionStatus: 'Connection Status', + /** + *@description MCP section title + */ + mcpSection: 'MCP Integration', + /** + *@description MCP enabled label + */ + mcpEnabled: 'Enable MCP Integration', + /** + *@description MCP enabled hint + */ + mcpEnabledHint: 'Enable MCP client to discover and call tools via Model Context Protocol', + /** + *@description MCP endpoint label + */ + mcpEndpoint: 'MCP Server Endpoint', + /** + *@description MCP endpoint hint + */ + mcpEndpointHint: 'HTTPS SSE or WebSocket endpoint (e.g., https://host/mcp or ws://localhost:9000)', + /** + *@description MCP token label + */ + mcpToken: 'Auth Token (optional)', + /** + *@description MCP token hint + */ + mcpTokenHint: 'If your MCP server requires authentication, provide a token here', + /** + *@description MCP connect button + */ + mcpConnectRefresh: 'Connect / Refresh Tools', + /** + *@description MCP discovered tools label + */ + mcpDiscoveredTools: 'Discovered Tools', + /** + *@description MCP discovered tools hint + */ + mcpDiscoveredToolsHint: 'Select which MCP tools to make available to agents', + /** + *@description MCP no tools message + */ + mcpNoTools: 'No tools discovered. Connect to an MCP server first.', + /** + *@description MCP autostart label + */ + mcpAutostart: 'Auto-connect on startup', + /** + *@description MCP autostart hint + */ + mcpAutostartHint: 'Automatically connect to MCP server when DevTools opens', + /** + *@description MCP tool mode label + */ + mcpToolMode: 'Tool Selection Mode', + /** + *@description MCP tool mode hint + */ + mcpToolModeHint: 'Choose how MCP tools are selected and surfaced to agents', + /** + *@description MCP tool mode all option + */ + mcpToolModeAll: 'All Tools - Surface all available MCP tools (may impact performance)', + /** + *@description MCP tool mode router option + */ + mcpToolModeRouter: 'Smart Router - Use LLM to select most relevant tools each turn (recommended)', + /** + *@description MCP tool mode meta option + */ + mcpToolModeMeta: 'Meta Tools - Use mcp.search/mcp.invoke for dynamic discovery (best for large catalogs)', + /** + *@description MCP max tools per turn label + */ + mcpMaxToolsPerTurn: 'Max Tools Per Turn', + /** + *@description MCP max tools per turn hint + */ + mcpMaxToolsPerTurnHint: 'Maximum number of tools to surface to agents in a single turn (default: 20)', + /** + *@description MCP max MCP tools per turn label + */ + mcpMaxMcpPerTurn: 'Max MCP Tools Per Turn', + /** + *@description MCP max MCP tools per turn hint + */ + mcpMaxMcpPerTurnHint: 'Maximum number of MCP tools to include in tool selection (default: 8)', }; const str_ = i18n.i18n.registerUIStrings('panels/ai_chat/ui/SettingsDialog.ts', UIStrings); @@ -442,8 +532,17 @@ export class SettingsDialog { providerHint.textContent = i18nString(UIStrings.providerHint); providerSection.appendChild(providerHint); - // Get the current provider from localStorage - const currentProvider = localStorage.getItem(PROVIDER_SELECTION_KEY) || 'openai'; + // Determine current provider: prefer the provider for the currently selected model if available + const storedProvider = localStorage.getItem(PROVIDER_SELECTION_KEY) || 'openai'; + let currentProvider = storedProvider as 'openai' | 'litellm' | 'groq' | 'openrouter'; + try { + const selectedModelOption = modelOptions.find(opt => opt.value === selectedModel); + if (selectedModelOption && selectedModelOption.type) { + currentProvider = selectedModelOption.type as 'openai' | 'litellm' | 'groq' | 'openrouter'; + } + } catch (e) { + // Fallback silently to storedProvider + } // Create provider selection dropdown const providerSelect = document.createElement('select'); @@ -474,6 +573,9 @@ export class SettingsDialog { openrouterOption.textContent = i18nString(UIStrings.openrouterProvider); openrouterOption.selected = currentProvider === 'openrouter'; providerSelect.appendChild(openrouterOption); + + // Ensure the select's value reflects the computed currentProvider + providerSelect.value = currentProvider; // Create provider-specific content containers const openaiContent = document.createElement('div'); @@ -1197,7 +1299,7 @@ export class SettingsDialog { const advancedToggleHint = document.createElement('div'); advancedToggleHint.className = 'settings-hint'; - advancedToggleHint.textContent = 'Show advanced configuration options (Browsing History, Vector DB, Tracing, Evaluation)'; + advancedToggleHint.textContent = 'Show advanced configuration options (Browsing History, Vector DB, Tracing, Evaluation, MCP)'; advancedToggleSection.appendChild(advancedToggleHint); // Add browsing history section @@ -2319,6 +2421,459 @@ export class SettingsDialog { evaluationEndpointInput.value = currentEvaluationConfig.endpoint || 'ws://localhost:8080'; evaluationConfigContainer.appendChild(evaluationEndpointInput); + // ---- MCP Integration Section ---- + const mcpSection = document.createElement('div'); + mcpSection.className = 'settings-section mcp-section'; + contentDiv.appendChild(mcpSection); + + const mcpSectionTitle = document.createElement('h3'); + mcpSectionTitle.className = 'settings-subtitle'; + mcpSectionTitle.textContent = i18nString(UIStrings.mcpSection); + mcpSection.appendChild(mcpSectionTitle); + + // Current MCP config + const currentMCPConfig = getMCPConfig(); + + // Enable checkbox + const mcpEnabledContainer = document.createElement('div'); + mcpEnabledContainer.className = 'mcp-enabled-container'; + mcpSection.appendChild(mcpEnabledContainer); + + const mcpEnabledCheckbox = document.createElement('input'); + mcpEnabledCheckbox.type = 'checkbox'; + mcpEnabledCheckbox.id = 'mcp-enabled'; + mcpEnabledCheckbox.className = 'mcp-checkbox'; + mcpEnabledCheckbox.checked = isMCPEnabled(); + mcpEnabledContainer.appendChild(mcpEnabledCheckbox); + + const mcpEnabledLabel = document.createElement('label'); + mcpEnabledLabel.htmlFor = 'mcp-enabled'; + mcpEnabledLabel.className = 'mcp-label'; + mcpEnabledLabel.textContent = i18nString(UIStrings.mcpEnabled); + mcpEnabledContainer.appendChild(mcpEnabledLabel); + + const mcpEnabledHint = document.createElement('div'); + mcpEnabledHint.className = 'settings-hint'; + mcpEnabledHint.textContent = i18nString(UIStrings.mcpEnabledHint); + mcpSection.appendChild(mcpEnabledHint); + + // Status indicator + const mcpStatusContainer = document.createElement('div'); + mcpStatusContainer.className = 'connection-status-container'; + mcpStatusContainer.style.display = 'flex'; + mcpStatusContainer.style.alignItems = 'center'; + mcpStatusContainer.style.gap = '8px'; + mcpStatusContainer.style.marginTop = '8px'; + mcpStatusContainer.style.fontSize = '13px'; + mcpSection.appendChild(mcpStatusContainer); + + const mcpStatusDot = document.createElement('div'); + mcpStatusDot.className = 'connection-status-dot'; + mcpStatusDot.style.width = '8px'; + mcpStatusDot.style.height = '8px'; + mcpStatusDot.style.borderRadius = '50%'; + mcpStatusDot.style.flexShrink = '0'; + mcpStatusContainer.appendChild(mcpStatusDot); + + const mcpStatusText = document.createElement('span'); + mcpStatusText.className = 'connection-status-text'; + mcpStatusContainer.appendChild(mcpStatusText); + + const mcpStatusDetails = document.createElement('div'); + mcpStatusDetails.className = 'settings-hint'; + mcpStatusDetails.style.marginTop = '4px'; + mcpSection.appendChild(mcpStatusDetails); + + const formatTimestamp = (date: Date | undefined): string => { + if (!date) return ''; + return date.toLocaleString(); + }; + + const formatMCPError = (error: string, errorType?: string): string => { + if (!errorType) return error; + + switch (errorType) { + case 'connection': + return `Connection failed: ${error}
Check if the MCP server is running and the endpoint URL is correct.`; + case 'authentication': + return `Authentication failed: ${error}
Verify your auth token is correct and has not expired.`; + case 'configuration': + return `Configuration error: ${error}
Check your endpoint URL format (should be ws:// or wss://).`; + case 'network': + return `Network error: ${error}
Check your internet connection and firewall settings.`; + case 'server_error': + return `Server error: ${error}
The MCP server encountered an internal error. Contact the server administrator.`; + default: + return error; + } + }; + + const updateMCPStatus = () => { + const status = MCPRegistry.getStatus(); + if (!status.enabled) { + mcpStatusDot.style.backgroundColor = 'var(--color-text-disabled)'; + mcpStatusText.textContent = 'Disabled'; + mcpStatusText.style.color = 'var(--color-text-disabled)'; + mcpStatusDetails.innerHTML = ''; + return; + } + const anyConnected = status.servers.some(s => s.connected); + const toolCount = status.registeredToolNames.length; + if (anyConnected) { + mcpStatusDot.style.backgroundColor = 'var(--color-accent-green)'; + mcpStatusText.textContent = `Connected (${toolCount} tools)`; + mcpStatusText.style.color = 'var(--color-accent-green)'; + + let detailsHtml = ''; + if (status.lastConnected) { + detailsHtml += `Last connected: ${formatTimestamp(status.lastConnected)}
`; + } + if (status.lastError) { + detailsHtml += `${formatMCPError(status.lastError, status.lastErrorType)}`; + } + mcpStatusDetails.innerHTML = detailsHtml; + } else { + mcpStatusDot.style.backgroundColor = 'var(--color-text-disabled)'; + mcpStatusText.textContent = 'Not connected'; + mcpStatusText.style.color = 'var(--color-text-disabled)'; + + let detailsHtml = ''; + if (status.lastDisconnected) { + detailsHtml += `Last disconnected: ${formatTimestamp(status.lastDisconnected)}
`; + } + if (status.lastError) { + detailsHtml += `${formatMCPError(status.lastError, status.lastErrorType)}`; + } + mcpStatusDetails.innerHTML = detailsHtml; + } + }; + updateMCPStatus(); + + // Disconnect button (only shown when connected) + const mcpDisconnectContainer = document.createElement('div'); + mcpDisconnectContainer.style.marginTop = '8px'; + mcpDisconnectContainer.style.marginBottom = '8px'; + mcpSection.appendChild(mcpDisconnectContainer); + + const mcpDisconnectButton = document.createElement('button'); + mcpDisconnectButton.textContent = 'Disconnect'; + mcpDisconnectButton.className = 'settings-button'; + mcpDisconnectButton.style.backgroundColor = 'var(--color-button-secondary)'; + mcpDisconnectButton.style.border = '1px solid var(--color-button-outline)'; + mcpDisconnectButton.style.color = 'var(--color-text-primary)'; + mcpDisconnectButton.style.padding = '4px 8px'; + mcpDisconnectButton.style.borderRadius = '3px'; + mcpDisconnectButton.style.cursor = 'pointer'; + mcpDisconnectButton.addEventListener('click', async () => { + try { + MCPRegistry.dispose(); + updateMCPStatus(); + updateDisconnectButton(); + updateToolsList(); + } catch (err) { + console.error('Failed to disconnect MCP:', err); + } + }); + mcpDisconnectContainer.appendChild(mcpDisconnectButton); + + const updateDisconnectButton = () => { + const status = MCPRegistry.getStatus(); + const anyConnected = status.enabled && status.servers.some(s => s.connected); + mcpDisconnectContainer.style.display = anyConnected ? 'block' : 'none'; + }; + updateDisconnectButton(); + + // MCP config inputs (visible when enabled) + const mcpConfigContainer = document.createElement('div'); + mcpConfigContainer.className = 'mcp-config-container'; + mcpConfigContainer.style.display = mcpEnabledCheckbox.checked ? 'block' : 'none'; + mcpSection.appendChild(mcpConfigContainer); + + // Endpoint + const mcpEndpointLabel = document.createElement('div'); + mcpEndpointLabel.className = 'settings-label'; + mcpEndpointLabel.textContent = i18nString(UIStrings.mcpEndpoint); + mcpConfigContainer.appendChild(mcpEndpointLabel); + + const mcpEndpointHint = document.createElement('div'); + mcpEndpointHint.className = 'settings-hint'; + mcpEndpointHint.textContent = i18nString(UIStrings.mcpEndpointHint); + mcpConfigContainer.appendChild(mcpEndpointHint); + + const mcpEndpointInput = document.createElement('input'); + mcpEndpointInput.type = 'text'; + mcpEndpointInput.className = 'settings-input'; + mcpEndpointInput.placeholder = 'ws://localhost:9000'; + mcpEndpointInput.value = currentMCPConfig.endpoint || ''; + mcpConfigContainer.appendChild(mcpEndpointInput); + + // Token + const mcpTokenLabel = document.createElement('div'); + mcpTokenLabel.className = 'settings-label'; + mcpTokenLabel.textContent = i18nString(UIStrings.mcpToken); + mcpConfigContainer.appendChild(mcpTokenLabel); + + const mcpTokenHint = document.createElement('div'); + mcpTokenHint.className = 'settings-hint'; + mcpTokenHint.textContent = i18nString(UIStrings.mcpTokenHint); + mcpConfigContainer.appendChild(mcpTokenHint); + + const mcpTokenInput = document.createElement('input'); + mcpTokenInput.type = 'password'; + mcpTokenInput.className = 'settings-input'; + mcpTokenInput.placeholder = 'Optional'; + mcpTokenInput.value = currentMCPConfig.token || ''; + mcpConfigContainer.appendChild(mcpTokenInput); + + // Connect/Refresh button + const mcpConnectButton = document.createElement('button'); + mcpConnectButton.className = 'settings-button'; + mcpConnectButton.textContent = i18nString(UIStrings.mcpConnectRefresh); + mcpConnectButton.addEventListener('click', async () => { + // Save config then init/refresh + setMCPConfig({ + enabled: mcpEnabledCheckbox.checked, + endpoint: mcpEndpointInput.value.trim(), + token: mcpTokenInput.value.trim() || undefined, + }); + try { + await MCPRegistry.init(); + await MCPRegistry.refresh(); + } catch (err) { + logger.error('MCP connect/refresh failed', err); + } finally { + updateMCPStatus(); + updateDisconnectButton(); + updateToolsList(); + onSettingsSaved(); + } + }); + mcpConfigContainer.appendChild(mcpConnectButton); + + // Autostart checkbox + const mcpAutostartContainer = document.createElement('div'); + mcpAutostartContainer.className = 'settings-checkbox-container'; + mcpConfigContainer.appendChild(mcpAutostartContainer); + + const mcpAutostartCheckbox = document.createElement('input'); + mcpAutostartCheckbox.type = 'checkbox'; + mcpAutostartCheckbox.id = 'mcp-autostart'; + mcpAutostartCheckbox.className = 'mcp-autostart-checkbox'; + mcpAutostartCheckbox.checked = currentMCPConfig.autostart || false; + mcpAutostartContainer.appendChild(mcpAutostartCheckbox); + + const mcpAutostartLabel = document.createElement('label'); + mcpAutostartLabel.htmlFor = 'mcp-autostart'; + mcpAutostartLabel.className = 'settings-label'; + mcpAutostartLabel.textContent = i18nString(UIStrings.mcpAutostart); + mcpAutostartContainer.appendChild(mcpAutostartLabel); + + const mcpAutostartHint = document.createElement('div'); + mcpAutostartHint.className = 'settings-hint'; + mcpAutostartHint.textContent = i18nString(UIStrings.mcpAutostartHint); + mcpConfigContainer.appendChild(mcpAutostartHint); + + // Tool mode selection + const mcpToolModeLabel = document.createElement('div'); + mcpToolModeLabel.className = 'settings-label'; + mcpToolModeLabel.textContent = i18nString(UIStrings.mcpToolMode); + mcpConfigContainer.appendChild(mcpToolModeLabel); + + const mcpToolModeHint = document.createElement('div'); + mcpToolModeHint.className = 'settings-hint'; + mcpToolModeHint.textContent = i18nString(UIStrings.mcpToolModeHint); + mcpConfigContainer.appendChild(mcpToolModeHint); + + const mcpToolModeSelect = document.createElement('select'); + mcpToolModeSelect.className = 'settings-select'; + mcpConfigContainer.appendChild(mcpToolModeSelect); + + // Tool mode options + const toolModeOptions = [ + { value: 'all', text: i18nString(UIStrings.mcpToolModeAll) }, + { value: 'router', text: i18nString(UIStrings.mcpToolModeRouter) }, + { value: 'meta', text: i18nString(UIStrings.mcpToolModeMeta) }, + ]; + + toolModeOptions.forEach(option => { + const optionElement = document.createElement('option'); + optionElement.value = option.value; + optionElement.textContent = option.text; + if ((currentMCPConfig.toolMode || 'router') === option.value) { + optionElement.selected = true; + } + mcpToolModeSelect.appendChild(optionElement); + }); + + // Ensure the select reflects the currently stored mode even if options were appended later + mcpToolModeSelect.value = (currentMCPConfig.toolMode || 'router'); + + // Handle tool mode changes + mcpToolModeSelect.addEventListener('change', () => { + setMCPConfig({ + ...getMCPConfig(), + toolMode: mcpToolModeSelect.value as 'all' | 'router' | 'meta', + }); + onSettingsSaved(); + }); + + // Advanced budget controls + const mcpMaxToolsLabel = document.createElement('div'); + mcpMaxToolsLabel.className = 'settings-label'; + mcpMaxToolsLabel.textContent = i18nString(UIStrings.mcpMaxToolsPerTurn); + mcpConfigContainer.appendChild(mcpMaxToolsLabel); + + const mcpMaxToolsHint = document.createElement('div'); + mcpMaxToolsHint.className = 'settings-hint'; + mcpMaxToolsHint.textContent = i18nString(UIStrings.mcpMaxToolsPerTurnHint); + mcpConfigContainer.appendChild(mcpMaxToolsHint); + + const mcpMaxToolsInput = document.createElement('input'); + mcpMaxToolsInput.type = 'number'; + mcpMaxToolsInput.className = 'settings-input'; + mcpMaxToolsInput.min = '1'; + mcpMaxToolsInput.max = '100'; + mcpMaxToolsInput.value = String(currentMCPConfig.maxToolsPerTurn || 20); + mcpConfigContainer.appendChild(mcpMaxToolsInput); + + const mcpMaxMcpLabel = document.createElement('div'); + mcpMaxMcpLabel.className = 'settings-label'; + mcpMaxMcpLabel.textContent = i18nString(UIStrings.mcpMaxMcpPerTurn); + mcpConfigContainer.appendChild(mcpMaxMcpLabel); + + const mcpMaxMcpHint = document.createElement('div'); + mcpMaxMcpHint.className = 'settings-hint'; + mcpMaxMcpHint.textContent = i18nString(UIStrings.mcpMaxMcpPerTurnHint); + mcpConfigContainer.appendChild(mcpMaxMcpHint); + + const mcpMaxMcpInput = document.createElement('input'); + mcpMaxMcpInput.type = 'number'; + mcpMaxMcpInput.className = 'settings-input'; + mcpMaxMcpInput.min = '1'; + mcpMaxMcpInput.max = '50'; + mcpMaxMcpInput.value = String(currentMCPConfig.maxMcpPerTurn || 8); + mcpConfigContainer.appendChild(mcpMaxMcpInput); + + // Handle budget control changes + const updateBudgetControls = () => { + const maxTools = Math.max(1, Math.min(100, parseInt(mcpMaxToolsInput.value, 10) || 20)); + const maxMcp = Math.max(1, Math.min(50, parseInt(mcpMaxMcpInput.value, 10) || 8)); + setMCPConfig({ + ...getMCPConfig(), + maxToolsPerTurn: maxTools, + maxMcpPerTurn: maxMcp, + }); + onSettingsSaved(); + }; + + mcpMaxToolsInput.addEventListener('change', updateBudgetControls); + mcpMaxMcpInput.addEventListener('change', updateBudgetControls); + + // Tool management UI + const mcpToolsSection = document.createElement('div'); + mcpToolsSection.className = 'mcp-tools-section'; + mcpConfigContainer.appendChild(mcpToolsSection); + + const mcpToolsLabel = document.createElement('div'); + mcpToolsLabel.className = 'settings-label'; + mcpToolsLabel.textContent = i18nString(UIStrings.mcpDiscoveredTools); + mcpToolsSection.appendChild(mcpToolsLabel); + + const mcpToolsHint = document.createElement('div'); + mcpToolsHint.className = 'settings-hint'; + mcpToolsHint.textContent = i18nString(UIStrings.mcpDiscoveredToolsHint); + mcpToolsSection.appendChild(mcpToolsHint); + + const mcpToolsList = document.createElement('div'); + mcpToolsList.className = 'mcp-tools-list'; + mcpToolsSection.appendChild(mcpToolsList); + + const updateToolsList = () => { + const status = MCPRegistry.getStatus(); + mcpToolsList.innerHTML = ''; + + if (!status.enabled || status.registeredToolNames.length === 0) { + const noToolsMessage = document.createElement('div'); + noToolsMessage.className = 'mcp-no-tools'; + noToolsMessage.textContent = i18nString(UIStrings.mcpNoTools); + mcpToolsList.appendChild(noToolsMessage); + return; + } + + const currentAllowlist = new Set(currentMCPConfig.toolAllowlist || []); + + status.registeredToolNames.forEach(toolName => { + const toolItem = document.createElement('div'); + toolItem.className = 'mcp-tool-item'; + + const toolCheckbox = document.createElement('input'); + toolCheckbox.type = 'checkbox'; + toolCheckbox.id = `mcp-tool-${toolName.replace(/[^a-zA-Z0-9]/g, '-')}`; + toolCheckbox.className = 'mcp-tool-checkbox'; + toolCheckbox.checked = currentAllowlist.size === 0 || currentAllowlist.has(toolName); + toolItem.appendChild(toolCheckbox); + + const toolLabel = document.createElement('label'); + toolLabel.htmlFor = toolCheckbox.id; + toolLabel.className = 'mcp-tool-label'; + toolLabel.textContent = toolName.replace(/^mcp:[^:]+:/, ''); // Remove namespace prefix + toolItem.appendChild(toolLabel); + + // Update allowlist when checkbox changes + toolCheckbox.addEventListener('change', () => { + const currentConfig = getMCPConfig(); + const allowlist = new Set(currentConfig.toolAllowlist || []); + + if (toolCheckbox.checked) { + allowlist.add(toolName); + } else { + allowlist.delete(toolName); + } + + setMCPConfig({ + ...currentConfig, + toolAllowlist: Array.from(allowlist), + }); + }); + + mcpToolsList.appendChild(toolItem); + }); + }; + + // Initial tools list update + updateToolsList(); + + // Update autostart setting + mcpAutostartCheckbox.addEventListener('change', () => { + setMCPConfig({ + ...getMCPConfig(), + autostart: mcpAutostartCheckbox.checked, + }); + onSettingsSaved(); + }); + + // Toggle visibility on enable/disable + mcpEnabledCheckbox.addEventListener('change', async () => { + setMCPConfig({ + enabled: mcpEnabledCheckbox.checked, + endpoint: mcpEndpointInput.value.trim(), + token: mcpTokenInput.value.trim() || undefined, + autostart: mcpAutostartCheckbox.checked, + }); + mcpConfigContainer.style.display = mcpEnabledCheckbox.checked ? 'block' : 'none'; + try { + await MCPRegistry.init(); + await MCPRegistry.refresh(); + } catch (err) { + logger.error('MCP toggle failed', err); + } finally { + updateMCPStatus(); + updateDisconnectButton(); + updateToolsList(); + onSettingsSaved(); + } + }); + // Evaluation secret key const evaluationSecretKeyLabel = document.createElement('div'); evaluationSecretKeyLabel.className = 'settings-label'; @@ -2613,6 +3168,30 @@ export class SettingsDialog { endpoint: evaluationEndpointInput.value.trim() || 'ws://localhost:8080', secretKey: evaluationSecretKeyInput.value.trim() }); + + // Save MCP configuration as part of general Save (not only on Connect/Enable) + try { + // Safely read current inputs if MCP section exists + const enabled = !!mcpEnabledCheckbox?.checked; + const endpoint = mcpEndpointInput?.value?.trim() || ''; + const token = mcpTokenInput?.value?.trim() || ''; + const autostart = !!mcpAutostartCheckbox?.checked; + const toolMode = (mcpToolModeSelect?.value as 'all' | 'router' | 'meta') || 'router'; + const maxTools = Math.max(1, Math.min(100, parseInt(mcpMaxToolsInput?.value || '20', 10))); + const maxMcp = Math.max(1, Math.min(50, parseInt(mcpMaxMcpInput?.value || '8', 10))); + + setMCPConfig({ + enabled, + endpoint: endpoint || undefined, + token: token || undefined, + autostart, + toolMode, + maxToolsPerTurn: maxTools, + maxMcpPerTurn: maxMcp, + }); + } catch (err) { + logger.warn('Failed to save MCP settings from Save button:', err); + } logger.debug('Settings saved successfully'); logger.debug('Mini Model:', localStorage.getItem(MINI_MODEL_STORAGE_KEY)); @@ -2639,6 +3218,8 @@ export class SettingsDialog { vectorDBSection.style.display = display; tracingSection.style.display = display; evaluationSection.style.display = display; + const mcpSectionEl = contentDiv.querySelector('.mcp-section') as HTMLElement | null; + if (mcpSectionEl) { mcpSectionEl.style.display = display; } // Save state to localStorage localStorage.setItem(ADVANCED_SETTINGS_ENABLED_KEY, show.toString()); @@ -3156,4 +3737,4 @@ function createModelSelector( } return modelSelect; -} \ No newline at end of file +} diff --git a/front_end/third_party/additional_readme_paths.json b/front_end/third_party/additional_readme_paths.json index 727e6e8d34..f7fedddd57 100644 --- a/front_end/third_party/additional_readme_paths.json +++ b/front_end/third_party/additional_readme_paths.json @@ -12,6 +12,7 @@ "lighthouse", "lit", "marked", + "mcp-sdk", "puppeteer", "puppeteer/third_party/mitt", "puppeteer/third_party/parsel", diff --git a/front_end/third_party/mcp-sdk/BUILD.gn b/front_end/third_party/mcp-sdk/BUILD.gn new file mode 100644 index 0000000000..b742491f8d --- /dev/null +++ b/front_end/third_party/mcp-sdk/BUILD.gn @@ -0,0 +1,57 @@ +# Copyright 2025 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("../../../scripts/build/ninja/devtools_entrypoint.gni") +import("../../../scripts/build/ninja/devtools_pre_built.gni") +import("../visibility.gni") + +devtools_pre_built("mcp-sdk") { + sources_are_release = false + + sources = [ + # TypeScript configuration + "mcp-sdk-tsconfig.json", + + # AJV JSON Schema validator (dependency) + "ajv/dist/ajv.d.ts", + "ajv/dist/ajv.js", + "ajv/package.json", + + # Zod schema validation library (dependency) + "zod/index.d.ts", + "zod/lib/index.js", + "zod/lib/index.mjs", + "zod/package.json", + + # Main MCP SDK files + "package/dist/client/index.d.ts", + "package/dist/client/index.js", + "package/dist/client/sse.d.ts", + "package/dist/client/sse.js", + "package/dist/shared/transport.d.ts", + "package/dist/shared/transport.js", + "package/dist/shared/protocol.d.ts", + "package/dist/shared/protocol.js", + "package/dist/types.d.ts", + "package/dist/types.js", + + # EventSource parser dependency + "eventsource-parser/package/dist/index.d.ts", + "eventsource-parser/package/dist/index.js", + "eventsource-parser/package/dist/stream.d.ts", + "eventsource-parser/package/dist/stream.js", + ] +} + +devtools_entrypoint("bundle") { + entrypoint = "mcp-sdk.ts" + + deps = [ ":mcp-sdk" ] + + visibility = [ + "../../panels/ai_chat/*", + ] + + visibility += devtools_third_party_visibility +} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/LICENSE b/front_end/third_party/mcp-sdk/LICENSE new file mode 100644 index 0000000000..136059a2b9 --- /dev/null +++ b/front_end/third_party/mcp-sdk/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Anthropic, PBC + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/README.chromium b/front_end/third_party/mcp-sdk/README.chromium new file mode 100644 index 0000000000..6aba490493 --- /dev/null +++ b/front_end/third_party/mcp-sdk/README.chromium @@ -0,0 +1,24 @@ +Name: Model Context Protocol SDK +Short Name: mcp-sdk +URL: https://github.com/modelcontextprotocol/typescript-sdk +Version: 1.12.3 +License: MIT +License File: LICENSE +Security Critical: no +Shipped: yes + +Description: +Official TypeScript SDK for Model Context Protocol (MCP) - enables AI assistants +to interact with external systems through a standardized protocol. + +Dependencies: +- eventsource-parser@3.0.6 (MIT license) + +To update this package: +wget -qO- https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.12.3.tgz | tar xzf - +wget -qO- https://registry.npmjs.org/eventsource-parser/-/eventsource-parser-3.0.6.tgz | tar xzf - + +Local Modifications: +- Created mcp-sdk.ts wrapper for DevTools integration +- Removed Node.js-specific code paths +- Modified imports to use DevTools module system \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/.runkit_example.js b/front_end/third_party/mcp-sdk/ajv/.runkit_example.js new file mode 100644 index 0000000000..0d578d5d51 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/.runkit_example.js @@ -0,0 +1,23 @@ +const Ajv = require("ajv") +const ajv = new Ajv({allErrors: true}) + +const schema = { + type: "object", + properties: { + foo: {type: "string"}, + bar: {type: "number", maximum: 3}, + }, + required: ["foo", "bar"], + additionalProperties: false, +} + +const validate = ajv.compile(schema) + +test({foo: "abc", bar: 2}) +test({foo: 2, bar: 4}) + +function test(data) { + const valid = validate(data) + if (valid) console.log("Valid!") + else console.log("Invalid: " + ajv.errorsText(validate.errors)) +} diff --git a/front_end/third_party/mcp-sdk/ajv/LICENSE b/front_end/third_party/mcp-sdk/ajv/LICENSE new file mode 100644 index 0000000000..139162ad2c --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015-2021 Evgeny Poberezkin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/front_end/third_party/mcp-sdk/ajv/README.md b/front_end/third_party/mcp-sdk/ajv/README.md new file mode 100644 index 0000000000..d8ee276cef --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/README.md @@ -0,0 +1,207 @@ +Ajv logo + +  + +# Ajv JSON schema validator + +The fastest JSON validator for Node.js and browser. + +Supports JSON Schema draft-04/06/07/2019-09/2020-12 ([draft-04 support](https://ajv.js.org/json-schema.html#draft-04) requires ajv-draft-04 package) and JSON Type Definition [RFC8927](https://datatracker.ietf.org/doc/rfc8927/). + +[![build](https://github.com/ajv-validator/ajv/actions/workflows/build.yml/badge.svg)](https://github.com/ajv-validator/ajv/actions?query=workflow%3Abuild) +[![npm](https://img.shields.io/npm/v/ajv.svg)](https://www.npmjs.com/package/ajv) +[![npm downloads](https://img.shields.io/npm/dm/ajv.svg)](https://www.npmjs.com/package/ajv) +[![Coverage Status](https://coveralls.io/repos/github/ajv-validator/ajv/badge.svg?branch=master)](https://coveralls.io/github/ajv-validator/ajv?branch=master) +[![SimpleX](https://img.shields.io/badge/chat-on%20SimpleX-70F0F9)](https://simplex.chat/contact#/?v=1-2&smp=smp%3A%2F%2Fu2dS9sG8nMNURyZwqASV4yROM28Er0luVTx5X1CsMrU%3D%40smp4.simplex.im%2F8KvvURM6J38Gdq9dCuPswMOkMny0xCOJ%23%2F%3Fv%3D1-2%26dh%3DMCowBQYDK2VuAyEAr8rPVRuMOXv6kwF2yUAap-eoVg-9ssOFCi1fIrxTUw0%253D%26srv%3Do5vmywmrnaxalvz6wi3zicyftgio6psuvyniis6gco6bp6ekl4cqj4id.onion&data=%7B%22type%22%3A%22group%22%2C%22groupLinkId%22%3A%224pwLRgWHU9tlroMWHz0uOg%3D%3D%22%7D) +[![Gitter](https://img.shields.io/gitter/room/ajv-validator/ajv.svg)](https://gitter.im/ajv-validator/ajv) +[![GitHub Sponsors](https://img.shields.io/badge/$-sponsors-brightgreen)](https://github.com/sponsors/epoberezkin) + +## Ajv sponsors + +[Mozilla](https://www.mozilla.org)[](https://opencollective.com/ajv) + +[Microsoft](https://opensource.microsoft.com)[](https://opencollective.com/ajv)[](https://opencollective.com/ajv) + +[Retool](https://retool.com/?utm_source=sponsor&utm_campaign=ajv)[Tidelift](https://tidelift.com/subscription/pkg/npm-ajv?utm_source=npm-ajv&utm_medium=referral&utm_campaign=enterprise)[SimpleX](https://github.com/simplex-chat/simplex-chat)[](https://opencollective.com/ajv) + +## Contributing + +More than 100 people contributed to Ajv, and we would love to have you join the development. We welcome implementing new features that will benefit many users and ideas to improve our documentation. + +Please review [Contributing guidelines](./CONTRIBUTING.md) and [Code components](https://ajv.js.org/components.html). + +## Documentation + +All documentation is available on the [Ajv website](https://ajv.js.org). + +Some useful site links: + +- [Getting started](https://ajv.js.org/guide/getting-started.html) +- [JSON Schema vs JSON Type Definition](https://ajv.js.org/guide/schema-language.html) +- [API reference](https://ajv.js.org/api.html) +- [Strict mode](https://ajv.js.org/strict-mode.html) +- [Standalone validation code](https://ajv.js.org/standalone.html) +- [Security considerations](https://ajv.js.org/security.html) +- [Command line interface](https://ajv.js.org/packages/ajv-cli.html) +- [Frequently Asked Questions](https://ajv.js.org/faq.html) + +## Please [sponsor Ajv development](https://github.com/sponsors/epoberezkin) + +Since I asked to support Ajv development 40 people and 6 organizations contributed via GitHub and OpenCollective - this support helped receiving the MOSS grant! + +Your continuing support is very important - the funds will be used to develop and maintain Ajv once the next major version is released. + +Please sponsor Ajv via: + +- [GitHub sponsors page](https://github.com/sponsors/epoberezkin) (GitHub will match it) +- [Ajv Open Collective](https://opencollective.com/ajv) + +Thank you. + +#### Open Collective sponsors + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## Performance + +Ajv generates code to turn JSON Schemas into super-fast validation functions that are efficient for v8 optimization. + +Currently Ajv is the fastest and the most standard compliant validator according to these benchmarks: + +- [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark) - 50% faster than the second place +- [jsck benchmark](https://github.com/pandastrike/jsck#benchmarks) - 20-190% faster +- [z-schema benchmark](https://rawgit.com/zaggino/z-schema/master/benchmark/results.html) +- [themis benchmark](https://cdn.rawgit.com/playlyfe/themis/master/benchmark/results.html) + +Performance of different validators by [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark): + +[![performance](https://chart.googleapis.com/chart?chxt=x,y&cht=bhs&chco=76A4FB&chls=2.0&chbh=62,4,1&chs=600x416&chxl=-1:|ajv|@exodus/schemasafe|is-my-json-valid|djv|@cfworker/json-schema|jsonschema/=t:100,69.2,51.5,13.1,5.1,1.2)](https://github.com/ebdrup/json-schema-benchmark/blob/master/README.md#performance) + +## Features + +- Ajv implements JSON Schema [draft-06/07/2019-09/2020-12](http://json-schema.org/) standards (draft-04 is supported in v6): + - all validation keywords (see [JSON Schema validation keywords](https://ajv.js.org/json-schema.html)) + - [OpenAPI](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md) extensions: + - NEW: keyword [discriminator](https://ajv.js.org/json-schema.html#discriminator). + - keyword [nullable](https://ajv.js.org/json-schema.html#nullable). + - full support of remote references (remote schemas have to be added with `addSchema` or compiled to be available) + - support of recursive references between schemas + - correct string lengths for strings with unicode pairs + - JSON Schema [formats](https://ajv.js.org/guide/formats.html) (with [ajv-formats](https://github.com/ajv-validator/ajv-formats) plugin). + - [validates schemas against meta-schema](https://ajv.js.org/api.html#api-validateschema) +- NEW: supports [JSON Type Definition](https://datatracker.ietf.org/doc/rfc8927/): + - all keywords (see [JSON Type Definition schema forms](https://ajv.js.org/json-type-definition.html)) + - meta-schema for JTD schemas + - "union" keyword and user-defined keywords (can be used inside "metadata" member of the schema) +- supports [browsers](https://ajv.js.org/guide/environments.html#browsers) and Node.js 10.x - current +- [asynchronous loading](https://ajv.js.org/guide/managing-schemas.html#asynchronous-schema-loading) of referenced schemas during compilation +- "All errors" validation mode with [option allErrors](https://ajv.js.org/options.html#allerrors) +- [error messages with parameters](https://ajv.js.org/api.html#validation-errors) describing error reasons to allow error message generation +- i18n error messages support with [ajv-i18n](https://github.com/ajv-validator/ajv-i18n) package +- [removing-additional-properties](https://ajv.js.org/guide/modifying-data.html#removing-additional-properties) +- [assigning defaults](https://ajv.js.org/guide/modifying-data.html#assigning-defaults) to missing properties and items +- [coercing data](https://ajv.js.org/guide/modifying-data.html#coercing-data-types) to the types specified in `type` keywords +- [user-defined keywords](https://ajv.js.org/guide/user-keywords.html) +- additional extension keywords with [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package +- [\$data reference](https://ajv.js.org/guide/combining-schemas.html#data-reference) to use values from the validated data as values for the schema keywords +- [asynchronous validation](https://ajv.js.org/guide/async-validation.html) of user-defined formats and keywords + +## Install + +To install version 8: + +``` +npm install ajv +``` + +## Getting started + +Try it in the Node.js REPL: https://runkit.com/npm/ajv + +In JavaScript: + +```javascript +// or ESM/TypeScript import +import Ajv from "ajv" +// Node.js require: +const Ajv = require("ajv") + +const ajv = new Ajv() // options can be passed, e.g. {allErrors: true} + +const schema = { + type: "object", + properties: { + foo: {type: "integer"}, + bar: {type: "string"}, + }, + required: ["foo"], + additionalProperties: false, +} + +const data = { + foo: 1, + bar: "abc", +} + +const validate = ajv.compile(schema) +const valid = validate(data) +if (!valid) console.log(validate.errors) +``` + +Learn how to use Ajv and see more examples in the [Guide: getting started](https://ajv.js.org/guide/getting-started.html) + +## Changes history + +See [https://github.com/ajv-validator/ajv/releases](https://github.com/ajv-validator/ajv/releases) + +**Please note**: [Changes in version 8.0.0](https://github.com/ajv-validator/ajv/releases/tag/v8.0.0) + +[Version 7.0.0](https://github.com/ajv-validator/ajv/releases/tag/v7.0.0) + +[Version 6.0.0](https://github.com/ajv-validator/ajv/releases/tag/v6.0.0). + +## Code of conduct + +Please review and follow the [Code of conduct](./CODE_OF_CONDUCT.md). + +Please report any unacceptable behaviour to ajv.validator@gmail.com - it will be reviewed by the project team. + +## Security contact + +To report a security vulnerability, please use the +[Tidelift security contact](https://tidelift.com/security). +Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerabilities via GitHub issues. + +## Open-source software support + +Ajv is a part of [Tidelift subscription](https://tidelift.com/subscription/pkg/npm-ajv?utm_source=npm-ajv&utm_medium=referral&utm_campaign=readme) - it provides a centralised support to open-source software users, in addition to the support provided by software maintainers. + +## License + +[MIT](./LICENSE) diff --git a/front_end/third_party/mcp-sdk/ajv/dist/2019.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/2019.d.ts new file mode 100644 index 0000000000..e835e2b27a --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/2019.d.ts @@ -0,0 +1,19 @@ +import type { AnySchemaObject } from "./types"; +import AjvCore, { Options } from "./core"; +export declare class Ajv2019 extends AjvCore { + constructor(opts?: Options); + _addVocabularies(): void; + _addDefaultMetaSchema(): void; + defaultMeta(): string | AnySchemaObject | undefined; +} +export default Ajv2019; +export { Format, FormatDefinition, AsyncFormatDefinition, KeywordDefinition, KeywordErrorDefinition, CodeKeywordDefinition, MacroKeywordDefinition, FuncKeywordDefinition, Vocabulary, Schema, SchemaObject, AnySchemaObject, AsyncSchema, AnySchema, ValidateFunction, AsyncValidateFunction, ErrorObject, ErrorNoParams, } from "./types"; +export { Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions } from "./core"; +export { SchemaCxt, SchemaObjCxt } from "./compile"; +export { KeywordCxt } from "./compile/validate"; +export { DefinedError } from "./vocabularies/errors"; +export { JSONType } from "./compile/rules"; +export { JSONSchemaType } from "./types/json-schema"; +export { _, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions } from "./compile/codegen"; +export { default as ValidationError } from "./runtime/validation_error"; +export { default as MissingRefError } from "./compile/ref_error"; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/2019.js b/front_end/third_party/mcp-sdk/ajv/dist/2019.js new file mode 100644 index 0000000000..bad415cc2c --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/2019.js @@ -0,0 +1,61 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv2019 = void 0; +const core_1 = require("./core"); +const draft7_1 = require("./vocabularies/draft7"); +const dynamic_1 = require("./vocabularies/dynamic"); +const next_1 = require("./vocabularies/next"); +const unevaluated_1 = require("./vocabularies/unevaluated"); +const discriminator_1 = require("./vocabularies/discriminator"); +const json_schema_2019_09_1 = require("./refs/json-schema-2019-09"); +const META_SCHEMA_ID = "https://json-schema.org/draft/2019-09/schema"; +class Ajv2019 extends core_1.default { + constructor(opts = {}) { + super({ + ...opts, + dynamicRef: true, + next: true, + unevaluated: true, + }); + } + _addVocabularies() { + super._addVocabularies(); + this.addVocabulary(dynamic_1.default); + draft7_1.default.forEach((v) => this.addVocabulary(v)); + this.addVocabulary(next_1.default); + this.addVocabulary(unevaluated_1.default); + if (this.opts.discriminator) + this.addKeyword(discriminator_1.default); + } + _addDefaultMetaSchema() { + super._addDefaultMetaSchema(); + const { $data, meta } = this.opts; + if (!meta) + return; + json_schema_2019_09_1.default.call(this, $data); + this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID; + } + defaultMeta() { + return (this.opts.defaultMeta = + super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined)); + } +} +exports.Ajv2019 = Ajv2019; +module.exports = exports = Ajv2019; +module.exports.Ajv2019 = Ajv2019; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = Ajv2019; +var validate_1 = require("./compile/validate"); +Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function () { return validate_1.KeywordCxt; } }); +var codegen_1 = require("./compile/codegen"); +Object.defineProperty(exports, "_", { enumerable: true, get: function () { return codegen_1._; } }); +Object.defineProperty(exports, "str", { enumerable: true, get: function () { return codegen_1.str; } }); +Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return codegen_1.stringify; } }); +Object.defineProperty(exports, "nil", { enumerable: true, get: function () { return codegen_1.nil; } }); +Object.defineProperty(exports, "Name", { enumerable: true, get: function () { return codegen_1.Name; } }); +Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function () { return codegen_1.CodeGen; } }); +var validation_error_1 = require("./runtime/validation_error"); +Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return validation_error_1.default; } }); +var ref_error_1 = require("./compile/ref_error"); +Object.defineProperty(exports, "MissingRefError", { enumerable: true, get: function () { return ref_error_1.default; } }); +//# sourceMappingURL=2019.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/2019.js.map b/front_end/third_party/mcp-sdk/ajv/dist/2019.js.map new file mode 100644 index 0000000000..7e55d95774 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/2019.js.map @@ -0,0 +1 @@ +{"version":3,"file":"2019.js","sourceRoot":"","sources":["../lib/2019.ts"],"names":[],"mapp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CAAC,SAAS,CAAC,CAAC,CAAA;IACzF,CAAC;CACF;AA/BD,0BA+BC;AAED,MAAM,CAAC,OAAO,GAAG,OAAO,GAAG,OAAO,CAAA;AAClC,MAAM,CAAC,OAAO,CAAC,OAAO,GAAG,OAAO,CAAA;AAChC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC,CAAA;AAE3D,kBAAe,OAAO,CAAA;AAyBtB,+CAA6C;AAArC,sGAAA,UAAU,OAAA;AAIlB,6CAA6F;AAArF,4FAAA,CAAC,OAAA;AAAE,8FAAA,GAAG,OAAA;AAAE,oGAAA,SAAS,OAAA;AAAE,8FAAA,GAAG,OAAA;AAAE,+FAAA,IAAI,OAAA;AAAQ,kGAAA,OAAO,OAAA;AACnD,+DAAqE;AAA7D,mHAAA,OAAO,OAAmB;AAClC,iDAA8D;AAAtD,4GAAA,OAAO,OAAmB"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/2020.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/2020.d.ts new file mode 100644 index 0000000000..2e56c8fcfc --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/2020.d.ts @@ -0,0 +1,19 @@ +import type { AnySchemaObject } from "./types"; +import AjvCore, { Options } from "./core"; +export declare class Ajv2020 extends AjvCore { + constructor(opts?: Options); + _addVocabularies(): void; + _addDefaultMetaSchema(): void; + defaultMeta(): string | AnySchemaObject | undefined; +} +export default Ajv2020; +export { Format, FormatDefinition, AsyncFormatDefinition, KeywordDefinition, KeywordErrorDefinition, CodeKeywordDefinition, MacroKeywordDefinition, FuncKeywordDefinition, Vocabulary, Schema, SchemaObject, AnySchemaObject, AsyncSchema, AnySchema, ValidateFunction, AsyncValidateFunction, ErrorObject, ErrorNoParams, } from "./types"; +export { Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions } from "./core"; +export { SchemaCxt, SchemaObjCxt } from "./compile"; +export { KeywordCxt } from "./compile/validate"; +export { DefinedError } from "./vocabularies/errors"; +export { JSONType } from "./compile/rules"; +export { JSONSchemaType } from "./types/json-schema"; +export { _, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions } from "./compile/codegen"; +export { default as ValidationError } from "./runtime/validation_error"; +export { default as MissingRefError } from "./compile/ref_error"; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/2020.js b/front_end/third_party/mcp-sdk/ajv/dist/2020.js new file mode 100644 index 0000000000..b3fe71cb83 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/2020.js @@ -0,0 +1,55 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv2020 = void 0; +const core_1 = require("./core"); +const draft2020_1 = require("./vocabularies/draft2020"); +const discriminator_1 = require("./vocabularies/discriminator"); +const json_schema_2020_12_1 = require("./refs/json-schema-2020-12"); +const META_SCHEMA_ID = "https://json-schema.org/draft/2020-12/schema"; +class Ajv2020 extends core_1.default { + constructor(opts = {}) { + super({ + ...opts, + dynamicRef: true, + next: true, + unevaluated: true, + }); + } + _addVocabularies() { + super._addVocabularies(); + draft2020_1.default.forEach((v) => this.addVocabulary(v)); + if (this.opts.discriminator) + this.addKeyword(discriminator_1.default); + } + _addDefaultMetaSchema() { + super._addDefaultMetaSchema(); + const { $data, meta } = this.opts; + if (!meta) + return; + json_schema_2020_12_1.default.call(this, $data); + this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID; + } + defaultMeta() { + return (this.opts.defaultMeta = + super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined)); + } +} +exports.Ajv2020 = Ajv2020; +module.exports = exports = Ajv2020; +module.exports.Ajv2020 = Ajv2020; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = Ajv2020; +var validate_1 = require("./compile/validate"); +Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function () { return validate_1.KeywordCxt; } }); +var codegen_1 = require("./compile/codegen"); +Object.defineProperty(exports, "_", { enumerable: true, get: function () { return codegen_1._; } }); +Object.defineProperty(exports, "str", { enumerable: true, get: function () { return codegen_1.str; } }); +Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return codegen_1.stringify; } }); +Object.defineProperty(exports, "nil", { enumerable: true, get: function () { return codegen_1.nil; } }); +Object.defineProperty(exports, "Name", { enumerable: true, get: function () { return codegen_1.Name; } }); +Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function () { return codegen_1.CodeGen; } }); +var validation_error_1 = require("./runtime/validation_error"); +Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return validation_error_1.default; } }); +var ref_error_1 = require("./compile/ref_error"); +Object.defineProperty(exports, "MissingRefError", { enumerable: true, get: function () { return ref_error_1.default; } }); +//# sourceMappingURL=2020.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/2020.js.map b/front_end/third_party/mcp-sdk/ajv/dist/2020.js.map new file mode 100644 index 0000000000..2f4fda81e2 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/2020.js.map @@ -0,0 +1 @@ +{"version":3,"file":"2020.js","sourceRoot":"","sources":["../lib/2020.ts"],"names":[],"mappings":";;;AACA,iCAAuC;AAEvC,wDAA4D;AAC5D,gEAAwD;AACxD,oEAA0D;AAE1D,MAAM,cAAc,GAAG,8CAA8C,CAAA;AAErE,MAAa,OAAQ,SAAQ,cAAO;IAClC,YAAY,OAAgB,EAAE;QAC5B,KAAK,CAAC;YACJ,GAAG,IAAI;YACP,UAAU,EAAE,IAAI;YAChB,IAAI,EAAE,IAAI;YACV,WAAW,EAAE,IAAI;SAClB,CAAC,CAAA;IACJ,CAAC;IAED,gBAAgB;QACd,KAAK,CAAC,gBAAgB,EAAE,CAAA;QACxB,mBAAqB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,C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diff --git a/front_end/third_party/mcp-sdk/ajv/dist/ajv.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/ajv.d.ts new file mode 100644 index 0000000000..fce3b03b86 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/ajv.d.ts @@ -0,0 +1,18 @@ +import type { AnySchemaObject } from "./types"; +import AjvCore from "./core"; +export declare class Ajv extends AjvCore { + _addVocabularies(): void; + _addDefaultMetaSchema(): void; + defaultMeta(): string | AnySchemaObject | undefined; +} +export default Ajv; +export { Format, FormatDefinition, AsyncFormatDefinition, KeywordDefinition, KeywordErrorDefinition, CodeKeywordDefinition, MacroKeywordDefinition, FuncKeywordDefinition, Vocabulary, Schema, SchemaObject, AnySchemaObject, AsyncSchema, AnySchema, ValidateFunction, AsyncValidateFunction, SchemaValidateFunction, ErrorObject, ErrorNoParams, } from "./types"; +export { Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions } from "./core"; +export { SchemaCxt, SchemaObjCxt } from "./compile"; +export { KeywordCxt } from "./compile/validate"; +export { DefinedError } from "./vocabularies/errors"; +export { JSONType } from "./compile/rules"; +export { JSONSchemaType } from "./types/json-schema"; +export { _, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions } from "./compile/codegen"; +export { default as ValidationError } from "./runtime/validation_error"; +export { default as MissingRefError } from "./compile/ref_error"; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/ajv.js b/front_end/third_party/mcp-sdk/ajv/dist/ajv.js new file mode 100644 index 0000000000..8eecf1bea7 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/ajv.js @@ -0,0 +1,50 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv = void 0; +const core_1 = require("./core"); +const draft7_1 = require("./vocabularies/draft7"); +const discriminator_1 = require("./vocabularies/discriminator"); +const draft7MetaSchema = require("./refs/json-schema-draft-07.json"); +const META_SUPPORT_DATA = ["/properties"]; +const META_SCHEMA_ID = "http://json-schema.org/draft-07/schema"; +class Ajv extends core_1.default { + _addVocabularies() { + super._addVocabularies(); + draft7_1.default.forEach((v) => this.addVocabulary(v)); + if (this.opts.discriminator) + this.addKeyword(discriminator_1.default); + } + _addDefaultMetaSchema() { + super._addDefaultMetaSchema(); + if (!this.opts.meta) + return; + const metaSchema = this.opts.$data + ? this.$dataMetaSchema(draft7MetaSchema, META_SUPPORT_DATA) + : draft7MetaSchema; + this.addMetaSchema(metaSchema, META_SCHEMA_ID, false); + this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID; + } + defaultMeta() { + return (this.opts.defaultMeta = + super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined)); + } +} +exports.Ajv = Ajv; +module.exports = exports = Ajv; +module.exports.Ajv = Ajv; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = Ajv; +var validate_1 = require("./compile/validate"); +Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function () { return validate_1.KeywordCxt; } }); +var codegen_1 = require("./compile/codegen"); +Object.defineProperty(exports, "_", { enumerable: true, get: function () { return codegen_1._; } }); +Object.defineProperty(exports, "str", { enumerable: true, get: function () { return codegen_1.str; } }); +Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return codegen_1.stringify; } }); +Object.defineProperty(exports, "nil", { enumerable: true, get: function () { return codegen_1.nil; } }); +Object.defineProperty(exports, "Name", { enumerable: true, get: function () { return codegen_1.Name; } }); +Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function () { return codegen_1.CodeGen; } }); +var validation_error_1 = require("./runtime/validation_error"); +Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return validation_error_1.default; } }); +var ref_error_1 = require("./compile/ref_error"); +Object.defineProperty(exports, "MissingRefError", { enumerable: true, get: function () { return ref_error_1.default; } }); +//# sourceMappingURL=ajv.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/ajv.js.map b/front_end/third_party/mcp-sdk/ajv/dist/ajv.js.map new file mode 100644 index 0000000000..42c3edf1af --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/ajv.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ajv.js","sourceRoot":"","sources":["../lib/ajv.ts"],"names":[],"mappings":";;;AACA,iCAA4B;AAC5B,kDAAsD;AACtD,gEAAwD;AACxD,qEAAoE;AAEpE,MAAM,iBAAiB,GAAG,CAAC,aAAa,CAAC,CAAA;AAEzC,MAAM,cAAc,GAAG,wCAAwC,CAAA;AAE/D,MAAa,GAAI,SAAQ,cAAO;IAC9B,gBAAgB;QACd,KAAK,CAAC,gBAAgB,EAAE,CAAA;QACxB,gBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAA;QACxD,IAAI,IAAI,CAAC,IAAI,CAAC,aAAa;YAAE,IAAI,CAAC,UAAU,CAAC,uBAAa,CAAC,CAAA;IAC7D,CAAC;IAED,qBAAqB;QACnB,KAAK,CAAC,qBAAqB,EAAE,CAAA;QAC7B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;YAAE,OAAM;QAC3B,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK;YAChC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,gBAAgB,EAAE,iBAAiB,CAAC;YAC3D,CAAC,CAAC,gBAAgB,CAAA;QACpB,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,cAAc,EAAE,KAAK,CAAC,CAAA;QACrD,IAAI,CAAC,IAAI,CAAC,+BAA+B,CAAC,GAAG,cAAc,CAAA;IAC7D,CAAC;IAED,WAAW;QACT,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW;YAC3B,KAAK,CAAC,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAA;IACzF,CAAC;CACF;AArBD,kBAqBC;AAED,MAAM,CAAC,OAAO,GAAG,OAAO,GAAG,GAAG,CAAA;AAC9B,MAAM,CAAC,OAAO,CAAC,GAAG,GAAG,GAAG,CAAA;AACxB,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC,CAAA;AAE3D,kBAAe,GAAG,CAAA;AA0BlB,+CAA6C;AAArC,sGAAA,UAAU,OAAA;AAIlB,6CAA6F;AAArF,4FAAA,CAAC,OAAA;AAAE,8FAAA,GAAG,OAAA;AAAE,oGAAA,SAAS,OAAA;AAAE,8FAAA,GAAG,OAAA;AAAE,+FAAA,IAAI,OAAA;AAAQ,kGAAA,OAAO,OAAA;AACnD,+DAAqE;AAA7D,mHAAA,OAAO,OAAmB;AAClC,iDAA8D;AAAtD,4GAAA,OAAO,OAAmB"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/cli.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/cli.d.ts new file mode 100644 index 0000000000..d9ae1944cf --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/cli.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=cli.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/cli.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/cli.d.ts.map new file mode 100644 index 0000000000..9984dd72bf --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/cli.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/cli.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/cli.js new file mode 100644 index 0000000000..c7cd55cb58 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/cli.js @@ -0,0 +1,131 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const ws_1 = __importDefault(require("ws")); +// eslint-disable-next-line @typescript-eslint/no-explicit-any +global.WebSocket = ws_1.default; +const express_1 = __importDefault(require("express")); +const index_js_1 = require("./client/index.js"); +const sse_js_1 = require("./client/sse.js"); +const stdio_js_1 = require("./client/stdio.js"); +const websocket_js_1 = require("./client/websocket.js"); +const index_js_2 = require("./server/index.js"); +const sse_js_2 = require("./server/sse.js"); +const stdio_js_2 = require("./server/stdio.js"); +const types_js_1 = require("./types.js"); +async function runClient(url_or_command, args) { + const client = new index_js_1.Client({ + name: "mcp-typescript test client", + version: "0.1.0", + }, { + capabilities: { + sampling: {}, + }, + }); + let clientTransport; + let url = undefined; + try { + url = new URL(url_or_command); + } + catch (_a) { + // Ignore + } + if ((url === null || url === void 0 ? void 0 : url.protocol) === "http:" || (url === null || url === void 0 ? void 0 : url.protocol) === "https:") { + clientTransport = new sse_js_1.SSEClientTransport(new URL(url_or_command)); + } + else if ((url === null || url === void 0 ? void 0 : url.protocol) === "ws:" || (url === null || url === void 0 ? void 0 : url.protocol) === "wss:") { + clientTransport = new websocket_js_1.WebSocketClientTransport(new URL(url_or_command)); + } + else { + clientTransport = new stdio_js_1.StdioClientTransport({ + command: url_or_command, + args, + }); + } + console.log("Connected to server."); + await client.connect(clientTransport); + console.log("Initialized."); + await client.request({ method: "resources/list" }, types_js_1.ListResourcesResultSchema); + await client.close(); + console.log("Closed."); +} +async function runServer(port) { + if (port !== null) { + const app = (0, express_1.default)(); + let servers = []; + app.get("/sse", async (req, res) => { + console.log("Got new SSE connection"); + const transport = new sse_js_2.SSEServerTransport("/message", res); + const server = new index_js_2.Server({ + name: "mcp-typescript test server", + version: "0.1.0", + }, { + capabilities: {}, + }); + servers.push(server); + server.onclose = () => { + console.log("SSE connection closed"); + servers = servers.filter((s) => s !== server); + }; + await server.connect(transport); + }); + app.post("/message", async (req, res) => { + console.log("Received message"); + const sessionId = req.query.sessionId; + const transport = servers + .map((s) => s.transport) + .find((t) => t.sessionId === sessionId); + if (!transport) { + res.status(404).send("Session not found"); + return; + } + await transport.handlePostMessage(req, res); + }); + app.listen(port, () => { + console.log(`Server running on http://localhost:${port}/sse`); + }); + } + else { + const server = new index_js_2.Server({ + name: "mcp-typescript test server", + version: "0.1.0", + }, { + capabilities: { + prompts: {}, + resources: {}, + tools: {}, + logging: {}, + }, + }); + const transport = new stdio_js_2.StdioServerTransport(); + await server.connect(transport); + console.log("Server running on stdio"); + } +} +const args = process.argv.slice(2); +const command = args[0]; +switch (command) { + case "client": + if (args.length < 2) { + console.error("Usage: client [args...]"); + process.exit(1); + } + runClient(args[1], args.slice(2)).catch((error) => { + console.error(error); + process.exit(1); + }); + break; + case "server": { + const port = args[1] ? parseInt(args[1]) : null; + runServer(port).catch((error) => { + console.error(error); + process.exit(1); + }); + break; + } + default: + console.error("Unrecognized command:", command); +} +//# sourceMappingURL=cli.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/cli.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/cli.js.map new file mode 100644 index 0000000000..b59c481f0c --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/cli.js.map @@ -0,0 +1 @@ +{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":";;;;;AAAA,4CAA2B;AAE3B,8DAA8D;AAC7D,MAAc,CAAC,SAAS,GAAG,YAAS,CAAC;AAEtC,sDAA8B;AAC9B,gDAA2C;AAC3C,4CAAqD;AACrD,gDAAyD;AACzD,wDAAiE;AACjE,gDAA2C;AAC3C,4CAAqD;AACrD,gDAAyD;AACzD,yCAAuD;AAE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,KAAK,CAAC,iDAAiD,CAAC,CAAC;YACjE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QAED,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YAChD,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;QAEH,MAAM;IAER,KAAK,QAAQ,CAAC,CAAC,CAAC;QACd,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAChD,SAAS,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YAC9B,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;QAEH,MAAM;IACR,CAAC;IAED;QACE,OAAO,CAAC,KAAK,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;AACpD,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/auth.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/auth.d.ts new file mode 100644 index 0000000000..ae1199056b --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/auth.d.ts @@ -0,0 +1,139 @@ +import type { OAuthClientMetadata, OAuthClientInformation, OAuthTokens, OAuthMetadata, OAuthClientInformationFull, OAuthProtectedResourceMetadata } from "../shared/auth.js"; +/** + * Implements an end-to-end OAuth client to be used with one MCP server. + * + * This client relies upon a concept of an authorized "session," the exact + * meaning of which is application-defined. Tokens, authorization codes, and + * code verifiers should not cross different sessions. + */ +export interface OAuthClientProvider { + /** + * The URL to redirect the user agent to after authorization. + */ + get redirectUrl(): string | URL; + /** + * Metadata about this OAuth client. + */ + get clientMetadata(): OAuthClientMetadata; + /** + * Returns a OAuth2 state parameter. + */ + state?(): string | Promise; + /** + * Loads information about this OAuth client, as registered already with the + * server, or returns `undefined` if the client is not registered with the + * server. + */ + clientInformation(): OAuthClientInformation | undefined | Promise; + /** + * If implemented, this permits the OAuth client to dynamically register with + * the server. Client information saved this way should later be read via + * `clientInformation()`. + * + * This method is not required to be implemented if client information is + * statically known (e.g., pre-registered). + */ + saveClientInformation?(clientInformation: OAuthClientInformationFull): void | Promise; + /** + * Loads any existing OAuth tokens for the current session, or returns + * `undefined` if there are no saved tokens. + */ + tokens(): OAuthTokens | undefined | Promise; + /** + * Stores new OAuth tokens for the current session, after a successful + * authorization. + */ + saveTokens(tokens: OAuthTokens): void | Promise; + /** + * Invoked to redirect the user agent to the given URL to begin the authorization flow. + */ + redirectToAuthorization(authorizationUrl: URL): void | Promise; + /** + * Saves a PKCE code verifier for the current session, before redirecting to + * the authorization flow. + */ + saveCodeVerifier(codeVerifier: string): void | Promise; + /** + * Loads the PKCE code verifier for the current session, necessary to validate + * the authorization result. + */ + codeVerifier(): string | Promise; +} +export type AuthResult = "AUTHORIZED" | "REDIRECT"; +export declare class UnauthorizedError extends Error { + constructor(message?: string); +} +/** + * Orchestrates the full auth flow with a server. + * + * This can be used as a single entry point for all authorization functionality, + * instead of linking together the other lower-level functions in this module. + */ +export declare function auth(provider: OAuthClientProvider, { serverUrl, authorizationCode, scope, resourceMetadataUrl }: { + serverUrl: string | URL; + authorizationCode?: string; + scope?: string; + resourceMetadataUrl?: URL; +}): Promise; +/** + * Extract resource_metadata from response header. + */ +export declare function extractResourceMetadataUrl(res: Response): URL | undefined; +/** + * Looks up RFC 9728 OAuth 2.0 Protected Resource Metadata. + * + * If the server returns a 404 for the well-known endpoint, this function will + * return `undefined`. Any other errors will be thrown as exceptions. + */ +export declare function discoverOAuthProtectedResourceMetadata(serverUrl: string | URL, opts?: { + protocolVersion?: string; + resourceMetadataUrl?: string | URL; +}): Promise; +/** + * Looks up RFC 8414 OAuth 2.0 Authorization Server Metadata. + * + * If the server returns a 404 for the well-known endpoint, this function will + * return `undefined`. Any other errors will be thrown as exceptions. + */ +export declare function discoverOAuthMetadata(authorizationServerUrl: string | URL, opts?: { + protocolVersion?: string; +}): Promise; +/** + * Begins the authorization flow with the given server, by generating a PKCE challenge and constructing the authorization URL. + */ +export declare function startAuthorization(authorizationServerUrl: string | URL, { metadata, clientInformation, redirectUrl, scope, state, }: { + metadata?: OAuthMetadata; + clientInformation: OAuthClientInformation; + redirectUrl: string | URL; + scope?: string; + state?: string; +}): Promise<{ + authorizationUrl: URL; + codeVerifier: string; +}>; +/** + * Exchanges an authorization code for an access token with the given server. + */ +export declare function exchangeAuthorization(authorizationServerUrl: string | URL, { metadata, clientInformation, authorizationCode, codeVerifier, redirectUri, }: { + metadata?: OAuthMetadata; + clientInformation: OAuthClientInformation; + authorizationCode: string; + codeVerifier: string; + redirectUri: string | URL; +}): Promise; +/** + * Exchange a refresh token for an updated access token. + */ +export declare function refreshAuthorization(authorizationServerUrl: string | URL, { metadata, clientInformation, refreshToken, }: { + metadata?: OAuthMetadata; + clientInformation: OAuthClientInformation; + refreshToken: string; +}): Promise; +/** + * Performs OAuth 2.0 Dynamic Client Registration according to RFC 7591. + */ +export declare function registerClient(authorizationServerUrl: string | URL, { metadata, clientMetadata, }: { + metadata?: OAuthMetadata; + clientMetadata: OAuthClientMetadata; +}): Promise; +//# sourceMappingURL=auth.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/auth.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/auth.d.ts.map new file mode 100644 index 0000000000..96f9fd8289 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/auth.d.ts.map @@ -0,0 +1 @@ +{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;IAAE,gBAAgB,EAAE,GAAG,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC,CAiD1D;AAED;;GAEG;AACH,wBAAsB,qBAAqB,CACzC,sBAAsB,EAAE,MAAM,GAAG,GAAG,EACpC,EACE,QAAQ,EACR,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,WAAW,GACZ,EAAE;IACD,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,iBAAiB,EAAE,sBAAsB,CAAC;IAC1C,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,GAAG,GAAG,CAAC;CAC3B,GACA,OAAO,CAAC,WAAW,CAAC,CA6CtB;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,sBAAsB,EAAE,MAAM,GAAG,GAAG,EACpC,EACE,QAAQ,EACR,iBAAiB,EACjB,YAAY,GACb,EAAE;IACD,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,iBAAiB,EAAE,sBAAsB,CAAC;IAC1C,YAAY,EAAE,MAAM,CAAC;CACtB,GACA,OAAO,CAAC,WAAW,CAAC,CA0CtB;AAED;;GAEG;AACH,wBAAsB,cAAc,CAClC,sBAAsB,EAAE,MAAM,GAAG,GAAG,EACpC,EACE,QAAQ,EACR,cAAc,GACf,EAAE;IACD,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,cAAc,EAAE,mBAAmB,CAAC;CACrC,GACA,OAAO,CAAC,0BAA0B,CAAC,CA0BrC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/auth.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/auth.js new file mode 100644 index 0000000000..f288546402 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/auth.js @@ -0,0 +1,340 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UnauthorizedError = void 0; +exports.auth = auth; +exports.extractResourceMetadataUrl = extractResourceMetadataUrl; +exports.discoverOAuthProtectedResourceMetadata = discoverOAuthProtectedResourceMetadata; +exports.discoverOAuthMetadata = discoverOAuthMetadata; +exports.startAuthorization = startAuthorization; +exports.exchangeAuthorization = exchangeAuthorization; +exports.refreshAuthorization = refreshAuthorization; +exports.registerClient = registerClient; +const pkce_challenge_1 = __importDefault(require("pkce-challenge")); +const types_js_1 = require("../types.js"); +const auth_js_1 = require("../shared/auth.js"); +class UnauthorizedError extends Error { + constructor(message) { + super(message !== null && message !== void 0 ? message : "Unauthorized"); + } +} +exports.UnauthorizedError = UnauthorizedError; +/** + * Orchestrates the full auth flow with a server. + * + * This can be used as a single entry point for all authorization functionality, + * instead of linking together the other lower-level functions in this module. + */ +async function auth(provider, { serverUrl, authorizationCode, scope, resourceMetadataUrl }) { + let authorizationServerUrl = serverUrl; + try { + const resourceMetadata = await discoverOAuthProtectedResourceMetadata(resourceMetadataUrl || serverUrl); + if (resourceMetadata.authorization_servers && resourceMetadata.authorization_servers.length > 0) { + authorizationServerUrl = resourceMetadata.authorization_servers[0]; + } + } + catch (error) { + console.warn("Could not load OAuth Protected Resource metadata, falling back to /.well-known/oauth-authorization-server", error); + } + const metadata = await discoverOAuthMetadata(authorizationServerUrl); + // Handle client registration if needed + let clientInformation = await Promise.resolve(provider.clientInformation()); + if (!clientInformation) { + if (authorizationCode !== undefined) { + throw new Error("Existing OAuth client information is required when exchanging an authorization code"); + } + if (!provider.saveClientInformation) { + throw new Error("OAuth client information must be saveable for dynamic registration"); + } + const fullInformation = await registerClient(authorizationServerUrl, { + metadata, + clientMetadata: provider.clientMetadata, + }); + await provider.saveClientInformation(fullInformation); + clientInformation = fullInformation; + } + // Exchange authorization code for tokens + if (authorizationCode !== undefined) { + const codeVerifier = await provider.codeVerifier(); + const tokens = await exchangeAuthorization(authorizationServerUrl, { + metadata, + clientInformation, + authorizationCode, + codeVerifier, + redirectUri: provider.redirectUrl, + }); + await provider.saveTokens(tokens); + return "AUTHORIZED"; + } + const tokens = await provider.tokens(); + // Handle token refresh or new authorization + if (tokens === null || tokens === void 0 ? void 0 : tokens.refresh_token) { + try { + // Attempt to refresh the token + const newTokens = await refreshAuthorization(authorizationServerUrl, { + metadata, + clientInformation, + refreshToken: tokens.refresh_token, + }); + await provider.saveTokens(newTokens); + return "AUTHORIZED"; + } + catch (error) { + console.error("Could not refresh OAuth tokens:", error); + } + } + const state = provider.state ? await provider.state() : undefined; + // Start new authorization flow + const { authorizationUrl, codeVerifier } = await startAuthorization(authorizationServerUrl, { + metadata, + clientInformation, + state, + redirectUrl: provider.redirectUrl, + scope: scope || provider.clientMetadata.scope, + }); + await provider.saveCodeVerifier(codeVerifier); + await provider.redirectToAuthorization(authorizationUrl); + return "REDIRECT"; +} +/** + * Extract resource_metadata from response header. + */ +function extractResourceMetadataUrl(res) { + const authenticateHeader = res.headers.get("WWW-Authenticate"); + if (!authenticateHeader) { + return undefined; + } + const [type, scheme] = authenticateHeader.split(' '); + if (type.toLowerCase() !== 'bearer' || !scheme) { + console.log("Invalid WWW-Authenticate header format, expected 'Bearer'"); + return undefined; + } + const regex = /resource_metadata="([^"]*)"/; + const match = regex.exec(authenticateHeader); + if (!match) { + return undefined; + } + try { + return new URL(match[1]); + } + catch (_a) { + console.log("Invalid resource metadata url: ", match[1]); + return undefined; + } +} +/** + * Looks up RFC 9728 OAuth 2.0 Protected Resource Metadata. + * + * If the server returns a 404 for the well-known endpoint, this function will + * return `undefined`. Any other errors will be thrown as exceptions. + */ +async function discoverOAuthProtectedResourceMetadata(serverUrl, opts) { + var _a; + let url; + if (opts === null || opts === void 0 ? void 0 : opts.resourceMetadataUrl) { + url = new URL(opts === null || opts === void 0 ? void 0 : opts.resourceMetadataUrl); + } + else { + url = new URL("/.well-known/oauth-protected-resource", serverUrl); + } + let response; + try { + response = await fetch(url, { + headers: { + "MCP-Protocol-Version": (_a = opts === null || opts === void 0 ? void 0 : opts.protocolVersion) !== null && _a !== void 0 ? _a : types_js_1.LATEST_PROTOCOL_VERSION + } + }); + } + catch (error) { + // CORS errors come back as TypeError + if (error instanceof TypeError) { + response = await fetch(url); + } + else { + throw error; + } + } + if (response.status === 404) { + throw new Error(`Resource server does not implement OAuth 2.0 Protected Resource Metadata.`); + } + if (!response.ok) { + throw new Error(`HTTP ${response.status} trying to load well-known OAuth protected resource metadata.`); + } + return auth_js_1.OAuthProtectedResourceMetadataSchema.parse(await response.json()); +} +/** + * Looks up RFC 8414 OAuth 2.0 Authorization Server Metadata. + * + * If the server returns a 404 for the well-known endpoint, this function will + * return `undefined`. Any other errors will be thrown as exceptions. + */ +async function discoverOAuthMetadata(authorizationServerUrl, opts) { + var _a; + const url = new URL("/.well-known/oauth-authorization-server", authorizationServerUrl); + let response; + try { + response = await fetch(url, { + headers: { + "MCP-Protocol-Version": (_a = opts === null || opts === void 0 ? void 0 : opts.protocolVersion) !== null && _a !== void 0 ? _a : types_js_1.LATEST_PROTOCOL_VERSION + } + }); + } + catch (error) { + // CORS errors come back as TypeError + if (error instanceof TypeError) { + response = await fetch(url); + } + else { + throw error; + } + } + if (response.status === 404) { + return undefined; + } + if (!response.ok) { + throw new Error(`HTTP ${response.status} trying to load well-known OAuth metadata`); + } + return auth_js_1.OAuthMetadataSchema.parse(await response.json()); +} +/** + * Begins the authorization flow with the given server, by generating a PKCE challenge and constructing the authorization URL. + */ +async function startAuthorization(authorizationServerUrl, { metadata, clientInformation, redirectUrl, scope, state, }) { + const responseType = "code"; + const codeChallengeMethod = "S256"; + let authorizationUrl; + if (metadata) { + authorizationUrl = new URL(metadata.authorization_endpoint); + if (!metadata.response_types_supported.includes(responseType)) { + throw new Error(`Incompatible auth server: does not support response type ${responseType}`); + } + if (!metadata.code_challenge_methods_supported || + !metadata.code_challenge_methods_supported.includes(codeChallengeMethod)) { + throw new Error(`Incompatible auth server: does not support code challenge method ${codeChallengeMethod}`); + } + } + else { + authorizationUrl = new URL("/authorize", authorizationServerUrl); + } + // Generate PKCE challenge + const challenge = await (0, pkce_challenge_1.default)(); + const codeVerifier = challenge.code_verifier; + const codeChallenge = challenge.code_challenge; + authorizationUrl.searchParams.set("response_type", responseType); + authorizationUrl.searchParams.set("client_id", clientInformation.client_id); + authorizationUrl.searchParams.set("code_challenge", codeChallenge); + authorizationUrl.searchParams.set("code_challenge_method", codeChallengeMethod); + authorizationUrl.searchParams.set("redirect_uri", String(redirectUrl)); + if (state) { + authorizationUrl.searchParams.set("state", state); + } + if (scope) { + authorizationUrl.searchParams.set("scope", scope); + } + return { authorizationUrl, codeVerifier }; +} +/** + * Exchanges an authorization code for an access token with the given server. + */ +async function exchangeAuthorization(authorizationServerUrl, { metadata, clientInformation, authorizationCode, codeVerifier, redirectUri, }) { + const grantType = "authorization_code"; + let tokenUrl; + if (metadata) { + tokenUrl = new URL(metadata.token_endpoint); + if (metadata.grant_types_supported && + !metadata.grant_types_supported.includes(grantType)) { + throw new Error(`Incompatible auth server: does not support grant type ${grantType}`); + } + } + else { + tokenUrl = new URL("/token", authorizationServerUrl); + } + // Exchange code for tokens + const params = new URLSearchParams({ + grant_type: grantType, + client_id: clientInformation.client_id, + code: authorizationCode, + code_verifier: codeVerifier, + redirect_uri: String(redirectUri), + }); + if (clientInformation.client_secret) { + params.set("client_secret", clientInformation.client_secret); + } + const response = await fetch(tokenUrl, { + method: "POST", + headers: { + "Content-Type": "application/x-www-form-urlencoded", + }, + body: params, + }); + if (!response.ok) { + throw new Error(`Token exchange failed: HTTP ${response.status}`); + } + return auth_js_1.OAuthTokensSchema.parse(await response.json()); +} +/** + * Exchange a refresh token for an updated access token. + */ +async function refreshAuthorization(authorizationServerUrl, { metadata, clientInformation, refreshToken, }) { + const grantType = "refresh_token"; + let tokenUrl; + if (metadata) { + tokenUrl = new URL(metadata.token_endpoint); + if (metadata.grant_types_supported && + !metadata.grant_types_supported.includes(grantType)) { + throw new Error(`Incompatible auth server: does not support grant type ${grantType}`); + } + } + else { + tokenUrl = new URL("/token", authorizationServerUrl); + } + // Exchange refresh token + const params = new URLSearchParams({ + grant_type: grantType, + client_id: clientInformation.client_id, + refresh_token: refreshToken, + }); + if (clientInformation.client_secret) { + params.set("client_secret", clientInformation.client_secret); + } + const response = await fetch(tokenUrl, { + method: "POST", + headers: { + "Content-Type": "application/x-www-form-urlencoded", + }, + body: params, + }); + if (!response.ok) { + throw new Error(`Token refresh failed: HTTP ${response.status}`); + } + return auth_js_1.OAuthTokensSchema.parse({ refresh_token: refreshToken, ...(await response.json()) }); +} +/** + * Performs OAuth 2.0 Dynamic Client Registration according to RFC 7591. + */ +async function registerClient(authorizationServerUrl, { metadata, clientMetadata, }) { + let registrationUrl; + if (metadata) { + if (!metadata.registration_endpoint) { + throw new Error("Incompatible auth server: does not support dynamic client registration"); + } + registrationUrl = new URL(metadata.registration_endpoint); + } + else { + registrationUrl = new URL("/register", authorizationServerUrl); + } + const response = await fetch(registrationUrl, { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(clientMetadata), + }); + if (!response.ok) { + throw new Error(`Dynamic client registration failed: HTTP ${response.status}`); + } + return auth_js_1.OAuthClientInformationFullSchema.parse(await response.json()); +} +//# sourceMappingURL=auth.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/auth.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/auth.js.map new file mode 100644 index 0000000000..0ef9603859 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/auth.js.map @@ -0,0 +1 @@ +{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/client/auth.ts"],"names":[],"mappings":";;;;;;AAyFA,oBA8FC;AAKD,gEAyBC;AAQD,wFAsCC;AAQD,sDAgCC;AAKD,gDAgEC;AAKD,sDA4DC;AAKD,oDAqDC;AAKD,wCAmCC;AAnhBD,oEAA2C;AAC3C,0CAAsD;AAEtD,+CAAmJ;AA0EnJ,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Q,CAAC,MAAM,EAAE,CAAC,CAAC;IACnE,CAAC;IAED,OAAO,2BAAiB,CAAC,KAAK,CAAC,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;AAC9F,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,cAAc,CAClC,sBAAoC,EACpC,EACE,QAAQ,EACR,cAAc,GAIf;IAED,IAAI,eAAoB,CAAC;IAEzB,IAAI,QAAQ,EAAE,CAAC;QACb,IAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE,CAAC;YACpC,MAAM,IAAI,KAAK,CAAC,wEAAwE,CAAC,CAAC;QAC5F,CAAC;QAED,eAAe,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAC;IAC5D,CAAC;SAAM,CAAC;QACN,eAAe,GAAG,IAAI,GAAG,CAAC,WAAW,EAAE,sBAAsB,CAAC,CAAC;IACjE,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,eAAe,EAAE;QAC5C,MAAM,EAAE,MAAM;QACd,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;SACnC;QACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC;KACrC,CAAC,CAAC;IAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,4CAA4C,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IACjF,CAAC;IAED,OAAO,0CAAgC,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;AACvE,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/index.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/index.d.ts new file mode 100644 index 0000000000..3b42a6c0c9 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/index.d.ts @@ -0,0 +1,942 @@ +import { Protocol, ProtocolOptions, RequestOptions } from "../shared/protocol.js"; +import { Transport } from "../shared/transport.js"; +import { CallToolRequest, CallToolResultSchema, ClientCapabilities, ClientNotification, ClientRequest, ClientResult, CompatibilityCallToolResultSchema, CompleteRequest, GetPromptRequest, Implementation, ListPromptsRequest, ListResourcesRequest, ListResourceTemplatesRequest, ListToolsRequest, LoggingLevel, Notification, ReadResourceRequest, Request, Result, ServerCapabilities, SubscribeRequest, UnsubscribeRequest } from "../types.js"; +export type ClientOptions = ProtocolOptions & { + /** + * Capabilities to advertise as being supported by this client. + */ + capabilities?: ClientCapabilities; +}; +/** + * An MCP client on top of a pluggable transport. + * + * The client will automatically begin the initialization flow with the server when connect() is called. + * + * To use with custom types, extend the base Request/Notification/Result types and pass them as type parameters: + * + * ```typescript + * // Custom schemas + * const CustomRequestSchema = RequestSchema.extend({...}) + * const CustomNotificationSchema = NotificationSchema.extend({...}) + * const CustomResultSchema = ResultSchema.extend({...}) + * + * // Type aliases + * type CustomRequest = z.infer + * type CustomNotification = z.infer + * type CustomResult = z.infer + * + * // Create typed client + * const client = new Client({ + * name: "CustomClient", + * version: "1.0.0" + * }) + * ``` + */ +export declare class Client extends Protocol { + private _clientInfo; + private _serverCapabilities?; + private _serverVersion?; + private _capabilities; + private _instructions?; + private _cachedToolOutputValidators; + private _ajv; + /** + * Initializes this client with the given name and version information. + */ + constructor(_clientInfo: Implementation, options?: ClientOptions); + /** + * Registers new capabilities. This can only be called before connecting to a transport. + * + * The new capabilities will be merged with any existing capabilities previously given (e.g., at initialization). + */ + registerCapabilities(capabilities: ClientCapabilities): void; + protected assertCapability(capability: keyof ServerCapabilities, method: string): void; + connect(transport: Transport, options?: RequestOptions): Promise; + /** + * After initialization has completed, this will be populated with the server's reported capabilities. + */ + getServerCapabilities(): ServerCapabilities | undefined; + /** + * After initialization has completed, this will be populated with information about the server's name and version. + */ + getServerVersion(): Implementation | undefined; + /** + * After initialization has completed, this may be populated with information about the server's instructions. + */ + getInstructions(): string | undefined; + protected assertCapabilityForMethod(method: RequestT["method"]): void; + protected assertNotificationCapability(method: NotificationT["method"]): void; + protected assertRequestHandlerCapability(method: string): void; + ping(options?: RequestOptions): Promise<{ + _meta?: import("zod").objectOutputType<{}, import("zod").ZodTypeAny, "passthrough"> | undefined; + }>; + complete(params: CompleteRequest["params"], options?: RequestOptions): Promise, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + completion: import("zod").ZodObject<{ + values: import("zod").ZodArray; + total: import("zod").ZodOptional; + hasMore: import("zod").ZodOptional; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + values: import("zod").ZodArray; + total: import("zod").ZodOptional; + hasMore: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + values: import("zod").ZodArray; + total: import("zod").ZodOptional; + hasMore: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">>; + }>, import("zod").ZodTypeAny, "passthrough">>; + setLoggingLevel(level: LoggingLevel, options?: RequestOptions): Promise<{ + _meta?: import("zod").objectOutputType<{}, import("zod").ZodTypeAny, "passthrough"> | undefined; + }>; + getPrompt(params: GetPromptRequest["params"], options?: RequestOptions): Promise, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + description: import("zod").ZodOptional; + messages: import("zod").ZodArray; + content: import("zod").ZodUnion<[import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"audio">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"audio">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"audio">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, import("zod").ZodTypeAny, "passthrough">>]>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + role: import("zod").ZodEnum<["user", "assistant"]>; + content: import("zod").ZodUnion<[import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"audio">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"audio">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"audio">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, import("zod").ZodTypeAny, "passthrough">>]>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + role: import("zod").ZodEnum<["user", "assistant"]>; + content: import("zod").ZodUnion<[import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"audio">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"audio">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"audio">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, import("zod").ZodTypeAny, "passthrough">>]>; + }, import("zod").ZodTypeAny, "passthrough">>, "many">; + }>, import("zod").ZodTypeAny, "passthrough">>; + listPrompts(params?: ListPromptsRequest["params"], options?: RequestOptions): Promise, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + nextCursor: import("zod").ZodOptional; + }>, { + prompts: import("zod").ZodArray; + arguments: import("zod").ZodOptional; + required: import("zod").ZodOptional; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + name: import("zod").ZodString; + description: import("zod").ZodOptional; + required: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + name: import("zod").ZodString; + description: import("zod").ZodOptional; + required: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">>, "many">>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + name: import("zod").ZodString; + description: import("zod").ZodOptional; + arguments: import("zod").ZodOptional; + required: import("zod").ZodOptional; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + name: import("zod").ZodString; + description: import("zod").ZodOptional; + required: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + name: import("zod").ZodString; + description: import("zod").ZodOptional; + required: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">>, "many">>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + name: import("zod").ZodString; + description: import("zod").ZodOptional; + arguments: import("zod").ZodOptional; + required: import("zod").ZodOptional; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + name: import("zod").ZodString; + description: import("zod").ZodOptional; + required: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + name: import("zod").ZodString; + description: import("zod").ZodOptional; + required: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">>, "many">>; + }, import("zod").ZodTypeAny, "passthrough">>, "many">; + }>, import("zod").ZodTypeAny, "passthrough">>; + listResources(params?: ListResourcesRequest["params"], options?: RequestOptions): Promise, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + nextCursor: import("zod").ZodOptional; + }>, { + resources: import("zod").ZodArray; + mimeType: import("zod").ZodOptional; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + uri: import("zod").ZodString; + name: import("zod").ZodString; + description: import("zod").ZodOptional; + mimeType: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + uri: import("zod").ZodString; + name: import("zod").ZodString; + description: import("zod").ZodOptional; + mimeType: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">>, "many">; + }>, import("zod").ZodTypeAny, "passthrough">>; + listResourceTemplates(params?: ListResourceTemplatesRequest["params"], options?: RequestOptions): Promise, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + nextCursor: import("zod").ZodOptional; + }>, { + resourceTemplates: import("zod").ZodArray; + mimeType: import("zod").ZodOptional; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + uriTemplate: import("zod").ZodString; + name: import("zod").ZodString; + description: import("zod").ZodOptional; + mimeType: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + uriTemplate: import("zod").ZodString; + name: import("zod").ZodString; + description: import("zod").ZodOptional; + mimeType: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">>, "many">; + }>, import("zod").ZodTypeAny, "passthrough">>; + readResource(params: ReadResourceRequest["params"], options?: RequestOptions): Promise, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + contents: import("zod").ZodArray; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>, "many">; + }>, import("zod").ZodTypeAny, "passthrough">>; + subscribeResource(params: SubscribeRequest["params"], options?: RequestOptions): Promise<{ + _meta?: import("zod").objectOutputType<{}, import("zod").ZodTypeAny, "passthrough"> | undefined; + }>; + unsubscribeResource(params: UnsubscribeRequest["params"], options?: RequestOptions): Promise<{ + _meta?: import("zod").objectOutputType<{}, import("zod").ZodTypeAny, "passthrough"> | undefined; + }>; + callTool(params: CallToolRequest["params"], resultSchema?: typeof CallToolResultSchema | typeof CompatibilityCallToolResultSchema, options?: RequestOptions): Promise, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + content: import("zod").ZodDefault; + text: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"audio">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"audio">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"audio">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, import("zod").ZodTypeAny, "passthrough">>]>, "many">>; + structuredContent: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + isError: import("zod").ZodOptional; + }>, import("zod").ZodTypeAny, "passthrough"> | import("zod").objectOutputType, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + toolResult: import("zod").ZodUnknown; + }>, import("zod").ZodTypeAny, "passthrough">>; + private cacheToolOutputSchemas; + private getToolOutputValidator; + listTools(params?: ListToolsRequest["params"], options?: RequestOptions): Promise, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + nextCursor: import("zod").ZodOptional; + }>, { + tools: import("zod").ZodArray; + inputSchema: import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + required: import("zod").ZodOptional>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + required: import("zod").ZodOptional>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + required: import("zod").ZodOptional>; + }, import("zod").ZodTypeAny, "passthrough">>; + outputSchema: import("zod").ZodOptional; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + required: import("zod").ZodOptional>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + required: import("zod").ZodOptional>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + required: import("zod").ZodOptional>; + }, import("zod").ZodTypeAny, "passthrough">>>; + annotations: import("zod").ZodOptional; + readOnlyHint: import("zod").ZodOptional; + destructiveHint: import("zod").ZodOptional; + idempotentHint: import("zod").ZodOptional; + openWorldHint: import("zod").ZodOptional; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + title: import("zod").ZodOptional; + readOnlyHint: import("zod").ZodOptional; + destructiveHint: import("zod").ZodOptional; + idempotentHint: import("zod").ZodOptional; + openWorldHint: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + title: import("zod").ZodOptional; + readOnlyHint: import("zod").ZodOptional; + destructiveHint: import("zod").ZodOptional; + idempotentHint: import("zod").ZodOptional; + openWorldHint: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">>>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + name: import("zod").ZodString; + description: import("zod").ZodOptional; + inputSchema: import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + required: import("zod").ZodOptional>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + required: import("zod").ZodOptional>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + required: import("zod").ZodOptional>; + }, import("zod").ZodTypeAny, "passthrough">>; + outputSchema: import("zod").ZodOptional; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + required: import("zod").ZodOptional>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + required: import("zod").ZodOptional>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + required: import("zod").ZodOptional>; + }, import("zod").ZodTypeAny, "passthrough">>>; + annotations: import("zod").ZodOptional; + readOnlyHint: import("zod").ZodOptional; + destructiveHint: import("zod").ZodOptional; + idempotentHint: import("zod").ZodOptional; + openWorldHint: import("zod").ZodOptional; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + title: import("zod").ZodOptional; + readOnlyHint: import("zod").ZodOptional; + destructiveHint: import("zod").ZodOptional; + idempotentHint: import("zod").ZodOptional; + openWorldHint: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + title: import("zod").ZodOptional; + readOnlyHint: import("zod").ZodOptional; + destructiveHint: import("zod").ZodOptional; + idempotentHint: import("zod").ZodOptional; + openWorldHint: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">>>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + name: import("zod").ZodString; + description: import("zod").ZodOptional; + inputSchema: import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + required: import("zod").ZodOptional>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + required: import("zod").ZodOptional>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + required: import("zod").ZodOptional>; + }, import("zod").ZodTypeAny, "passthrough">>; + outputSchema: import("zod").ZodOptional; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + required: import("zod").ZodOptional>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + required: import("zod").ZodOptional>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + required: import("zod").ZodOptional>; + }, import("zod").ZodTypeAny, "passthrough">>>; + annotations: import("zod").ZodOptional; + readOnlyHint: import("zod").ZodOptional; + destructiveHint: import("zod").ZodOptional; + idempotentHint: import("zod").ZodOptional; + openWorldHint: import("zod").ZodOptional; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + title: import("zod").ZodOptional; + readOnlyHint: import("zod").ZodOptional; + destructiveHint: import("zod").ZodOptional; + idempotentHint: import("zod").ZodOptional; + openWorldHint: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + title: import("zod").ZodOptional; + readOnlyHint: import("zod").ZodOptional; + destructiveHint: import("zod").ZodOptional; + idempotentHint: import("zod").ZodOptional; + openWorldHint: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">>>; + }, import("zod").ZodTypeAny, "passthrough">>, "many">; + }>, import("zod").ZodTypeAny, "passthrough">>; + sendRootsListChanged(): Promise; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/index.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/index.d.ts.map new file mode 100644 index 0000000000..256a1bdeef --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../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AAC,sBAAsB;IAIxB,SAAS,CACb,MAAM,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,EACnC,OAAO,CAAC,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAcpB,oBAAoB;CAG3B"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/index.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/index.js new file mode 100644 index 0000000000..92725861c2 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/index.js @@ -0,0 +1,286 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Client = void 0; +const protocol_js_1 = require("../shared/protocol.js"); +const types_js_1 = require("../types.js"); +const ajv_1 = __importDefault(require("ajv")); +/** + * An MCP client on top of a pluggable transport. + * + * The client will automatically begin the initialization flow with the server when connect() is called. + * + * To use with custom types, extend the base Request/Notification/Result types and pass them as type parameters: + * + * ```typescript + * // Custom schemas + * const CustomRequestSchema = RequestSchema.extend({...}) + * const CustomNotificationSchema = NotificationSchema.extend({...}) + * const CustomResultSchema = ResultSchema.extend({...}) + * + * // Type aliases + * type CustomRequest = z.infer + * type CustomNotification = z.infer + * type CustomResult = z.infer + * + * // Create typed client + * const client = new Client({ + * name: "CustomClient", + * version: "1.0.0" + * }) + * ``` + */ +class Client extends protocol_js_1.Protocol { + /** + * Initializes this client with the given name and version information. + */ + constructor(_clientInfo, options) { + var _a; + super(options); + this._clientInfo = _clientInfo; + this._cachedToolOutputValidators = new Map(); + this._capabilities = (_a = options === null || options === void 0 ? void 0 : options.capabilities) !== null && _a !== void 0 ? _a : {}; + this._ajv = new ajv_1.default(); + } + /** + * Registers new capabilities. This can only be called before connecting to a transport. + * + * The new capabilities will be merged with any existing capabilities previously given (e.g., at initialization). + */ + registerCapabilities(capabilities) { + if (this.transport) { + throw new Error("Cannot register capabilities after connecting to transport"); + } + this._capabilities = (0, protocol_js_1.mergeCapabilities)(this._capabilities, capabilities); + } + assertCapability(capability, method) { + var _a; + if (!((_a = this._serverCapabilities) === null || _a === void 0 ? void 0 : _a[capability])) { + throw new Error(`Server does not support ${capability} (required for ${method})`); + } + } + async connect(transport, options) { + await super.connect(transport); + // When transport sessionId is already set this means we are trying to reconnect. + // In this case we don't need to initialize again. + if (transport.sessionId !== undefined) { + return; + } + try { + const result = await this.request({ + method: "initialize", + params: { + protocolVersion: types_js_1.LATEST_PROTOCOL_VERSION, + capabilities: this._capabilities, + clientInfo: this._clientInfo, + }, + }, types_js_1.InitializeResultSchema, options); + if (result === undefined) { + throw new Error(`Server sent invalid initialize result: ${result}`); + } + if (!types_js_1.SUPPORTED_PROTOCOL_VERSIONS.includes(result.protocolVersion)) { + throw new Error(`Server's protocol version is not supported: ${result.protocolVersion}`); + } + this._serverCapabilities = result.capabilities; + this._serverVersion = result.serverInfo; + this._instructions = result.instructions; + await this.notification({ + method: "notifications/initialized", + }); + } + catch (error) { + // Disconnect if initialization fails. + void this.close(); + throw error; + } + } + /** + * After initialization has completed, this will be populated with the server's reported capabilities. + */ + getServerCapabilities() { + return this._serverCapabilities; + } + /** + * After initialization has completed, this will be populated with information about the server's name and version. + */ + getServerVersion() { + return this._serverVersion; + } + /** + * After initialization has completed, this may be populated with information about the server's instructions. + */ + getInstructions() { + return this._instructions; + } + assertCapabilityForMethod(method) { + var _a, _b, _c, _d, _e; + switch (method) { + case "logging/setLevel": + if (!((_a = this._serverCapabilities) === null || _a === void 0 ? void 0 : _a.logging)) { + throw new Error(`Server does not support logging (required for ${method})`); + } + break; + case "prompts/get": + case "prompts/list": + if (!((_b = this._serverCapabilities) === null || _b === void 0 ? void 0 : _b.prompts)) { + throw new Error(`Server does not support prompts (required for ${method})`); + } + break; + case "resources/list": + case "resources/templates/list": + case "resources/read": + case "resources/subscribe": + case "resources/unsubscribe": + if (!((_c = this._serverCapabilities) === null || _c === void 0 ? void 0 : _c.resources)) { + throw new Error(`Server does not support resources (required for ${method})`); + } + if (method === "resources/subscribe" && + !this._serverCapabilities.resources.subscribe) { + throw new Error(`Server does not support resource subscriptions (required for ${method})`); + } + break; + case "tools/call": + case "tools/list": + if (!((_d = this._serverCapabilities) === null || _d === void 0 ? void 0 : _d.tools)) { + throw new Error(`Server does not support tools (required for ${method})`); + } + break; + case "completion/complete": + if (!((_e = this._serverCapabilities) === null || _e === void 0 ? void 0 : _e.completions)) { + throw new Error(`Server does not support completions (required for ${method})`); + } + break; + case "initialize": + // No specific capability required for initialize + break; + case "ping": + // No specific capability required for ping + break; + } + } + assertNotificationCapability(method) { + var _a; + switch (method) { + case "notifications/roots/list_changed": + if (!((_a = this._capabilities.roots) === null || _a === void 0 ? void 0 : _a.listChanged)) { + throw new Error(`Client does not support roots list changed notifications (required for ${method})`); + } + break; + case "notifications/initialized": + // No specific capability required for initialized + break; + case "notifications/cancelled": + // Cancellation notifications are always allowed + break; + case "notifications/progress": + // Progress notifications are always allowed + break; + } + } + assertRequestHandlerCapability(method) { + switch (method) { + case "sampling/createMessage": + if (!this._capabilities.sampling) { + throw new Error(`Client does not support sampling capability (required for ${method})`); + } + break; + case "roots/list": + if (!this._capabilities.roots) { + throw new Error(`Client does not support roots capability (required for ${method})`); + } + break; + case "ping": + // No specific capability required for ping + break; + } + } + async ping(options) { + return this.request({ method: "ping" }, types_js_1.EmptyResultSchema, options); + } + async complete(params, options) { + return this.request({ method: "completion/complete", params }, types_js_1.CompleteResultSchema, options); + } + async setLoggingLevel(level, options) { + return this.request({ method: "logging/setLevel", params: { level } }, types_js_1.EmptyResultSchema, options); + } + async getPrompt(params, options) { + return this.request({ method: "prompts/get", params }, types_js_1.GetPromptResultSchema, options); + } + async listPrompts(params, options) { + return this.request({ method: "prompts/list", params }, types_js_1.ListPromptsResultSchema, options); + } + async listResources(params, options) { + return this.request({ method: "resources/list", params }, types_js_1.ListResourcesResultSchema, options); + } + async listResourceTemplates(params, options) { + return this.request({ method: "resources/templates/list", params }, types_js_1.ListResourceTemplatesResultSchema, options); + } + async readResource(params, options) { + return this.request({ method: "resources/read", params }, types_js_1.ReadResourceResultSchema, options); + } + async subscribeResource(params, options) { + return this.request({ method: "resources/subscribe", params }, types_js_1.EmptyResultSchema, options); + } + async unsubscribeResource(params, options) { + return this.request({ method: "resources/unsubscribe", params }, types_js_1.EmptyResultSchema, options); + } + async callTool(params, resultSchema = types_js_1.CallToolResultSchema, options) { + const result = await this.request({ method: "tools/call", params }, resultSchema, options); + // Check if the tool has an outputSchema + const validator = this.getToolOutputValidator(params.name); + if (validator) { + // If tool has outputSchema, it MUST return structuredContent (unless it's an error) + if (!result.structuredContent && !result.isError) { + throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidRequest, `Tool ${params.name} has an output schema but did not return structured content`); + } + // Only validate structured content if present (not when there's an error) + if (result.structuredContent) { + try { + // Validate the structured content (which is already an object) against the schema + const isValid = validator(result.structuredContent); + if (!isValid) { + throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Structured content does not match the tool's output schema: ${this._ajv.errorsText(validator.errors)}`); + } + } + catch (error) { + if (error instanceof types_js_1.McpError) { + throw error; + } + throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Failed to validate structured content: ${error instanceof Error ? error.message : String(error)}`); + } + } + } + return result; + } + cacheToolOutputSchemas(tools) { + this._cachedToolOutputValidators.clear(); + for (const tool of tools) { + // If the tool has an outputSchema, create and cache the Ajv validator + if (tool.outputSchema) { + try { + const validator = this._ajv.compile(tool.outputSchema); + this._cachedToolOutputValidators.set(tool.name, validator); + } + catch (error) { + console.warn(`Failed to compile output schema for tool ${tool.name}: ${error}`); + } + } + } + } + getToolOutputValidator(toolName) { + return this._cachedToolOutputValidators.get(toolName); + } + async listTools(params, options) { + const result = await this.request({ method: "tools/list", params }, types_js_1.ListToolsResultSchema, options); + // Cache the tools and their output schemas for future validation + this.cacheToolOutputSchemas(result.tools); + return result; + } + async sendRootsListChanged() { + return this.notification({ method: "notifications/roots/list_changed" }); + } +} +exports.Client = Client; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/index.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/index.js.map new file mode 100644 index 0000000000..45f1ce4d79 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":";;;;;;AAAA,uDAK+B;AAE/B,0CAqCqB;AACrB,8CAAsB;AAUtB;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAa,MAIX,SAAQ,sBAIT;IAQC;;OAEG;IACH,YACU,WAA2B,EACnC,OAAuB;;QAEvB,KAAK,CAAC,OAAO,CAAC,CAAC;QAHP,gBAAW,GAAX,WAAW,CAAgB;QAP7B,gCAA2B,GAAkC,IAAI,GAAG,EAAE,CAAC;QAW7E,IAAI,CAAC,aAAa,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,YAAY,mCAAI,EAAE,CAAC;QACjD,IAAI,CAAC,IAAI,GAAG,IAAI,aAAG,EAAE,CAAC;IACxB,CAAC;IAED;;;;OAIG;IACI,oBAAoB,CAAC,YAAgC;QAC1D,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CACb,4DAA4D,CAC7D,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,aAAa,GAAG,IAAA,+BAAiB,EAAC,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;IAC3E,CAAC;IAES,gBAAgB,CACxB,UAAoC,EACpC,MAAc;;Q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OAAO,KAAK,EAAE,CAAC;oBACf,OAAO,CAAC,IAAI,CAAC,4CAA4C,IAAI,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC,CAAC;gBAClF,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAEO,sBAAsB,CAAC,QAAgB;QAC7C,OAAO,IAAI,CAAC,2BAA2B,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACxD,CAAC;IAED,KAAK,CAAC,SAAS,CACb,MAAmC,EACnC,OAAwB;QAExB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAC/B,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,EAChC,gCAAqB,EACrB,OAAO,CACR,CAAC;QAEF,iEAAiE;QACjE,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAE1C,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,KAAK,CAAC,oBAAoB;QACxB,OAAO,IAAI,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,kCAAkC,EAAE,CAAC,CAAC;IAC3E,CAAC;CACF;AA1aD,wBA0aC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/sse.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/sse.d.ts new file mode 100644 index 0000000000..49e882a682 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/sse.d.ts @@ -0,0 +1,71 @@ +import { type ErrorEvent, type EventSourceInit } from "eventsource"; +import { Transport } from "../shared/transport.js"; +import { JSONRPCMessage } from "../types.js"; +import { OAuthClientProvider } from "./auth.js"; +export declare class SseError extends Error { + readonly code: number | undefined; + readonly event: ErrorEvent; + constructor(code: number | undefined, message: string | undefined, event: ErrorEvent); +} +/** + * Configuration options for the `SSEClientTransport`. + */ +export type SSEClientTransportOptions = { + /** + * An OAuth client provider to use for authentication. + * + * When an `authProvider` is specified and the SSE connection is started: + * 1. The connection is attempted with any existing access token from the `authProvider`. + * 2. If the access token has expired, the `authProvider` is used to refresh the token. + * 3. If token refresh fails or no access token exists, and auth is required, `OAuthClientProvider.redirectToAuthorization` is called, and an `UnauthorizedError` will be thrown from `connect`/`start`. + * + * After the user has finished authorizing via their user agent, and is redirected back to the MCP client application, call `SSEClientTransport.finishAuth` with the authorization code before retrying the connection. + * + * If an `authProvider` is not provided, and auth is required, an `UnauthorizedError` will be thrown. + * + * `UnauthorizedError` might also be thrown when sending any message over the SSE transport, indicating that the session has expired, and needs to be re-authed and reconnected. + */ + authProvider?: OAuthClientProvider; + /** + * Customizes the initial SSE request to the server (the request that begins the stream). + * + * NOTE: Setting this property will prevent an `Authorization` header from + * being automatically attached to the SSE request, if an `authProvider` is + * also given. This can be worked around by setting the `Authorization` header + * manually. + */ + eventSourceInit?: EventSourceInit; + /** + * Customizes recurring POST requests to the server. + */ + requestInit?: RequestInit; +}; +/** + * Client transport for SSE: this will connect to a server using Server-Sent Events for receiving + * messages and make separate POST requests for sending messages. + */ +export declare class SSEClientTransport implements Transport { + private _eventSource?; + private _endpoint?; + private _abortController?; + private _url; + private _resourceMetadataUrl?; + private _eventSourceInit?; + private _requestInit?; + private _authProvider?; + onclose?: () => void; + onerror?: (error: Error) => void; + onmessage?: (message: JSONRPCMessage) => void; + constructor(url: URL, opts?: SSEClientTransportOptions); + private _authThenStart; + private _commonHeaders; + private _startOrAuth; + start(): Promise; + /** + * Call this method after the user has finished authorizing via their user agent and is redirected back to the MCP client application. This will exchange the authorization code for an access token, enabling the next connection attempt to successfully auth. + */ + finishAuth(authorizationCode: string): Promise; + close(): Promise; + send(message: JSONRPCMessage): Promise; +} +//# sourceMappingURL=sse.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/sse.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/sse.d.ts.map new file mode 100644 index 0000000000..644bc6bb13 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/c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OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;gBAG5C,GAAG,EAAE,GAAG,EACR,IAAI,CAAC,EAAE,yBAAyB;YASpB,cAAc;YAoBd,cAAc;IAY5B,OAAO,CAAC,YAAY;IAmEd,KAAK;IAUX;;OAEG;IACG,UAAU,CAAC,iBAAiB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAWpD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAMtB,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CA0CnD"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/sse.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/sse.js new file mode 100644 index 0000000000..a00278045e --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/sse.js @@ -0,0 +1,176 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SSEClientTransport = exports.SseError = void 0; +const eventsource_1 = require("eventsource"); +const types_js_1 = require("../types.js"); +const auth_js_1 = require("./auth.js"); +class SseError extends Error { + constructor(code, message, event) { + super(`SSE error: ${message}`); + this.code = code; + this.event = event; + } +} +exports.SseError = SseError; +/** + * Client transport for SSE: this will connect to a server using Server-Sent Events for receiving + * messages and make separate POST requests for sending messages. + */ +class SSEClientTransport { + constructor(url, opts) { + this._url = url; + this._resourceMetadataUrl = undefined; + this._eventSourceInit = opts === null || opts === void 0 ? void 0 : opts.eventSourceInit; + this._requestInit = opts === null || opts === void 0 ? void 0 : opts.requestInit; + this._authProvider = opts === null || opts === void 0 ? void 0 : opts.authProvider; + } + async _authThenStart() { + var _a; + if (!this._authProvider) { + throw new auth_js_1.UnauthorizedError("No auth provider"); + } + let result; + try { + result = await (0, auth_js_1.auth)(this._authProvider, { serverUrl: this._url, resourceMetadataUrl: this._resourceMetadataUrl }); + } + catch (error) { + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + throw error; + } + if (result !== "AUTHORIZED") { + throw new auth_js_1.UnauthorizedError(); + } + return await this._startOrAuth(); + } + async _commonHeaders() { + var _a; + const headers = { ...(_a = this._requestInit) === null || _a === void 0 ? void 0 : _a.headers }; + if (this._authProvider) { + const tokens = await this._authProvider.tokens(); + if (tokens) { + headers["Authorization"] = `Bearer ${tokens.access_token}`; + } + } + return headers; + } + _startOrAuth() { + return new Promise((resolve, reject) => { + var _a; + this._eventSource = new eventsource_1.EventSource(this._url.href, (_a = this._eventSourceInit) !== null && _a !== void 0 ? _a : { + fetch: (url, init) => this._commonHeaders().then((headers) => fetch(url, { + ...init, + headers: { + ...headers, + Accept: "text/event-stream" + } + })), + }); + this._abortController = new AbortController(); + this._eventSource.onerror = (event) => { + var _a; + if (event.code === 401 && this._authProvider) { + this._authThenStart().then(resolve, reject); + return; + } + const error = new SseError(event.code, event.message, event); + reject(error); + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + }; + this._eventSource.onopen = () => { + // The connection is open, but we need to wait for the endpoint to be received. + }; + this._eventSource.addEventListener("endpoint", (event) => { + var _a; + const messageEvent = event; + try { + this._endpoint = new URL(messageEvent.data, this._url); + if (this._endpoint.origin !== this._url.origin) { + throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`); + } + } + catch (error) { + reject(error); + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + void this.close(); + return; + } + resolve(); + }); + this._eventSource.onmessage = (event) => { + var _a, _b; + const messageEvent = event; + let message; + try { + message = types_js_1.JSONRPCMessageSchema.parse(JSON.parse(messageEvent.data)); + } + catch (error) { + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + return; + } + (_b = this.onmessage) === null || _b === void 0 ? void 0 : _b.call(this, message); + }; + }); + } + async start() { + if (this._eventSource) { + throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically."); + } + return await this._startOrAuth(); + } + /** + * Call this method after the user has finished authorizing via their user agent and is redirected back to the MCP client application. This will exchange the authorization code for an access token, enabling the next connection attempt to successfully auth. + */ + async finishAuth(authorizationCode) { + if (!this._authProvider) { + throw new auth_js_1.UnauthorizedError("No auth provider"); + } + const result = await (0, auth_js_1.auth)(this._authProvider, { serverUrl: this._url, authorizationCode, resourceMetadataUrl: this._resourceMetadataUrl }); + if (result !== "AUTHORIZED") { + throw new auth_js_1.UnauthorizedError("Failed to authorize"); + } + } + async close() { + var _a, _b, _c; + (_a = this._abortController) === null || _a === void 0 ? void 0 : _a.abort(); + (_b = this._eventSource) === null || _b === void 0 ? void 0 : _b.close(); + (_c = this.onclose) === null || _c === void 0 ? void 0 : _c.call(this); + } + async send(message) { + var _a, _b, _c; + if (!this._endpoint) { + throw new Error("Not connected"); + } + try { + const commonHeaders = await this._commonHeaders(); + const headers = new Headers({ ...commonHeaders, ...(_a = this._requestInit) === null || _a === void 0 ? void 0 : _a.headers }); + headers.set("content-type", "application/json"); + const init = { + ...this._requestInit, + method: "POST", + headers, + body: JSON.stringify(message), + signal: (_b = this._abortController) === null || _b === void 0 ? void 0 : _b.signal, + }; + const response = await fetch(this._endpoint, init); + if (!response.ok) { + if (response.status === 401 && this._authProvider) { + this._resourceMetadataUrl = (0, auth_js_1.extractResourceMetadataUrl)(response); + const result = await (0, auth_js_1.auth)(this._authProvider, { serverUrl: this._url, resourceMetadataUrl: this._resourceMetadataUrl }); + if (result !== "AUTHORIZED") { + throw new auth_js_1.UnauthorizedError(); + } + // Purposely _not_ awaited, so we don't call onerror twice + return this.send(message); + } + const text = await response.text().catch(() => null); + throw new Error(`Error POSTing to endpoint (HTTP ${response.status}): ${text}`); + } + } + catch (error) { + (_c = this.onerror) === null || _c === void 0 ? void 0 : _c.call(this, error); + throw error; + } + } +} +exports.SSEClientTransport = SSEClientTransport; +//# sourceMappingURL=sse.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/sse.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/sse.js.map new file mode 100644 index 0000000000..218372b4fc --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/sse.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sse.js","sourceRoot":"","sources":["../../../src/client/sse.ts"],"names":[],"mappings":";;;AAAA,6CAAiF;AAEjF,0CAAmE;AACnE,uCAAiH;AAEjH,MAAa,QAAS,SAAQ,KAAK;IACjC,YACkB,IAAwB,EACxC,OAA2B,EACX,KAAiB;QAEjC,KAAK,CAAC,cAAc,OAAO,EAAE,CAAC,CAAC;QAJf,SAAI,GAAJ,IAAI,CAAoB;QAExB,UAAK,GAAL,KAAK,CAAY;IAGnC,CAAC;CACF;AARD,4BAQC;AAsCD;;;GAGG;AACH,MAAa,kBAAkB;IAc7B,YACE,GAAQ,EACR,IAAgC;QAEhC,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QAChB,IAAI,CAAC,oBAAoB,GAAG,SAAS,CAAC;QACtC,IAAI,CAAC,gBAAgB,GAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,eAAe,CAAC;QAC9C,IAAI,CAAC,YAAY,GAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,WAAW,CAAC;QACtC,IAAI,CAAC,aAAa,GAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,YAAY,CAAC;IAC1C,CAAC;IAEO,KAAK,CAAC,cAAc;;QAC1B,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;YACxB,MAAM,IAAI,2BAAiB,CAAC,kBAAkB,CAAC,CAAC;QAClD,CAAC;QAED,IAAI,MAAkB,CAAC;QACvB,IAAI,CAAC;YACH,MAAM,GAAG,MAAM,IAAA,cAAI,EAAC,IAAI,CAAC,aAAa,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,IAAI,EAAE,mBAAmB,EAAE,IAAI,CAAC,oBAAoB,EAAE,CAAC,CAAC;QACpH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;Y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AC;oBAChC,CAAC;oBAED,0DAA0D;oBAC1D,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBAC5B,CAAC;gBAED,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;gBACrD,MAAM,IAAI,KAAK,CACb,mCAAmC,QAAQ,CAAC,MAAM,MAAM,IAAI,EAAE,CAC/D,CAAC;YACJ,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAA,IAAI,CAAC,OAAO,qDAAG,KAAc,CAAC,CAAC;YAC/B,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF;AApMD,gDAoMC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/stdio.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/stdio.d.ts new file mode 100644 index 0000000000..9db03502ad --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/stdio.d.ts @@ -0,0 +1,72 @@ +import { IOType } from "node:child_process"; +import { Stream } from "node:stream"; +import { Transport } from "../shared/transport.js"; +import { JSONRPCMessage } from "../types.js"; +export type StdioServerParameters = { + /** + * The executable to run to start the server. + */ + command: string; + /** + * Command line arguments to pass to the executable. + */ + args?: string[]; + /** + * The environment to use when spawning the process. + * + * If not specified, the result of getDefaultEnvironment() will be used. + */ + env?: Record; + /** + * How to handle stderr of the child process. This matches the semantics of Node's `child_process.spawn`. + * + * The default is "inherit", meaning messages to stderr will be printed to the parent process's stderr. + */ + stderr?: IOType | Stream | number; + /** + * The working directory to use when spawning the process. + * + * If not specified, the current working directory will be inherited. + */ + cwd?: string; +}; +/** + * Environment variables to inherit by default, if an environment is not explicitly given. + */ +export declare const DEFAULT_INHERITED_ENV_VARS: string[]; +/** + * Returns a default environment object including only environment variables deemed safe to inherit. + */ +export declare function getDefaultEnvironment(): Record; +/** + * Client transport for stdio: this will connect to a server by spawning a process and communicating with it over stdin/stdout. + * + * This transport is only available in Node.js environments. + */ +export declare class StdioClientTransport implements Transport { + private _process?; + private _abortController; + private _readBuffer; + private _serverParams; + private _stderrStream; + onclose?: () => void; + onerror?: (error: Error) => void; + onmessage?: (message: JSONRPCMessage) => void; + constructor(server: StdioServerParameters); + /** + * Starts the server process and prepares to communicate with it. + */ + start(): Promise; + /** + * The stderr stream of the child process, if `StdioServerParameters.stderr` was set to "pipe" or "overlapped". + * + * If stderr piping was requested, a PassThrough stream is returned _immediately_, allowing callers to + * attach listeners before the start method is invoked. This prevents loss of any early + * error output emitted by the child process. + */ + get stderr(): Stream | null; + private processReadBuffer; + close(): Promise; + send(message: JSONRPCMessage): Promise; +} +//# sourceMappingURL=stdio.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/stdio.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/stdio.d.ts.map new file mode 100644 index 0000000000..4d01323e0b --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/stdio.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"stdio.d.ts","sourceRoot":"","sources":["../../../src/client/stdio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG1D,OAAO,EAAE,MAAM,EAAe,MAAM,aAAa,CAAC;AAElD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAEhB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE7B;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IAElC;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,UAgBmB,CAAC;AAE3D;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAkB9D;AAED;;;;GAIG;AACH,qBAAa,oBAAqB,YAAW,SAAS;IACpD,OAAO,CAAC,QAAQ,CAAC,CAAe;IAChC,OAAO,CAAC,gBAAgB,CAA0C;IAClE,OAAO,CAAC,WAAW,CAAgC;IACnD,OAAO,CAAC,aAAa,CAAwB;IAC7C,OAAO,CAAC,aAAa,CAA4B;IAEjD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;gBAElC,MAAM,EAAE,qBAAqB;IAOzC;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IA4D5B;;;;;;OAMG;IACH,IAAI,MAAM,IAAI,MAAM,GAAG,IAAI,CAM1B;IAED,OAAO,CAAC,iBAAiB;IAenB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAM5B,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAc7C"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/stdio.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/stdio.js new file mode 100644 index 0000000000..c4038a9a2d --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/stdio.js @@ -0,0 +1,170 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.StdioClientTransport = exports.DEFAULT_INHERITED_ENV_VARS = void 0; +exports.getDefaultEnvironment = getDefaultEnvironment; +const cross_spawn_1 = __importDefault(require("cross-spawn")); +const node_process_1 = __importDefault(require("node:process")); +const node_stream_1 = require("node:stream"); +const stdio_js_1 = require("../shared/stdio.js"); +/** + * Environment variables to inherit by default, if an environment is not explicitly given. + */ +exports.DEFAULT_INHERITED_ENV_VARS = node_process_1.default.platform === "win32" + ? [ + "APPDATA", + "HOMEDRIVE", + "HOMEPATH", + "LOCALAPPDATA", + "PATH", + "PROCESSOR_ARCHITECTURE", + "SYSTEMDRIVE", + "SYSTEMROOT", + "TEMP", + "USERNAME", + "USERPROFILE", + ] + : /* list inspired by the default env inheritance of sudo */ + ["HOME", "LOGNAME", "PATH", "SHELL", "TERM", "USER"]; +/** + * Returns a default environment object including only environment variables deemed safe to inherit. + */ +function getDefaultEnvironment() { + const env = {}; + for (const key of exports.DEFAULT_INHERITED_ENV_VARS) { + const value = node_process_1.default.env[key]; + if (value === undefined) { + continue; + } + if (value.startsWith("()")) { + // Skip functions, which are a security risk. + continue; + } + env[key] = value; + } + return env; +} +/** + * Client transport for stdio: this will connect to a server by spawning a process and communicating with it over stdin/stdout. + * + * This transport is only available in Node.js environments. + */ +class StdioClientTransport { + constructor(server) { + this._abortController = new AbortController(); + this._readBuffer = new stdio_js_1.ReadBuffer(); + this._stderrStream = null; + this._serverParams = server; + if (server.stderr === "pipe" || server.stderr === "overlapped") { + this._stderrStream = new node_stream_1.PassThrough(); + } + } + /** + * Starts the server process and prepares to communicate with it. + */ + async start() { + if (this._process) { + throw new Error("StdioClientTransport already started! If using Client class, note that connect() calls start() automatically."); + } + return new Promise((resolve, reject) => { + var _a, _b, _c, _d, _e, _f; + this._process = (0, cross_spawn_1.default)(this._serverParams.command, (_a = this._serverParams.args) !== null && _a !== void 0 ? _a : [], { + env: (_b = this._serverParams.env) !== null && _b !== void 0 ? _b : getDefaultEnvironment(), + stdio: ["pipe", "pipe", (_c = this._serverParams.stderr) !== null && _c !== void 0 ? _c : "inherit"], + shell: false, + signal: this._abortController.signal, + windowsHide: node_process_1.default.platform === "win32" && isElectron(), + cwd: this._serverParams.cwd, + }); + this._process.on("error", (error) => { + var _a, _b; + if (error.name === "AbortError") { + // Expected when close() is called. + (_a = this.onclose) === null || _a === void 0 ? void 0 : _a.call(this); + return; + } + reject(error); + (_b = this.onerror) === null || _b === void 0 ? void 0 : _b.call(this, error); + }); + this._process.on("spawn", () => { + resolve(); + }); + this._process.on("close", (_code) => { + var _a; + this._process = undefined; + (_a = this.onclose) === null || _a === void 0 ? void 0 : _a.call(this); + }); + (_d = this._process.stdin) === null || _d === void 0 ? void 0 : _d.on("error", (error) => { + var _a; + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + }); + (_e = this._process.stdout) === null || _e === void 0 ? void 0 : _e.on("data", (chunk) => { + this._readBuffer.append(chunk); + this.processReadBuffer(); + }); + (_f = this._process.stdout) === null || _f === void 0 ? void 0 : _f.on("error", (error) => { + var _a; + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + }); + if (this._stderrStream && this._process.stderr) { + this._process.stderr.pipe(this._stderrStream); + } + }); + } + /** + * The stderr stream of the child process, if `StdioServerParameters.stderr` was set to "pipe" or "overlapped". + * + * If stderr piping was requested, a PassThrough stream is returned _immediately_, allowing callers to + * attach listeners before the start method is invoked. This prevents loss of any early + * error output emitted by the child process. + */ + get stderr() { + var _a, _b; + if (this._stderrStream) { + return this._stderrStream; + } + return (_b = (_a = this._process) === null || _a === void 0 ? void 0 : _a.stderr) !== null && _b !== void 0 ? _b : null; + } + processReadBuffer() { + var _a, _b; + while (true) { + try { + const message = this._readBuffer.readMessage(); + if (message === null) { + break; + } + (_a = this.onmessage) === null || _a === void 0 ? void 0 : _a.call(this, message); + } + catch (error) { + (_b = this.onerror) === null || _b === void 0 ? void 0 : _b.call(this, error); + } + } + } + async close() { + this._abortController.abort(); + this._process = undefined; + this._readBuffer.clear(); + } + send(message) { + return new Promise((resolve) => { + var _a; + if (!((_a = this._process) === null || _a === void 0 ? void 0 : _a.stdin)) { + throw new Error("Not connected"); + } + const json = (0, stdio_js_1.serializeMessage)(message); + if (this._process.stdin.write(json)) { + resolve(); + } + else { + this._process.stdin.once("drain", resolve); + } + }); + } +} +exports.StdioClientTransport = StdioClientTransport; +function isElectron() { + return "type" in node_process_1.default; +} +//# sourceMappingURL=stdio.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/stdio.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/stdio.js.map new file mode 100644 index 0000000000..263efeaaef --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/stdio.js.map @@ -0,0 +1 @@ +{"version":3,"file":"stdio.js","sourceRoot":"","sources":["../../../src/client/stdio.ts"],"names":[],"mappings":";;;;;;AAiEA,sDAkBC;AAlFD,8DAAgC;AAChC,gEAAmC;AACnC,6CAAkD;AAClD,iDAAkE;AAqClE;;GAEG;AACU,QAAA,0BAA0B,GACrC,sBAAO,CAAC,QAAQ,KAAK,OAAO;IAC1B,CAAC,CAAC;QACE,SAAS;QACT,WAAW;QACX,UAAU;QACV,cAAc;QACd,MAAM;QACN,wBAAwB;QACxB,aAAa;QACb,YAAY;QACZ,MAAM;QACN,UAAU;QACV,aAAa;KACd;IACH,CAAC,CAAC,0DAA0D;QAC1D,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAE3D;;GAEG;AACH,SAAgB,qBAAqB;IACnC,MAAM,GAAG,GAA2B,EAAE,CAAC;IAEvC,KAAK,MAAM,GAAG,IAAI,kCAA0B,EAAE,CAAC;QAC7C,MAAM,KAAK,GAAG,sBAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC/B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,SAAS;QACX,CAAC;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,KAAK,CAAA,EAAE,CAAC;gBAC1B,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;YACnC,CAAC;YAED,MAAM,IAAI,GAAG,IAAA,2BAAgB,EAAC,OAAO,CAAC,CAAC;YACvC,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;gBACpC,OAAO,EAAE,CAAC;YACZ,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAC7C,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAnID,oDAmIC;AAED,SAAS,UAAU;IACjB,OAAO,MAAM,IAAI,sBAAO,CAAC;AAC3B,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/streamableHttp.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/streamableHttp.d.ts new file mode 100644 index 0000000000..e3e8697f2d --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/streamableHttp.d.ts @@ -0,0 +1,125 @@ +import { Transport } from "../shared/transport.js"; +import { JSONRPCMessage } from "../types.js"; +import { OAuthClientProvider } from "./auth.js"; +export declare class StreamableHTTPError extends Error { + readonly code: number | undefined; + constructor(code: number | undefined, message: string | undefined); +} +/** + * Configuration options for reconnection behavior of the StreamableHTTPClientTransport. + */ +export interface StreamableHTTPReconnectionOptions { + /** + * Maximum backoff time between reconnection attempts in milliseconds. + * Default is 30000 (30 seconds). + */ + maxReconnectionDelay: number; + /** + * Initial backoff time between reconnection attempts in milliseconds. + * Default is 1000 (1 second). + */ + initialReconnectionDelay: number; + /** + * The factor by which the reconnection delay increases after each attempt. + * Default is 1.5. + */ + reconnectionDelayGrowFactor: number; + /** + * Maximum number of reconnection attempts before giving up. + * Default is 2. + */ + maxRetries: number; +} +/** + * Configuration options for the `StreamableHTTPClientTransport`. + */ +export type StreamableHTTPClientTransportOptions = { + /** + * An OAuth client provider to use for authentication. + * + * When an `authProvider` is specified and the connection is started: + * 1. The connection is attempted with any existing access token from the `authProvider`. + * 2. If the access token has expired, the `authProvider` is used to refresh the token. + * 3. If token refresh fails or no access token exists, and auth is required, `OAuthClientProvider.redirectToAuthorization` is called, and an `UnauthorizedError` will be thrown from `connect`/`start`. + * + * After the user has finished authorizing via their user agent, and is redirected back to the MCP client application, call `StreamableHTTPClientTransport.finishAuth` with the authorization code before retrying the connection. + * + * If an `authProvider` is not provided, and auth is required, an `UnauthorizedError` will be thrown. + * + * `UnauthorizedError` might also be thrown when sending any message over the transport, indicating that the session has expired, and needs to be re-authed and reconnected. + */ + authProvider?: OAuthClientProvider; + /** + * Customizes HTTP requests to the server. + */ + requestInit?: RequestInit; + /** + * Options to configure the reconnection behavior. + */ + reconnectionOptions?: StreamableHTTPReconnectionOptions; + /** + * Session ID for the connection. This is used to identify the session on the server. + * When not provided and connecting to a server that supports session IDs, the server will generate a new session ID. + */ + sessionId?: string; +}; +/** + * Client transport for Streamable HTTP: this implements the MCP Streamable HTTP transport specification. + * It will connect to a server using HTTP POST for sending messages and HTTP GET with Server-Sent Events + * for receiving messages. + */ +export declare class StreamableHTTPClientTransport implements Transport { + private _abortController?; + private _url; + private _resourceMetadataUrl?; + private _requestInit?; + private _authProvider?; + private _sessionId?; + private _reconnectionOptions; + onclose?: () => void; + onerror?: (error: Error) => void; + onmessage?: (message: JSONRPCMessage) => void; + constructor(url: URL, opts?: StreamableHTTPClientTransportOptions); + private _authThenStart; + private _commonHeaders; + private _startOrAuthSse; + /** + * Calculates the next reconnection delay using backoff algorithm + * + * @param attempt Current reconnection attempt count for the specific stream + * @returns Time to wait in milliseconds before next reconnection attempt + */ + private _getNextReconnectionDelay; + /** + * Schedule a reconnection attempt with exponential backoff + * + * @param lastEventId The ID of the last received event for resumability + * @param attemptCount Current reconnection attempt count for this specific stream + */ + private _scheduleReconnection; + private _handleSseStream; + start(): Promise; + /** + * Call this method after the user has finished authorizing via their user agent and is redirected back to the MCP client application. This will exchange the authorization code for an access token, enabling the next connection attempt to successfully auth. + */ + finishAuth(authorizationCode: string): Promise; + close(): Promise; + send(message: JSONRPCMessage | JSONRPCMessage[], options?: { + resumptionToken?: string; + onresumptiontoken?: (token: string) => void; + }): Promise; + get sessionId(): string | undefined; + /** + * Terminates the current session by sending a DELETE request to the server. + * + * Clients that no longer need a particular session + * (e.g., because the user is leaving the client application) SHOULD send an + * HTTP DELETE to the MCP endpoint with the Mcp-Session-Id header to explicitly + * terminate the session. + * + * The server MAY respond with HTTP 405 Method Not Allowed, indicating that + * the server does not allow clients to terminate sessions. + */ + terminateSession(): Promise; +} +//# sourceMappingURL=streamableHttp.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/streamableHttp.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/streamableHttp.d.ts.map new file mode 100644 index 0000000000..a8b31bc102 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/streamableHttp.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"streamableHttp.d.ts","sourceRoot":"","sources":["../../../src/client/streamableHttp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAkE,cAAc,EAAwB,MAAM,aAAa,CAAC;AACnI,OAAO,EAAgD,mBAAmB,EAAqB,MAAM,WAAW,CAAC;AAWjH,qBAAa,mBAAoB,SAAQ,KAAK;aAE1B,IAAI,EAAE,MAAM,GAAG,SAAS;gBAAxB,IAAI,EAAE,MAAM,GAAG,SAAS,EACxC,OAAO,EAAE,MAAM,GAAG,SAAS;CAI9B;AA2BD;;GAEG;AACH,MAAM,WAAW,iCAAiC;IAChD;;;OAGG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAE7B;;;OAGG;IACH,wBAAwB,EAAE,MAAM,CAAC;IAEjC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GAAG,cAAc,EAAE,EAAE,OAAO,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,MAAM,CAAC;QAAC,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAkG1J,IAAI,SAAS,IAAI,MAAM,GAAG,SAAS,CAElC;IAED;;;;;;;;;;OAUG;IACG,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;CAgCxC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/streamableHttp.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/streamableHttp.js new file mode 100644 index 0000000000..59f0753a5e --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/streamableHttp.js @@ -0,0 +1,355 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.StreamableHTTPClientTransport = exports.StreamableHTTPError = void 0; +const types_js_1 = require("../types.js"); +const auth_js_1 = require("./auth.js"); +const stream_1 = require("eventsource-parser/stream"); +// Default reconnection options for StreamableHTTP connections +const DEFAULT_STREAMABLE_HTTP_RECONNECTION_OPTIONS = { + initialReconnectionDelay: 1000, + maxReconnectionDelay: 30000, + reconnectionDelayGrowFactor: 1.5, + maxRetries: 2, +}; +class StreamableHTTPError extends Error { + constructor(code, message) { + super(`Streamable HTTP error: ${message}`); + this.code = code; + } +} +exports.StreamableHTTPError = StreamableHTTPError; +/** + * Client transport for Streamable HTTP: this implements the MCP Streamable HTTP transport specification. + * It will connect to a server using HTTP POST for sending messages and HTTP GET with Server-Sent Events + * for receiving messages. + */ +class StreamableHTTPClientTransport { + constructor(url, opts) { + var _a; + this._url = url; + this._resourceMetadataUrl = undefined; + this._requestInit = opts === null || opts === void 0 ? void 0 : opts.requestInit; + this._authProvider = opts === null || opts === void 0 ? void 0 : opts.authProvider; + this._sessionId = opts === null || opts === void 0 ? void 0 : opts.sessionId; + this._reconnectionOptions = (_a = opts === null || opts === void 0 ? void 0 : opts.reconnectionOptions) !== null && _a !== void 0 ? _a : DEFAULT_STREAMABLE_HTTP_RECONNECTION_OPTIONS; + } + async _authThenStart() { + var _a; + if (!this._authProvider) { + throw new auth_js_1.UnauthorizedError("No auth provider"); + } + let result; + try { + result = await (0, auth_js_1.auth)(this._authProvider, { serverUrl: this._url, resourceMetadataUrl: this._resourceMetadataUrl }); + } + catch (error) { + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + throw error; + } + if (result !== "AUTHORIZED") { + throw new auth_js_1.UnauthorizedError(); + } + return await this._startOrAuthSse({ resumptionToken: undefined }); + } + async _commonHeaders() { + var _a; + const headers = {}; + if (this._authProvider) { + const tokens = await this._authProvider.tokens(); + if (tokens) { + headers["Authorization"] = `Bearer ${tokens.access_token}`; + } + } + if (this._sessionId) { + headers["mcp-session-id"] = this._sessionId; + } + return new Headers({ ...headers, ...(_a = this._requestInit) === null || _a === void 0 ? void 0 : _a.headers }); + } + async _startOrAuthSse(options) { + var _a, _b; + const { resumptionToken } = options; + try { + // Try to open an initial SSE stream with GET to listen for server messages + // This is optional according to the spec - server may not support it + const headers = await this._commonHeaders(); + headers.set("Accept", "text/event-stream"); + // Include Last-Event-ID header for resumable streams if provided + if (resumptionToken) { + headers.set("last-event-id", resumptionToken); + } + const response = await fetch(this._url, { + method: "GET", + headers, + signal: (_a = this._abortController) === null || _a === void 0 ? void 0 : _a.signal, + }); + if (!response.ok) { + if (response.status === 401 && this._authProvider) { + // Need to authenticate + return await this._authThenStart(); + } + // 405 indicates that the server does not offer an SSE stream at GET endpoint + // This is an expected case that should not trigger an error + if (response.status === 405) { + return; + } + throw new StreamableHTTPError(response.status, `Failed to open SSE stream: ${response.statusText}`); + } + this._handleSseStream(response.body, options); + } + catch (error) { + (_b = this.onerror) === null || _b === void 0 ? void 0 : _b.call(this, error); + throw error; + } + } + /** + * Calculates the next reconnection delay using backoff algorithm + * + * @param attempt Current reconnection attempt count for the specific stream + * @returns Time to wait in milliseconds before next reconnection attempt + */ + _getNextReconnectionDelay(attempt) { + // Access default values directly, ensuring they're never undefined + const initialDelay = this._reconnectionOptions.initialReconnectionDelay; + const growFactor = this._reconnectionOptions.reconnectionDelayGrowFactor; + const maxDelay = this._reconnectionOptions.maxReconnectionDelay; + // Cap at maximum delay + return Math.min(initialDelay * Math.pow(growFactor, attempt), maxDelay); + } + /** + * Schedule a reconnection attempt with exponential backoff + * + * @param lastEventId The ID of the last received event for resumability + * @param attemptCount Current reconnection attempt count for this specific stream + */ + _scheduleReconnection(options, attemptCount = 0) { + var _a; + // Use provided options or default options + const maxRetries = this._reconnectionOptions.maxRetries; + // Check if we've exceeded maximum retry attempts + if (maxRetries > 0 && attemptCount >= maxRetries) { + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, new Error(`Maximum reconnection attempts (${maxRetries}) exceeded.`)); + return; + } + // Calculate next delay based on current attempt count + const delay = this._getNextReconnectionDelay(attemptCount); + // Schedule the reconnection + setTimeout(() => { + // Use the last event ID to resume where we left off + this._startOrAuthSse(options).catch(error => { + var _a; + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, new Error(`Failed to reconnect SSE stream: ${error instanceof Error ? error.message : String(error)}`)); + // Schedule another attempt if this one failed, incrementing the attempt counter + this._scheduleReconnection(options, attemptCount + 1); + }); + }, delay); + } + _handleSseStream(stream, options) { + if (!stream) { + return; + } + const { onresumptiontoken, replayMessageId } = options; + let lastEventId; + const processStream = async () => { + var _a, _b, _c, _d; + // this is the closest we can get to trying to catch network errors + // if something happens reader will throw + try { + // Create a pipeline: binary stream -> text decoder -> SSE parser + const reader = stream + .pipeThrough(new TextDecoderStream()) + .pipeThrough(new stream_1.EventSourceParserStream()) + .getReader(); + while (true) { + const { value: event, done } = await reader.read(); + if (done) { + break; + } + // Update last event ID if provided + if (event.id) { + lastEventId = event.id; + onresumptiontoken === null || onresumptiontoken === void 0 ? void 0 : onresumptiontoken(event.id); + } + if (!event.event || event.event === "message") { + try { + const message = types_js_1.JSONRPCMessageSchema.parse(JSON.parse(event.data)); + if (replayMessageId !== undefined && (0, types_js_1.isJSONRPCResponse)(message)) { + message.id = replayMessageId; + } + (_a = this.onmessage) === null || _a === void 0 ? void 0 : _a.call(this, message); + } + catch (error) { + (_b = this.onerror) === null || _b === void 0 ? void 0 : _b.call(this, error); + } + } + } + } + catch (error) { + // Handle stream errors - likely a network disconnect + (_c = this.onerror) === null || _c === void 0 ? void 0 : _c.call(this, new Error(`SSE stream disconnected: ${error}`)); + // Attempt to reconnect if the stream disconnects unexpectedly and we aren't closing + if (this._abortController && !this._abortController.signal.aborted) { + // Use the exponential backoff reconnection strategy + if (lastEventId !== undefined) { + try { + this._scheduleReconnection({ + resumptionToken: lastEventId, + onresumptiontoken, + replayMessageId + }, 0); + } + catch (error) { + (_d = this.onerror) === null || _d === void 0 ? void 0 : _d.call(this, new Error(`Failed to reconnect: ${error instanceof Error ? error.message : String(error)}`)); + } + } + } + } + }; + processStream(); + } + async start() { + if (this._abortController) { + throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically."); + } + this._abortController = new AbortController(); + } + /** + * Call this method after the user has finished authorizing via their user agent and is redirected back to the MCP client application. This will exchange the authorization code for an access token, enabling the next connection attempt to successfully auth. + */ + async finishAuth(authorizationCode) { + if (!this._authProvider) { + throw new auth_js_1.UnauthorizedError("No auth provider"); + } + const result = await (0, auth_js_1.auth)(this._authProvider, { serverUrl: this._url, authorizationCode, resourceMetadataUrl: this._resourceMetadataUrl }); + if (result !== "AUTHORIZED") { + throw new auth_js_1.UnauthorizedError("Failed to authorize"); + } + } + async close() { + var _a, _b; + // Abort any pending requests + (_a = this._abortController) === null || _a === void 0 ? void 0 : _a.abort(); + (_b = this.onclose) === null || _b === void 0 ? void 0 : _b.call(this); + } + async send(message, options) { + var _a, _b, _c; + try { + const { resumptionToken, onresumptiontoken } = options || {}; + if (resumptionToken) { + // If we have at last event ID, we need to reconnect the SSE stream + this._startOrAuthSse({ resumptionToken, replayMessageId: (0, types_js_1.isJSONRPCRequest)(message) ? message.id : undefined }).catch(err => { var _a; return (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, err); }); + return; + } + const headers = await this._commonHeaders(); + headers.set("content-type", "application/json"); + headers.set("accept", "application/json, text/event-stream"); + const init = { + ...this._requestInit, + method: "POST", + headers, + body: JSON.stringify(message), + signal: (_a = this._abortController) === null || _a === void 0 ? void 0 : _a.signal, + }; + const response = await fetch(this._url, init); + // Handle session ID received during initialization + const sessionId = response.headers.get("mcp-session-id"); + if (sessionId) { + this._sessionId = sessionId; + } + if (!response.ok) { + if (response.status === 401 && this._authProvider) { + this._resourceMetadataUrl = (0, auth_js_1.extractResourceMetadataUrl)(response); + const result = await (0, auth_js_1.auth)(this._authProvider, { serverUrl: this._url, resourceMetadataUrl: this._resourceMetadataUrl }); + if (result !== "AUTHORIZED") { + throw new auth_js_1.UnauthorizedError(); + } + // Purposely _not_ awaited, so we don't call onerror twice + return this.send(message); + } + const text = await response.text().catch(() => null); + throw new Error(`Error POSTing to endpoint (HTTP ${response.status}): ${text}`); + } + // If the response is 202 Accepted, there's no body to process + if (response.status === 202) { + // if the accepted notification is initialized, we start the SSE stream + // if it's supported by the server + if ((0, types_js_1.isInitializedNotification)(message)) { + // Start without a lastEventId since this is a fresh connection + this._startOrAuthSse({ resumptionToken: undefined }).catch(err => { var _a; return (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, err); }); + } + return; + } + // Get original message(s) for detecting request IDs + const messages = Array.isArray(message) ? message : [message]; + const hasRequests = messages.filter(msg => "method" in msg && "id" in msg && msg.id !== undefined).length > 0; + // Check the response type + const contentType = response.headers.get("content-type"); + if (hasRequests) { + if (contentType === null || contentType === void 0 ? void 0 : contentType.includes("text/event-stream")) { + // Handle SSE stream responses for requests + // We use the same handler as standalone streams, which now supports + // reconnection with the last event ID + this._handleSseStream(response.body, { onresumptiontoken }); + } + else if (contentType === null || contentType === void 0 ? void 0 : contentType.includes("application/json")) { + // For non-streaming servers, we might get direct JSON responses + const data = await response.json(); + const responseMessages = Array.isArray(data) + ? data.map(msg => types_js_1.JSONRPCMessageSchema.parse(msg)) + : [types_js_1.JSONRPCMessageSchema.parse(data)]; + for (const msg of responseMessages) { + (_b = this.onmessage) === null || _b === void 0 ? void 0 : _b.call(this, msg); + } + } + else { + throw new StreamableHTTPError(-1, `Unexpected content type: ${contentType}`); + } + } + } + catch (error) { + (_c = this.onerror) === null || _c === void 0 ? void 0 : _c.call(this, error); + throw error; + } + } + get sessionId() { + return this._sessionId; + } + /** + * Terminates the current session by sending a DELETE request to the server. + * + * Clients that no longer need a particular session + * (e.g., because the user is leaving the client application) SHOULD send an + * HTTP DELETE to the MCP endpoint with the Mcp-Session-Id header to explicitly + * terminate the session. + * + * The server MAY respond with HTTP 405 Method Not Allowed, indicating that + * the server does not allow clients to terminate sessions. + */ + async terminateSession() { + var _a, _b; + if (!this._sessionId) { + return; // No session to terminate + } + try { + const headers = await this._commonHeaders(); + const init = { + ...this._requestInit, + method: "DELETE", + headers, + signal: (_a = this._abortController) === null || _a === void 0 ? void 0 : _a.signal, + }; + const response = await fetch(this._url, init); + // We specifically handle 405 as a valid response according to the spec, + // meaning the server does not support explicit session termination + if (!response.ok && response.status !== 405) { + throw new StreamableHTTPError(response.status, `Failed to terminate session: ${response.statusText}`); + } + this._sessionId = undefined; + } + catch (error) { + (_b = this.onerror) === null || _b === void 0 ? void 0 : _b.call(this, error); + throw error; + } + } +} +exports.StreamableHTTPClientTransport = StreamableHTTPClientTransport; +//# sourceMappingURL=streamableHttp.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/streamableHttp.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/streamableHttp.js.map new file mode 100644 index 0000000000..d2b3157fba --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/streamableHttp.js.map @@ -0,0 +1 @@ +{"version":3,"file":"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CAAC,UAAU,GAAG,SAAS,CAAC;QAC9B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAA,IAAI,CAAC,OAAO,qDAAG,KAAc,CAAC,CAAC;YAC/B,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF;AAhZD,sEAgZC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/websocket.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/websocket.d.ts new file mode 100644 index 0000000000..53945e788c --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/websocket.d.ts @@ -0,0 +1,17 @@ +import { Transport } from "../shared/transport.js"; +import { JSONRPCMessage } from "../types.js"; +/** + * Client transport for WebSocket: this will connect to a server over the WebSocket protocol. + */ +export declare class WebSocketClientTransport implements Transport { + private _socket?; + private _url; + onclose?: () => void; + onerror?: (error: Error) => void; + onmessage?: (message: JSONRPCMessage) => void; + constructor(url: URL); + start(): Promise; + close(): Promise; + send(message: JSONRPCMessage): Promise; +} +//# sourceMappingURL=websocket.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/websocket.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/websocket.d.ts.map new file mode 100644 index 0000000000..642fd27094 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/websocket.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"websocket.d.ts","sourceRoot":"","sources":["../../../src/client/websocket.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAwB,MAAM,aAAa,CAAC;AAInE;;GAEG;AACH,qBAAa,wBAAyB,YAAW,SAAS;IACxD,OAAO,CAAC,OAAO,CAAC,CAAY;IAC5B,OAAO,CAAC,IAAI,CAAM;IAElB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;gBAElC,GAAG,EAAE,GAAG;IAIpB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAyChB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAI5B,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAW7C"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/websocket.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/websocket.js new file mode 100644 index 0000000000..6ebfca0f65 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/websocket.js @@ -0,0 +1,65 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.WebSocketClientTransport = void 0; +const types_js_1 = require("../types.js"); +const SUBPROTOCOL = "mcp"; +/** + * Client transport for WebSocket: this will connect to a server over the WebSocket protocol. + */ +class WebSocketClientTransport { + constructor(url) { + this._url = url; + } + start() { + if (this._socket) { + throw new Error("WebSocketClientTransport already started! If using Client class, note that connect() calls start() automatically."); + } + return new Promise((resolve, reject) => { + this._socket = new WebSocket(this._url, SUBPROTOCOL); + this._socket.onerror = (event) => { + var _a; + const error = "error" in event + ? event.error + : new Error(`WebSocket error: ${JSON.stringify(event)}`); + reject(error); + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + }; + this._socket.onopen = () => { + resolve(); + }; + this._socket.onclose = () => { + var _a; + (_a = this.onclose) === null || _a === void 0 ? void 0 : _a.call(this); + }; + this._socket.onmessage = (event) => { + var _a, _b; + let message; + try { + message = types_js_1.JSONRPCMessageSchema.parse(JSON.parse(event.data)); + } + catch (error) { + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + return; + } + (_b = this.onmessage) === null || _b === void 0 ? void 0 : _b.call(this, message); + }; + }); + } + async close() { + var _a; + (_a = this._socket) === null || _a === void 0 ? void 0 : _a.close(); + } + send(message) { + return new Promise((resolve, reject) => { + var _a; + if (!this._socket) { + reject(new Error("Not connected")); + return; + } + (_a = this._socket) === null || _a === void 0 ? void 0 : _a.send(JSON.stringify(message)); + resolve(); + }); + } +} +exports.WebSocketClientTransport = WebSocketClientTransport; +//# sourceMappingURL=websocket.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/websocket.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/websocket.js.map new file mode 100644 index 0000000000..b0cc160ab7 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/client/websocket.js.map @@ -0,0 +1 @@ +{"version":3,"file":"websocket.js","sourceRoot":"","sources":["../../../src/client/websocket.ts"],"names":[],"mappings":";;;AACA,0CAAmE;AAEnE,MAAM,WAAW,GAAG,KAAK,CAAC;AAE1B;;GAEG;AACH,MAAa,wBAAwB;IAQnC,YAAY,GAAQ;QAClB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;IAClB,CAAC;IAED,KAAK;QACH,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CACb,mHAAmH,CACpH,CAAC;QACJ,CAAC;QAED,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,IAAI,CAAC,OAAO,GAAG,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;YAErD,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,CAAC,KAAK,EAAE,EAAE;;gBAC/B,MAAM,KAAK,GACT,OAAO,IAAI,KAAK;oBACd,CAAC,CAAE,KAAK,CAAC,KAAe;oBACxB,CAAC,CAAC,IAAI,KAAK,CAAC,oBAAoB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;gBAC7D,MAAM,CAAC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L,CAAC;CACF;AApED,4DAoEC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/multipleClientsParallel.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/multipleClientsParallel.d.ts new file mode 100644 index 0000000000..0ac5af8e56 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/multipleClientsParallel.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=multipleClientsParallel.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/multipleClientsParallel.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/multipleClientsParallel.d.ts.map new file mode 100644 index 0000000000..91051dc946 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/multipleClientsParallel.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"multipleClientsParallel.d.ts","sourceRoot":"","sources":["../../../../src/examples/client/multipleClientsParallel.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/multipleClientsParallel.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/multipleClientsParallel.js new file mode 100644 index 0000000000..ad3c319cc0 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/multipleClientsParallel.js @@ -0,0 +1,134 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const index_js_1 = require("../../client/index.js"); +const streamableHttp_js_1 = require("../../client/streamableHttp.js"); +const types_js_1 = require("../../types.js"); +/** + * Multiple Clients MCP Example + * + * This client demonstrates how to: + * 1. Create multiple MCP clients in parallel + * 2. Each client calls a single tool + * 3. Track notifications from each client independently + */ +// Command line args processing +const args = process.argv.slice(2); +const serverUrl = args[0] || 'http://localhost:3000/mcp'; +async function createAndRunClient(config) { + console.log(`[${config.id}] Creating client: ${config.name}`); + const client = new index_js_1.Client({ + name: config.name, + version: '1.0.0' + }); + const transport = new streamableHttp_js_1.StreamableHTTPClientTransport(new URL(serverUrl)); + // Set up client-specific error handler + client.onerror = (error) => { + console.error(`[${config.id}] Client error:`, error); + }; + // Set up client-specific notification handler + client.setNotificationHandler(types_js_1.LoggingMessageNotificationSchema, (notification) => { + console.log(`[${config.id}] Notification: ${notification.params.data}`); + }); + try { + // Connect to the server + await client.connect(transport); + console.log(`[${config.id}] Connected to MCP server`); + // Call the specified tool + console.log(`[${config.id}] Calling tool: ${config.toolName}`); + const toolRequest = { + method: 'tools/call', + params: { + name: config.toolName, + arguments: { + ...config.toolArguments, + // Add client ID to arguments for identification in notifications + caller: config.id + } + } + }; + const result = await client.request(toolRequest, types_js_1.CallToolResultSchema); + console.log(`[${config.id}] Tool call completed`); + // Keep the connection open for a bit to receive notifications + await new Promise(resolve => setTimeout(resolve, 5000)); + // Disconnect + await transport.close(); + console.log(`[${config.id}] Disconnected from MCP server`); + return { id: config.id, result }; + } + catch (error) { + console.error(`[${config.id}] Error:`, error); + throw error; + } +} +async function main() { + console.log('MCP Multiple Clients Example'); + console.log('============================'); + console.log(`Server URL: ${serverUrl}`); + console.log(''); + try { + // Define client configurations + const clientConfigs = [ + { + id: 'client1', + name: 'basic-client-1', + toolName: 'start-notification-stream', + toolArguments: { + interval: 3, // 1 second between notifications + count: 5 // Send 5 notifications + } + }, + { + id: 'client2', + name: 'basic-client-2', + toolName: 'start-notification-stream', + toolArguments: { + interval: 2, // 2 seconds between notifications + count: 3 // Send 3 notifications + } + }, + { + id: 'client3', + name: 'basic-client-3', + toolName: 'start-notification-stream', + toolArguments: { + interval: 1, // 0.5 second between notifications + count: 8 // Send 8 notifications + } + } + ]; + // Start all clients in parallel + console.log(`Starting ${clientConfigs.length} clients in parallel...`); + console.log(''); + const clientPromises = clientConfigs.map(config => createAndRunClient(config)); + const results = await Promise.all(clientPromises); + // Display results from all clients + console.log('\n=== Final Results ==='); + results.forEach(({ id, result }) => { + console.log(`\n[${id}] Tool result:`); + if (Array.isArray(result.content)) { + result.content.forEach((item) => { + if (item.type === 'text' && item.text) { + console.log(` ${item.text}`); + } + else { + console.log(` ${item.type} content:`, item); + } + }); + } + else { + console.log(` Unexpected result format:`, result); + } + }); + console.log('\n=== All clients completed successfully ==='); + } + catch (error) { + console.error('Error running multiple clients:', error); + process.exit(1); + } +} +// Start the example +main().catch((error) => { + console.error('Error running MCP multiple clients example:', error); + process.exit(1); +}); +//# sourceMappingURL=multipleClientsParallel.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/multipleClientsParallel.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/multipleClientsParallel.js.map new file mode 100644 index 0000000000..e98ce44a44 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/multipleClientsParallel.js.map @@ -0,0 +1 @@ +{"version":3,"file":"multipleClientsParallel.js","sourceRoot":"","sources":["../../../../src/examples/client/multipleClientsParallel.ts"],"names":[],"mappings":";;AAAA,oDAA+C;AAC/C,sEAA+E;AAC/E,6CAKwB;AAExB;;;;;;;GAOG;AAEH,+BAA+B;AAC/B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACnC,MAAM,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,2BAA2B,CAAC;AASzD,KAAK,UAAU,kBAAkB,CAAC,MAAoB;IACpD,OAAO,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,EAAE,sBAAsB,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;IAE9D,MAAM,MAAM,GAAG,IAAI,iBAAM,CAAC;QACxB,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,OAAO,EAAE,OAAO;KACjB,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,IAAI,iDAA6B,CAAC,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC;IAExE,u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,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,oBAAoB;AACpB,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IAC9B,OAAO,CAAC,KAAK,CAAC,6CAA6C,EAAE,KAAK,CAAC,CAAC;IACpE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/parallelToolCallsClient.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/parallelToolCallsClient.d.ts new file mode 100644 index 0000000000..e93d4d69d2 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/parallelToolCallsClient.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=parallelToolCallsClient.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/parallelToolCallsClient.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/parallelToolCallsClient.d.ts.map new file mode 100644 index 0000000000..25a3b820cf --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/parallelToolCallsClient.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"parallelToolCallsClient.d.ts","sourceRoot":"","sources":["../../../../src/examples/client/parallelToolCallsClient.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/parallelToolCallsClient.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/parallelToolCallsClient.js new file mode 100644 index 0000000000..a0a874b067 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/parallelToolCallsClient.js @@ -0,0 +1,175 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const index_js_1 = require("../../client/index.js"); +const streamableHttp_js_1 = require("../../client/streamableHttp.js"); +const types_js_1 = require("../../types.js"); +/** + * Parallel Tool Calls MCP Client + * + * This client demonstrates how to: + * 1. Start multiple tool calls in parallel + * 2. Track notifications from each tool call using a caller parameter + */ +// Command line args processing +const args = process.argv.slice(2); +const serverUrl = args[0] || 'http://localhost:3000/mcp'; +async function main() { + console.log('MCP Parallel Tool Calls Client'); + console.log('=============================='); + console.log(`Connecting to server at: ${serverUrl}`); + let client; + let transport; + try { + // Create client with streamable HTTP transport + client = new index_js_1.Client({ + name: 'parallel-tool-calls-client', + version: '1.0.0' + }); + client.onerror = (error) => { + console.error('Client error:', error); + }; + // Connect to the server + transport = new streamableHttp_js_1.StreamableHTTPClientTransport(new URL(serverUrl)); + await client.connect(transport); + console.log('Successfully connected to MCP server'); + // Set up notification handler with caller identification + client.setNotificationHandler(types_js_1.LoggingMessageNotificationSchema, (notification) => { + console.log(`Notification: ${notification.params.data}`); + }); + console.log("List tools"); + const toolsRequest = await listTools(client); + console.log("Tools: ", toolsRequest); + // 2. Start multiple notification tools in parallel + console.log('\n=== Starting Multiple Notification Streams in Parallel ==='); + const toolResults = await startParallelNotificationTools(client); + // Log the results from each tool call + for (const [caller, result] of Object.entries(toolResults)) { + console.log(`\n=== Tool result for ${caller} ===`); + result.content.forEach((item) => { + if (item.type === 'text') { + console.log(` ${item.text}`); + } + else { + console.log(` ${item.type} content:`, item); + } + }); + } + // 3. Wait for all notifications (10 seconds) + console.log('\n=== Waiting for all notifications ==='); + await new Promise(resolve => setTimeout(resolve, 10000)); + // 4. Disconnect + console.log('\n=== Disconnecting ==='); + await transport.close(); + console.log('Disconnected from MCP server'); + } + catch (error) { + console.error('Error running client:', error); + process.exit(1); + } +} +/** + * List available tools on the server + */ +async function listTools(client) { + try { + const toolsRequest = { + method: 'tools/list', + params: {} + }; + const toolsResult = await client.request(toolsRequest, types_js_1.ListToolsResultSchema); + console.log('Available tools:'); + if (toolsResult.tools.length === 0) { + console.log(' No tools available'); + } + else { + for (const tool of toolsResult.tools) { + console.log(` - ${tool.name}: ${tool.description}`); + } + } + } + catch (error) { + console.log(`Tools not supported by this server: ${error}`); + } +} +/** + * Start multiple notification tools in parallel with different configurations + * Each tool call includes a caller parameter to identify its notifications + */ +async function startParallelNotificationTools(client) { + try { + // Define multiple tool calls with different configurations + const toolCalls = [ + { + caller: 'fast-notifier', + request: { + method: 'tools/call', + params: { + name: 'start-notification-stream', + arguments: { + interval: 2, // 0.5 second between notifications + count: 10, // Send 10 notifications + caller: 'fast-notifier' // Identify this tool call + } + } + } + }, + { + caller: 'slow-notifier', + request: { + method: 'tools/call', + params: { + name: 'start-notification-stream', + arguments: { + interval: 5, // 2 seconds between notifications + count: 5, // Send 5 notifications + caller: 'slow-notifier' // Identify this tool call + } + } + } + }, + { + caller: 'burst-notifier', + request: { + method: 'tools/call', + params: { + name: 'start-notification-stream', + arguments: { + interval: 1, // 0.1 second between notifications + count: 3, // Send just 3 notifications + caller: 'burst-notifier' // Identify this tool call + } + } + } + } + ]; + console.log(`Starting ${toolCalls.length} notification tools in parallel...`); + // Start all tool calls in parallel + const toolPromises = toolCalls.map(({ caller, request }) => { + console.log(`Starting tool call for ${caller}...`); + return client.request(request, types_js_1.CallToolResultSchema) + .then(result => ({ caller, result })) + .catch(error => { + console.error(`Error in tool call for ${caller}:`, error); + throw error; + }); + }); + // Wait for all tool calls to complete + const results = await Promise.all(toolPromises); + // Organize results by caller + const resultsByTool = {}; + results.forEach(({ caller, result }) => { + resultsByTool[caller] = result; + }); + return resultsByTool; + } + catch (error) { + console.error(`Error starting parallel notification tools:`, error); + throw error; + } +} +// Start the client +main().catch((error) => { + console.error('Error running MCP client:', error); + process.exit(1); +}); +//# sourceMappingURL=parallelToolCallsClient.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/parallelToolCallsClient.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/parallelToolCallsClient.js.map new file mode 100644 index 0000000000..80c62d6e80 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/parallelToolCallsClient.js.map @@ -0,0 +1 @@ +{"version":3,"file":"parallelToolCallsClient.js","sourceRoot":"","sources":["../../../../src/examples/client/parallelToolCallsClient.ts"],"names":[],"mappings":";;AAAA,oDAA+C;AAC/C,sEAA+E;AAC/E,6CAMwB;AAExB;;;;;;GAMG;AAEH,+BAA+B;AAC/B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACnC,MAAM,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,2BAA2B,CAAC;AAEzD,KAAK,UAAU,IAAI;IACjB,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;IAC9C,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;IAC9C,OAAO,CAAC,GAAG,CAAC,4BAA4B,SAAS,EAAE,CAAC,CAAC;IAErD,IAAI,MAAc,CAAC;IACnB,IAAI,SAAwC,CAAC;IAE7C,IAAI,CAAC;QACH,+CAA+C;QAC/C,MAAM,GAAG,IAAI,iBAAM,CAAC;YAClB,IAAI,EAAE,4BAA4B;YAClC,OAAO,EAAE,OAAO;SACjB,CAAC,CAAC;QAEH,MAAM,CAAC,OAAO,GAAG,CAAC,KAAK,EAAE,EAAE;YACzB,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;QACxC,CAAC,CAAC;QAEF,wBAAwB;QACxB,SAAS,GAAG,IAAI,iDAA6B,CAAC,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC;QAClE,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAChC,OAAO,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC;QAEpD,yDAAyD;QACzD,MAAM,CAAC,sBAAsB,CAAC,2CAAgC,EAAE,CAAC,YAAY,EAAE,EAAE;YAC/E,OAAO,CAAC,GAAG,CAA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AAC,CAAC,CAAC;QAEH,sCAAsC;QACtC,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAEhD,6BAA6B;QAC7B,MAAM,aAAa,GAAmC,EAAE,CAAC;QACzD,OAAO,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE;YACrC,aAAa,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;QACjC,CAAC,CAAC,CAAC;QAEH,OAAO,aAAa,CAAC;IACvB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,6CAA6C,EAAE,KAAK,CAAC,CAAC;QACpE,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAED,mBAAmB;AACnB,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IAC9B,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;IAClD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/simpleOAuthClient.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/simpleOAuthClient.d.ts new file mode 100644 index 0000000000..e4b43dbc01 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/simpleOAuthClient.d.ts @@ -0,0 +1,3 @@ +#!/usr/bin/env node +export {}; +//# sourceMappingURL=simpleOAuthClient.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/simpleOAuthClient.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/simpleOAuthClient.d.ts.map new file mode 100644 index 0000000000..c09eef86ea --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/simpleOAuthClient.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"simpleOAuthClient.d.ts","sourceRoot":"","sources":["../../../../src/examples/client/simpleOAuthClient.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/simpleOAuthClient.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/simpleOAuthClient.js new file mode 100644 index 0000000000..db30b8a87d --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/simpleOAuthClient.js @@ -0,0 +1,372 @@ +#!/usr/bin/env node +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const node_http_1 = require("node:http"); +const node_readline_1 = require("node:readline"); +const node_url_1 = require("node:url"); +const node_child_process_1 = require("node:child_process"); +const index_js_1 = require("../../client/index.js"); +const streamableHttp_js_1 = require("../../client/streamableHttp.js"); +const types_js_1 = require("../../types.js"); +const auth_js_1 = require("../../client/auth.js"); +// Configuration +const DEFAULT_SERVER_URL = 'http://localhost:3000/mcp'; +const CALLBACK_PORT = 8090; // Use different port than auth server (3001) +const CALLBACK_URL = `http://localhost:${CALLBACK_PORT}/callback`; +/** + * In-memory OAuth client provider for demonstration purposes + * In production, you should persist tokens securely + */ +class InMemoryOAuthClientProvider { + constructor(_redirectUrl, _clientMetadata, onRedirect) { + this._redirectUrl = _redirectUrl; + this._clientMetadata = _clientMetadata; + this._onRedirect = onRedirect || ((url) => { + console.log(`Redirect to: ${url.toString()}`); + }); + } + get redirectUrl() { + return this._redirectUrl; + } + get clientMetadata() { + return this._clientMetadata; + } + clientInformation() { + return this._clientInformation; + } + saveClientInformation(clientInformation) { + this._clientInformation = clientInformation; + } + tokens() { + return this._tokens; + } + saveTokens(tokens) { + this._tokens = tokens; + } + redirectToAuthorization(authorizationUrl) { + this._onRedirect(authorizationUrl); + } + saveCodeVerifier(codeVerifier) { + this._codeVerifier = codeVerifier; + } + codeVerifier() { + if (!this._codeVerifier) { + throw new Error('No code verifier saved'); + } + return this._codeVerifier; + } +} +/** + * Interactive MCP client with OAuth authentication + * Demonstrates the complete OAuth flow with browser-based authorization + */ +class InteractiveOAuthClient { + constructor(serverUrl) { + this.serverUrl = serverUrl; + this.client = null; + this.rl = (0, node_readline_1.createInterface)({ + input: process.stdin, + output: process.stdout, + }); + } + /** + * Prompts user for input via readline + */ + async question(query) { + return new Promise((resolve) => { + this.rl.question(query, resolve); + }); + } + /** + * Opens the authorization URL in the user's default browser + */ + async openBrowser(url) { + console.log(`🌐 Opening browser for authorization: ${url}`); + const command = `open "${url}"`; + (0, node_child_process_1.exec)(command, (error) => { + if (error) { + console.error(`Failed to open browser: ${error.message}`); + console.log(`Please manually open: ${url}`); + } + }); + } + /** + * Example OAuth callback handler - in production, use a more robust approach + * for handling callbacks and storing tokens + */ + /** + * Starts a temporary HTTP server to receive the OAuth callback + */ + async waitForOAuthCallback() { + return new Promise((resolve, reject) => { + const server = (0, node_http_1.createServer)((req, res) => { + // Ignore favicon requests + if (req.url === '/favicon.ico') { + res.writeHead(404); + res.end(); + return; + } + console.log(`📥 Received callback: ${req.url}`); + const parsedUrl = new node_url_1.URL(req.url || '', 'http://localhost'); + const code = parsedUrl.searchParams.get('code'); + const error = parsedUrl.searchParams.get('error'); + if (code) { + console.log(`✅ Authorization code received: ${code === null || code === void 0 ? void 0 : code.substring(0, 10)}...`); + res.writeHead(200, { 'Content-Type': 'text/html' }); + res.end(` + + +

Authorization Successful!

+

You can close this window and return to the terminal.

+ + + + `); + resolve(code); + setTimeout(() => server.close(), 3000); + } + else if (error) { + console.log(`❌ Authorization error: ${error}`); + res.writeHead(400, { 'Content-Type': 'text/html' }); + res.end(` + + +

Authorization Failed

+

Error: ${error}

+ + + `); + reject(new Error(`OAuth authorization failed: ${error}`)); + } + else { + console.log(`❌ No authorization code or error in callback`); + res.writeHead(400); + res.end('Bad request'); + reject(new Error('No authorization code provided')); + } + }); + server.listen(CALLBACK_PORT, () => { + console.log(`OAuth callback server started on http://localhost:${CALLBACK_PORT}`); + }); + }); + } + async attemptConnection(oauthProvider) { + console.log('🚢 Creating transport with OAuth provider...'); + const baseUrl = new node_url_1.URL(this.serverUrl); + const transport = new streamableHttp_js_1.StreamableHTTPClientTransport(baseUrl, { + authProvider: oauthProvider + }); + console.log('🚢 Transport created'); + try { + console.log('🔌 Attempting connection (this will trigger OAuth redirect)...'); + await this.client.connect(transport); + console.log('✅ Connected successfully'); + } + catch (error) { + if (error instanceof auth_js_1.UnauthorizedError) { + console.log('🔐 OAuth required - waiting for authorization...'); + const callbackPromise = this.waitForOAuthCallback(); + const authCode = await callbackPromise; + await transport.finishAuth(authCode); + console.log('🔐 Authorization code received:', authCode); + console.log('🔌 Reconnecting with authenticated transport...'); + await this.attemptConnection(oauthProvider); + } + else { + console.error('❌ Connection failed with non-auth error:', error); + throw error; + } + } + } + /** + * Establishes connection to the MCP server with OAuth authentication + */ + async connect() { + console.log(`🔗 Attempting to connect to ${this.serverUrl}...`); + const clientMetadata = { + client_name: 'Simple OAuth MCP Client', + redirect_uris: [CALLBACK_URL], + grant_types: ['authorization_code', 'refresh_token'], + response_types: ['code'], + token_endpoint_auth_method: 'client_secret_post', + scope: 'mcp:tools' + }; + console.log('🔐 Creating OAuth provider...'); + const oauthProvider = new InMemoryOAuthClientProvider(CALLBACK_URL, clientMetadata, (redirectUrl) => { + console.log(`📌 OAuth redirect handler called - opening browser`); + console.log(`Opening browser to: ${redirectUrl.toString()}`); + this.openBrowser(redirectUrl.toString()); + }); + console.log('🔐 OAuth provider created'); + console.log('👤 Creating MCP client...'); + this.client = new index_js_1.Client({ + name: 'simple-oauth-client', + version: '1.0.0', + }, { capabilities: {} }); + console.log('👤 Client created'); + console.log('🔐 Starting OAuth flow...'); + await this.attemptConnection(oauthProvider); + // Start interactive loop + await this.interactiveLoop(); + } + /** + * Main interactive loop for user commands + */ + async interactiveLoop() { + console.log('\n🎯 Interactive MCP Client with OAuth'); + console.log('Commands:'); + console.log(' list - List available tools'); + console.log(' call [args] - Call a tool'); + console.log(' quit - Exit the client'); + console.log(); + while (true) { + try { + const command = await this.question('mcp> '); + if (!command.trim()) { + continue; + } + if (command === 'quit') { + break; + } + else if (command === 'list') { + await this.listTools(); + } + else if (command.startsWith('call ')) { + await this.handleCallTool(command); + } + else { + console.log('❌ Unknown command. Try \'list\', \'call \', or \'quit\''); + } + } + catch (error) { + if (error instanceof Error && error.message === 'SIGINT') { + console.log('\n\n👋 Goodbye!'); + break; + } + console.error('❌ Error:', error); + } + } + } + async listTools() { + if (!this.client) { + console.log('❌ Not connected to server'); + return; + } + try { + const request = { + method: 'tools/list', + params: {}, + }; + const result = await this.client.request(request, types_js_1.ListToolsResultSchema); + if (result.tools && result.tools.length > 0) { + console.log('\n📋 Available tools:'); + result.tools.forEach((tool, index) => { + console.log(`${index + 1}. ${tool.name}`); + if (tool.description) { + console.log(` Description: ${tool.description}`); + } + console.log(); + }); + } + else { + console.log('No tools available'); + } + } + catch (error) { + console.error('❌ Failed to list tools:', error); + } + } + async handleCallTool(command) { + const parts = command.split(/\s+/); + const toolName = parts[1]; + if (!toolName) { + console.log('❌ Please specify a tool name'); + return; + } + // Parse arguments (simple JSON-like format) + let toolArgs = {}; + if (parts.length > 2) { + const argsString = parts.slice(2).join(' '); + try { + toolArgs = JSON.parse(argsString); + } + catch (_a) { + console.log('❌ Invalid arguments format (expected JSON)'); + return; + } + } + await this.callTool(toolName, toolArgs); + } + async callTool(toolName, toolArgs) { + if (!this.client) { + console.log('❌ Not connected to server'); + return; + } + try { + const request = { + method: 'tools/call', + params: { + name: toolName, + arguments: toolArgs, + }, + }; + const result = await this.client.request(request, types_js_1.CallToolResultSchema); + console.log(`\n🔧 Tool '${toolName}' result:`); + if (result.content) { + result.content.forEach((content) => { + if (content.type === 'text') { + console.log(content.text); + } + else { + console.log(content); + } + }); + } + else { + console.log(result); + } + } + catch (error) { + console.error(`❌ Failed to call tool '${toolName}':`, error); + } + } + close() { + this.rl.close(); + if (this.client) { + // Note: Client doesn't have a close method in the current implementation + // This would typically close the transport connection + } + } +} +/** + * Main entry point + */ +async function main() { + const serverUrl = process.env.MCP_SERVER_URL || DEFAULT_SERVER_URL; + console.log('🚀 Simple MCP OAuth Client'); + console.log(`Connecting to: ${serverUrl}`); + console.log(); + const client = new InteractiveOAuthClient(serverUrl); + // Handle graceful shutdown + process.on('SIGINT', () => { + console.log('\n\n👋 Goodbye!'); + client.close(); + process.exit(0); + }); + try { + await client.connect(); + } + catch (error) { + console.error('Failed to start client:', error); + process.exit(1); + } + finally { + client.close(); + } +} +// Run if this file is executed directly +main().catch((error) => { + console.error('Unhandled error:', error); + process.exit(1); +}); +//# sourceMappingURL=simpleOAuthClient.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/simpleOAuthClient.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/simpleOAuthClient.js.map new file mode 100644 index 0000000000..49b4ca7903 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/simpleOAuthClient.js.map @@ -0,0 +1 @@ +{"version":3,"file":"simpleOAuthClient.js","sourceRoot":"","sources":["../../../../src/examples/client/simpleOAuthClient.ts"],"names":[],"mappings":";;;AAEA,yCAAyC;AACzC,iDAAgD;AAChD,uCAA+B;AAC/B,2DAA0C;AAC1C,oDAA+C;AAC/C,sEAA+E;AAE/E,6CAKwB;AACxB,kDAA8E;AAE9E,gBAAgB;AAChB,MAAM,kBAAkB,GAAG,2BAA2B,CAAC;AACvD,MAAM,aAAa,GAAG,IAAI,CAAC,CAAC,6CAA6C;AACzE,MAAM,YAAY,GAAG,oBAAoB,aAAa,WAAW,CAAC;AAElE;;;GAGG;AACH,MAAM,2BAA2B;IAK/B,YACmB,YAA0B,EAC1B,eAAoC,EACrD,UAA+B;QAFd,iBAAY,GAAZ,YAAY,CAAc;QAC1B,oBAAe,GAAf,eAAe,CAAqB;QAGrD,IAAI,CAAC,WAAW,GAAG,UAAU,IAAI,CAAC,CAAC,GAAG,E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CAAC;QACT,MAAM,CAAC,KAAK,EAAE,CAAC;IACjB,CAAC;AACH,CAAC;AAED,wCAAwC;AACxC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;IACzC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/simpleStreamableHttp.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/simpleStreamableHttp.d.ts new file mode 100644 index 0000000000..a20be42ca4 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/simpleStreamableHttp.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=simpleStreamableHttp.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/simpleStreamableHttp.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/simpleStreamableHttp.d.ts.map new file mode 100644 index 0000000000..28406b0c1e --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/simpleStreamableHttp.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"simpleStreamableHttp.d.ts","sourceRoot":"","sources":["../../../../src/examples/client/simpleStreamableHttp.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/simpleStreamableHttp.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/simpleStreamableHttp.js new file mode 100644 index 0000000000..3e39ecebc4 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/simpleStreamableHttp.js @@ -0,0 +1,487 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const index_js_1 = require("../../client/index.js"); +const streamableHttp_js_1 = require("../../client/streamableHttp.js"); +const node_readline_1 = require("node:readline"); +const types_js_1 = require("../../types.js"); +// Create readline interface for user input +const readline = (0, node_readline_1.createInterface)({ + input: process.stdin, + output: process.stdout +}); +// Track received notifications for debugging resumability +let notificationCount = 0; +// Global client and transport for interactive commands +let client = null; +let transport = null; +let serverUrl = 'http://localhost:3000/mcp'; +let notificationsToolLastEventId = undefined; +let sessionId = undefined; +async function main() { + console.log('MCP Interactive Client'); + console.log('====================='); + // Connect to server immediately with default settings + await connect(); + // Print help and start the command loop + printHelp(); + commandLoop(); +} +function printHelp() { + console.log('\nAvailable commands:'); + console.log(' connect [url] - Connect to MCP server (default: http://localhost:3000/mcp)'); + console.log(' disconnect - Disconnect from server'); + console.log(' terminate-session - Terminate the current session'); + console.log(' reconnect - Reconnect to the server'); + console.log(' list-tools - List available tools'); + console.log(' call-tool [args] - Call a tool with optional JSON arguments'); + console.log(' greet [name] - Call the greet tool'); + console.log(' multi-greet [name] - Call the multi-greet tool with notifications'); + console.log(' start-notifications [interval] [count] - Start periodic notifications'); + console.log(' run-notifications-tool-with-resumability [interval] [count] - Run notification tool with resumability'); + console.log(' list-prompts - List available prompts'); + console.log(' get-prompt [name] [args] - Get a prompt with optional JSON arguments'); + console.log(' list-resources - List available resources'); + console.log(' help - Show this help'); + console.log(' quit - Exit the program'); +} +function commandLoop() { + readline.question('\n> ', async (input) => { + var _a; + const args = input.trim().split(/\s+/); + const command = (_a = args[0]) === null || _a === void 0 ? void 0 : _a.toLowerCase(); + try { + switch (command) { + case 'connect': + await connect(args[1]); + break; + case 'disconnect': + await disconnect(); + break; + case 'terminate-session': + await terminateSession(); + break; + case 'reconnect': + await reconnect(); + break; + case 'list-tools': + await listTools(); + break; + case 'call-tool': + if (args.length < 2) { + console.log('Usage: call-tool [args]'); + } + else { + const toolName = args[1]; + let toolArgs = {}; + if (args.length > 2) { + try { + toolArgs = JSON.parse(args.slice(2).join(' ')); + } + catch (_b) { + console.log('Invalid JSON arguments. Using empty args.'); + } + } + await callTool(toolName, toolArgs); + } + break; + case 'greet': + await callGreetTool(args[1] || 'MCP User'); + break; + case 'multi-greet': + await callMultiGreetTool(args[1] || 'MCP User'); + break; + case 'start-notifications': { + const interval = args[1] ? parseInt(args[1], 10) : 2000; + const count = args[2] ? parseInt(args[2], 10) : 10; + await startNotifications(interval, count); + break; + } + case 'run-notifications-tool-with-resumability': { + const interval = args[1] ? parseInt(args[1], 10) : 2000; + const count = args[2] ? parseInt(args[2], 10) : 10; + await runNotificationsToolWithResumability(interval, count); + break; + } + case 'list-prompts': + await listPrompts(); + break; + case 'get-prompt': + if (args.length < 2) { + console.log('Usage: get-prompt [args]'); + } + else { + const promptName = args[1]; + let promptArgs = {}; + if (args.length > 2) { + try { + promptArgs = JSON.parse(args.slice(2).join(' ')); + } + catch (_c) { + console.log('Invalid JSON arguments. Using empty args.'); + } + } + await getPrompt(promptName, promptArgs); + } + break; + case 'list-resources': + await listResources(); + break; + case 'help': + printHelp(); + break; + case 'quit': + case 'exit': + await cleanup(); + return; + default: + if (command) { + console.log(`Unknown command: ${command}`); + } + break; + } + } + catch (error) { + console.error(`Error executing command: ${error}`); + } + // Continue the command loop + commandLoop(); + }); +} +async function connect(url) { + if (client) { + console.log('Already connected. Disconnect first.'); + return; + } + if (url) { + serverUrl = url; + } + console.log(`Connecting to ${serverUrl}...`); + try { + // Create a new client + client = new index_js_1.Client({ + name: 'example-client', + version: '1.0.0' + }); + client.onerror = (error) => { + console.error('\x1b[31mClient error:', error, '\x1b[0m'); + }; + transport = new streamableHttp_js_1.StreamableHTTPClientTransport(new URL(serverUrl), { + sessionId: sessionId + }); + // Set up notification handlers + client.setNotificationHandler(types_js_1.LoggingMessageNotificationSchema, (notification) => { + notificationCount++; + console.log(`\nNotification #${notificationCount}: ${notification.params.level} - ${notification.params.data}`); + // Re-display the prompt + process.stdout.write('> '); + }); + client.setNotificationHandler(types_js_1.ResourceListChangedNotificationSchema, async (_) => { + console.log(`\nResource list changed notification received!`); + try { + if (!client) { + console.log('Client disconnected, cannot fetch resources'); + return; + } + const resourcesResult = await client.request({ + method: 'resources/list', + params: {} + }, types_js_1.ListResourcesResultSchema); + console.log('Available resources count:', resourcesResult.resources.length); + } + catch (_a) { + console.log('Failed to list resources after change notification'); + } + // Re-display the prompt + process.stdout.write('> '); + }); + // Connect the client + await client.connect(transport); + sessionId = transport.sessionId; + console.log('Transport created with session ID:', sessionId); + console.log('Connected to MCP server'); + } + catch (error) { + console.error('Failed to connect:', error); + client = null; + transport = null; + } +} +async function disconnect() { + if (!client || !transport) { + console.log('Not connected.'); + return; + } + try { + await transport.close(); + console.log('Disconnected from MCP server'); + client = null; + transport = null; + } + catch (error) { + console.error('Error disconnecting:', error); + } +} +async function terminateSession() { + if (!client || !transport) { + console.log('Not connected.'); + return; + } + try { + console.log('Terminating session with ID:', transport.sessionId); + await transport.terminateSession(); + console.log('Session terminated successfully'); + // Check if sessionId was cleared after termination + if (!transport.sessionId) { + console.log('Session ID has been cleared'); + sessionId = undefined; + // Also close the transport and clear client objects + await transport.close(); + console.log('Transport closed after session termination'); + client = null; + transport = null; + } + else { + console.log('Server responded with 405 Method Not Allowed (session termination not supported)'); + console.log('Session ID is still active:', transport.sessionId); + } + } + catch (error) { + console.error('Error terminating session:', error); + } +} +async function reconnect() { + if (client) { + await disconnect(); + } + await connect(); +} +async function listTools() { + if (!client) { + console.log('Not connected to server.'); + return; + } + try { + const toolsRequest = { + method: 'tools/list', + params: {} + }; + const toolsResult = await client.request(toolsRequest, types_js_1.ListToolsResultSchema); + console.log('Available tools:'); + if (toolsResult.tools.length === 0) { + console.log(' No tools available'); + } + else { + for (const tool of toolsResult.tools) { + console.log(` - ${tool.name}: ${tool.description}`); + } + } + } + catch (error) { + console.log(`Tools not supported by this server (${error})`); + } +} +async function callTool(name, args) { + if (!client) { + console.log('Not connected to server.'); + return; + } + try { + const request = { + method: 'tools/call', + params: { + name, + arguments: args + } + }; + console.log(`Calling tool '${name}' with args:`, args); + const result = await client.request(request, types_js_1.CallToolResultSchema); + console.log('Tool result:'); + result.content.forEach(item => { + if (item.type === 'text') { + console.log(` ${item.text}`); + } + else { + console.log(` ${item.type} content:`, item); + } + }); + } + catch (error) { + console.log(`Error calling tool ${name}: ${error}`); + } +} +async function callGreetTool(name) { + await callTool('greet', { name }); +} +async function callMultiGreetTool(name) { + console.log('Calling multi-greet tool with notifications...'); + await callTool('multi-greet', { name }); +} +async function startNotifications(interval, count) { + console.log(`Starting notification stream: interval=${interval}ms, count=${count || 'unlimited'}`); + await callTool('start-notification-stream', { interval, count }); +} +async function runNotificationsToolWithResumability(interval, count) { + if (!client) { + console.log('Not connected to server.'); + return; + } + try { + console.log(`Starting notification stream with resumability: interval=${interval}ms, count=${count || 'unlimited'}`); + console.log(`Using resumption token: ${notificationsToolLastEventId || 'none'}`); + const request = { + method: 'tools/call', + params: { + name: 'start-notification-stream', + arguments: { interval, count } + } + }; + const onLastEventIdUpdate = (event) => { + notificationsToolLastEventId = event; + console.log(`Updated resumption token: ${event}`); + }; + const result = await client.request(request, types_js_1.CallToolResultSchema, { + resumptionToken: notificationsToolLastEventId, + onresumptiontoken: onLastEventIdUpdate + }); + console.log('Tool result:'); + result.content.forEach(item => { + if (item.type === 'text') { + console.log(` ${item.text}`); + } + else { + console.log(` ${item.type} content:`, item); + } + }); + } + catch (error) { + console.log(`Error starting notification stream: ${error}`); + } +} +async function listPrompts() { + if (!client) { + console.log('Not connected to server.'); + return; + } + try { + const promptsRequest = { + method: 'prompts/list', + params: {} + }; + const promptsResult = await client.request(promptsRequest, types_js_1.ListPromptsResultSchema); + console.log('Available prompts:'); + if (promptsResult.prompts.length === 0) { + console.log(' No prompts available'); + } + else { + for (const prompt of promptsResult.prompts) { + console.log(` - ${prompt.name}: ${prompt.description}`); + } + } + } + catch (error) { + console.log(`Prompts not supported by this server (${error})`); + } +} +async function getPrompt(name, args) { + if (!client) { + console.log('Not connected to server.'); + return; + } + try { + const promptRequest = { + method: 'prompts/get', + params: { + name, + arguments: args + } + }; + const promptResult = await client.request(promptRequest, types_js_1.GetPromptResultSchema); + console.log('Prompt template:'); + promptResult.messages.forEach((msg, index) => { + console.log(` [${index + 1}] ${msg.role}: ${msg.content.text}`); + }); + } + catch (error) { + console.log(`Error getting prompt ${name}: ${error}`); + } +} +async function listResources() { + if (!client) { + console.log('Not connected to server.'); + return; + } + try { + const resourcesRequest = { + method: 'resources/list', + params: {} + }; + const resourcesResult = await client.request(resourcesRequest, types_js_1.ListResourcesResultSchema); + console.log('Available resources:'); + if (resourcesResult.resources.length === 0) { + console.log(' No resources available'); + } + else { + for (const resource of resourcesResult.resources) { + console.log(` - ${resource.name}: ${resource.uri}`); + } + } + } + catch (error) { + console.log(`Resources not supported by this server (${error})`); + } +} +async function cleanup() { + if (client && transport) { + try { + // First try to terminate the session gracefully + if (transport.sessionId) { + try { + console.log('Terminating session before exit...'); + await transport.terminateSession(); + console.log('Session terminated successfully'); + } + catch (error) { + console.error('Error terminating session:', error); + } + } + // Then close the transport + await transport.close(); + } + catch (error) { + console.error('Error closing transport:', error); + } + } + process.stdin.setRawMode(false); + readline.close(); + console.log('\nGoodbye!'); + process.exit(0); +} +// Set up raw mode for keyboard input to capture Escape key +process.stdin.setRawMode(true); +process.stdin.on('data', async (data) => { + // Check for Escape key (27) + if (data.length === 1 && data[0] === 27) { + console.log('\nESC key pressed. Disconnecting from server...'); + // Abort current operation and disconnect from server + if (client && transport) { + await disconnect(); + console.log('Disconnected. Press Enter to continue.'); + } + else { + console.log('Not connected to server.'); + } + // Re-display the prompt + process.stdout.write('> '); + } +}); +// Handle Ctrl+C +process.on('SIGINT', async () => { + console.log('\nReceived SIGINT. Cleaning up...'); + await cleanup(); +}); +// Start the interactive client +main().catch((error) => { + console.error('Error running MCP client:', error); + process.exit(1); +}); +//# sourceMappingURL=simpleStreamableHttp.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/simpleStreamableHttp.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/simpleStreamableHttp.js.map new file mode 100644 index 0000000000..1493e02de8 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/simpleStreamableHttp.js.map @@ -0,0 +1 @@ +{"version":3,"file":"simpleStreamableHttp.js","sourceRoot":"","sources":["../../../../src/examples/client/simpleStreamableHttp.ts"],"names":[],"mappings":";;AAAA,oDAA+C;AAC/C,sEAA+E;AAC/E,iDAAgD;AAChD,6CAawB;AAExB,2CAA2C;AAC3C,MAAM,QAAQ,GAAG,IAAA,+BAAe,EAAC;IAC/B,KAAK,EAAE,OAAO,CAAC,KAAK;IACpB,MAAM,EAAE,OAAO,CAAC,MAAM;CACvB,CAAC,CAAC;AAEH,0DAA0D;AAC1D,IAAI,iBAAiB,GAAG,CAAC,CAAC;AAE1B,uDAAuD;AACvD,IAAI,MAAM,GAAkB,IAAI,CAAC;AACjC,IAAI,SAAS,GAAyC,IAAI,CAAC;AAC3D,IAAI,SAAS,GAAG,2BAA2B,CAAC;AAC5C,IAAI,4BAA4B,GAAuB,SAAS,CAAC;AACjE,IAAI,SAAS,GAAuB,SAAS,CAAC;AAE9C,KAAK,UAAU,IAAI;IACjB,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;IACtC,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;IAErC,sDAAsD;IACtD,MAAM,OAAO,EAAE,CAAC;IAEhB,wCAAwC;IACxC,SAAS,EAAE,CAAC;IACZ,WAAW,EAAE,CAAC;AAChB,CAAC;AAED,SAAS,SAAS;IAChB,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;IACrC,OAAO,CAAC,GAAG,CAAC,2FAA2F,CAAC,CAAC;IACzG,OAAO,CAAC,GAAG,CAAC,uDAAuD,CAAC,CAAC;IACrE,OAAO,CAAC,GAAG,CAAC,8DAA8D,CAAC,CAAC;IAC5E,OAAO,CAAC,GAAG,CAAC,wDAAwD,CAAC,CAAC;IAC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,CAAC,CAAC;AAC/B,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;IACtC,4BAA4B;IAC5B,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC;QACxC,OAAO,CAAC,GAAG,CAAC,iDAAiD,CAAC,CAAC;QAE/D,qDAAqD;QACrD,IAAI,MAAM,IAAI,SAAS,EAAE,CAAC;YACxB,MAAM,UAAU,EAAE,CAAC;YACnB,OAAO,CAAC,GAAG,CAAC,wCAAwC,CAAC,CAAC;QACxD,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;QAC1C,CAAC;QAED,wBAAwB;QACxB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,gBAAgB;AAChB,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;IAC9B,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;IACjD,MAAM,OAAO,EAAE,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,+BAA+B;AAC/B,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IAC9B,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;IAClD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/streamableHttpWithSseFallbackClient.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/streamableHttpWithSseFallbackClient.d.ts new file mode 100644 index 0000000000..c2679e6694 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/streamableHttpWithSseFallbackClient.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=streamableHttpWithSseFallbackClient.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/streamableHttpWithSseFallbackClient.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/streamableHttpWithSseFallbackClient.d.ts.map new file mode 100644 index 0000000000..b79ae2a72c --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/streamableHttpWithSseFallbackClient.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"streamableHttpWithSseFallbackClient.d.ts","sourceRoot":"","sources":["../../../../src/examples/client/streamableHttpWithSseFallbackClient.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/streamableHttpWithSseFallbackClient.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/streamableHttpWithSseFallbackClient.js new file mode 100644 index 0000000000..b34df786c2 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/streamableHttpWithSseFallbackClient.js @@ -0,0 +1,168 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const index_js_1 = require("../../client/index.js"); +const streamableHttp_js_1 = require("../../client/streamableHttp.js"); +const sse_js_1 = require("../../client/sse.js"); +const types_js_1 = require("../../types.js"); +/** + * Simplified Backwards Compatible MCP Client + * + * This client demonstrates backward compatibility with both: + * 1. Modern servers using Streamable HTTP transport (protocol version 2025-03-26) + * 2. Older servers using HTTP+SSE transport (protocol version 2024-11-05) + * + * Following the MCP specification for backwards compatibility: + * - Attempts to POST an initialize request to the server URL first (modern transport) + * - If that fails with 4xx status, falls back to GET request for SSE stream (older transport) + */ +// Command line args processing +const args = process.argv.slice(2); +const serverUrl = args[0] || 'http://localhost:3000/mcp'; +async function main() { + console.log('MCP Backwards Compatible Client'); + console.log('==============================='); + console.log(`Connecting to server at: ${serverUrl}`); + let client; + let transport; + try { + // Try connecting with automatic transport detection + const connection = await connectWithBackwardsCompatibility(serverUrl); + client = connection.client; + transport = connection.transport; + // Set up notification handler + client.setNotificationHandler(types_js_1.LoggingMessageNotificationSchema, (notification) => { + console.log(`Notification: ${notification.params.level} - ${notification.params.data}`); + }); + // DEMO WORKFLOW: + // 1. List available tools + console.log('\n=== Listing Available Tools ==='); + await listTools(client); + // 2. Call the notification tool + console.log('\n=== Starting Notification Stream ==='); + await startNotificationTool(client); + // 3. Wait for all notifications (5 seconds) + console.log('\n=== Waiting for all notifications ==='); + await new Promise(resolve => setTimeout(resolve, 5000)); + // 4. Disconnect + console.log('\n=== Disconnecting ==='); + await transport.close(); + console.log('Disconnected from MCP server'); + } + catch (error) { + console.error('Error running client:', error); + process.exit(1); + } +} +/** + * Connect to an MCP server with backwards compatibility + * Following the spec for client backward compatibility + */ +async function connectWithBackwardsCompatibility(url) { + console.log('1. Trying Streamable HTTP transport first...'); + // Step 1: Try Streamable HTTP transport first + const client = new index_js_1.Client({ + name: 'backwards-compatible-client', + version: '1.0.0' + }); + client.onerror = (error) => { + console.error('Client error:', error); + }; + const baseUrl = new URL(url); + try { + // Create modern transport + const streamableTransport = new streamableHttp_js_1.StreamableHTTPClientTransport(baseUrl); + await client.connect(streamableTransport); + console.log('Successfully connected using modern Streamable HTTP transport.'); + return { + client, + transport: streamableTransport, + transportType: 'streamable-http' + }; + } + catch (error) { + // Step 2: If transport fails, try the older SSE transport + console.log(`StreamableHttp transport connection failed: ${error}`); + console.log('2. Falling back to deprecated HTTP+SSE transport...'); + try { + // Create SSE transport pointing to /sse endpoint + const sseTransport = new sse_js_1.SSEClientTransport(baseUrl); + const sseClient = new index_js_1.Client({ + name: 'backwards-compatible-client', + version: '1.0.0' + }); + await sseClient.connect(sseTransport); + console.log('Successfully connected using deprecated HTTP+SSE transport.'); + return { + client: sseClient, + transport: sseTransport, + transportType: 'sse' + }; + } + catch (sseError) { + console.error(`Failed to connect with either transport method:\n1. Streamable HTTP error: ${error}\n2. SSE error: ${sseError}`); + throw new Error('Could not connect to server with any available transport'); + } + } +} +/** + * List available tools on the server + */ +async function listTools(client) { + try { + const toolsRequest = { + method: 'tools/list', + params: {} + }; + const toolsResult = await client.request(toolsRequest, types_js_1.ListToolsResultSchema); + console.log('Available tools:'); + if (toolsResult.tools.length === 0) { + console.log(' No tools available'); + } + else { + for (const tool of toolsResult.tools) { + console.log(` - ${tool.name}: ${tool.description}`); + } + } + } + catch (error) { + console.log(`Tools not supported by this server: ${error}`); + } +} +/** + * Start a notification stream by calling the notification tool + */ +async function startNotificationTool(client) { + try { + // Call the notification tool using reasonable defaults + const request = { + method: 'tools/call', + params: { + name: 'start-notification-stream', + arguments: { + interval: 1000, // 1 second between notifications + count: 5 // Send 5 notifications + } + } + }; + console.log('Calling notification tool...'); + const result = await client.request(request, types_js_1.CallToolResultSchema); + console.log('Tool result:'); + result.content.forEach(item => { + if (item.type === 'text') { + console.log(` ${item.text}`); + } + else { + console.log(` ${item.type} content:`, item); + } + }); + } + catch (error) { + console.log(`Error calling notification tool: ${error}`); + } +} +// Start the client +main().catch((error) => { + console.error('Error running MCP client:', error); + process.exit(1); +}); +//# sourceMappingURL=streamableHttpWithSseFallbackClient.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/streamableHttpWithSseFallbackClient.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/streamableHttpWithSseFallbackClient.js.map new file mode 100644 index 0000000000..faafacb1f3 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/client/streamableHttpWithSseFallbackClient.js.map @@ -0,0 +1 @@ +{"version":3,"file":"streamableHttpWithSseFallbackClient.js","sourceRoot":"","sources":["../../../../src/examples/client/streamableHttpWithSseFallbackClient.ts"],"names":[],"mappings":";;AAAA,oDAA+C;AAC/C,sEAA+E;AAC/E,gDAAyD;AACzD,6CAMwB;AAExB;;;;;;;;;;GAUG;AAEH,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,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/demoInMemoryOAuthProvider.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/demoInMemoryOAuthProvider.d.ts new file mode 100644 index 0000000000..80364629ed --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/demoInMemoryOAuthProvider.d.ts @@ -0,0 +1,70 @@ +import { AuthorizationParams, OAuthServerProvider } from '../../server/auth/provider.js'; +import { OAuthRegisteredClientsStore } from '../../server/auth/clients.js'; +import { OAuthClientInformationFull, OAuthMetadata, OAuthTokens } from 'src/shared/auth.js'; +import { Response } from "express"; +import { AuthInfo } from 'src/server/auth/types.js'; +export declare class DemoInMemoryClientsStore implements OAuthRegisteredClientsStore { + private clients; + getClient(clientId: string): Promise<{ + redirect_uris: string[]; + client_id: string; + jwks_uri?: string | undefined; + scope?: string | undefined; + token_endpoint_auth_method?: string | undefined; + grant_types?: string[] | undefined; + response_types?: string[] | undefined; + client_name?: string | undefined; + client_uri?: string | undefined; + logo_uri?: string | undefined; + contacts?: string[] | undefined; + tos_uri?: string | undefined; + policy_uri?: string | undefined; + jwks?: any; + software_id?: string | undefined; + software_version?: string | undefined; + client_secret?: string | undefined; + client_id_issued_at?: number | undefined; + client_secret_expires_at?: number | undefined; + } | undefined>; + registerClient(clientMetadata: OAuthClientInformationFull): Promise<{ + redirect_uris: string[]; + client_id: string; + jwks_uri?: string | undefined; + scope?: string | undefined; + token_endpoint_auth_method?: string | undefined; + grant_types?: string[] | undefined; + response_types?: string[] | undefined; + client_name?: string | undefined; + client_uri?: string | undefined; + logo_uri?: string | undefined; + contacts?: string[] | undefined; + tos_uri?: string | undefined; + policy_uri?: string | undefined; + jwks?: any; + software_id?: string | undefined; + software_version?: string | undefined; + client_secret?: string | undefined; + client_id_issued_at?: number | undefined; + client_secret_expires_at?: number | undefined; + }>; +} +/** + * 🚨 DEMO ONLY - NOT FOR PRODUCTION + * + * This example demonstrates MCP OAuth flow but lacks some of the features required for production use, + * for example: + * - Persistent token storage + * - Rate limiting + */ +export declare class DemoInMemoryAuthProvider implements OAuthServerProvider { + clientsStore: DemoInMemoryClientsStore; + private codes; + private tokens; + authorize(client: OAuthClientInformationFull, params: AuthorizationParams, res: Response): Promise; + challengeForAuthorizationCode(client: OAuthClientInformationFull, authorizationCode: string): Promise; + exchangeAuthorizationCode(client: OAuthClientInformationFull, authorizationCode: string, _codeVerifier?: string): Promise; + exchangeRefreshToken(_client: OAuthClientInformationFull, _refreshToken: string, _scopes?: string[]): Promise; + verifyAccessToken(token: string): Promise; +} +export declare const setupAuthServer: (authServerUrl: URL) => OAuthMetadata; +//# sourceMappingURL=demoInMemoryOAuthProvider.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/demoInMemoryOAuthProvider.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/demoInMemoryOAuthProvider.d.ts.map new file mode 100644 index 0000000000..af1206a81e --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/demoInMemoryOAuthProvider.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"demoInMemoryOAuthProvider.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/demoInMemoryOAuthProvider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EAAE,0BAA0B,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC5F,OAAgB,EAAW,QAAQ,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIpD,qBAAa,wBAAyB,YAAW,2BAA2B;IAC1E,OAAO,CAAC,OAAO,CAAiD;IAE1D,SAAS,CAAC,QAAQ,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;IAI1B,cAAc,CAAC,cAAc,EAAE,0BAA0B;;;;;;;;;;;;;;;;;;;;;CAIhE;AAED;;;;;;;GAOG;AACH,qBAAa,wBAAyB,YAAW,mBAAmB;IAClE,YAAY,2BAAkC;IAC9C,OAAO,CAAC,KAAK,CAE4B;IACzC,OAAO,CAAC,MAAM,CAA+B;IAEvC,SAAS,CACb,MAAM,EAAE,0BAA0B,EAClC,MAAM,EAAE,mBAAmB,EAC3B,GAAG,EAAE,QAAQ,GACZ,OAAO,CAAC,IAAI,CAAC;IAoBV,6BAA6B,CACjC,MAAM,EAAE,0BAA0B,EAClC,iBAAiB,EAAE,MAAM,GACxB,OAAO,CAAC,MAAM,CAAC;IAWZ,yBAAyB,CAC7B,MAAM,EAAE,0BAA0B,EAClC,iBAAiB,EAAE,MAAM,EAGzB,aAAa,CAAC,EAAE,MAAM,GACrB,OAAO,CAAC,WAAW,CAAC;IA+BjB,oBAAoB,CACxB,OAAO,EAAE,0BAA0B,EACnC,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,MAAM,EAAE,GACjB,OAAO,CAAC,WAAW,CAAC;IAIjB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;CAa1D;AAGD,eAAO,MAAM,eAAe,kBAAmB,GAAG,KAAG,aA+DpD,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/demoInMemoryOAuthProvider.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/demoInMemoryOAuthProvider.js new file mode 100644 index 0000000000..328b7bc009 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/demoInMemoryOAuthProvider.js @@ -0,0 +1,165 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.setupAuthServer = exports.DemoInMemoryAuthProvider = exports.DemoInMemoryClientsStore = void 0; +const node_crypto_1 = require("node:crypto"); +const express_1 = __importDefault(require("express")); +const router_js_1 = require("src/server/auth/router.js"); +class DemoInMemoryClientsStore { + constructor() { + this.clients = new Map(); + } + async getClient(clientId) { + return this.clients.get(clientId); + } + async registerClient(clientMetadata) { + this.clients.set(clientMetadata.client_id, clientMetadata); + return clientMetadata; + } +} +exports.DemoInMemoryClientsStore = DemoInMemoryClientsStore; +/** + * 🚨 DEMO ONLY - NOT FOR PRODUCTION + * + * This example demonstrates MCP OAuth flow but lacks some of the features required for production use, + * for example: + * - Persistent token storage + * - Rate limiting + */ +class DemoInMemoryAuthProvider { + constructor() { + this.clientsStore = new DemoInMemoryClientsStore(); + this.codes = new Map(); + this.tokens = new Map(); + } + async authorize(client, params, res) { + const code = (0, node_crypto_1.randomUUID)(); + const searchParams = new URLSearchParams({ + code, + }); + if (params.state !== undefined) { + searchParams.set('state', params.state); + } + this.codes.set(code, { + client, + params + }); + const targetUrl = new URL(client.redirect_uris[0]); + targetUrl.search = searchParams.toString(); + res.redirect(targetUrl.toString()); + } + async challengeForAuthorizationCode(client, authorizationCode) { + // Store the challenge with the code data + const codeData = this.codes.get(authorizationCode); + if (!codeData) { + throw new Error('Invalid authorization code'); + } + return codeData.params.codeChallenge; + } + async exchangeAuthorizationCode(client, authorizationCode, + // Note: code verifier is checked in token.ts by default + // it's unused here for that reason. + _codeVerifier) { + const codeData = this.codes.get(authorizationCode); + if (!codeData) { + throw new Error('Invalid authorization code'); + } + if (codeData.client.client_id !== client.client_id) { + throw new Error(`Authorization code was not issued to this client, ${codeData.client.client_id} != ${client.client_id}`); + } + this.codes.delete(authorizationCode); + const token = (0, node_crypto_1.randomUUID)(); + const tokenData = { + token, + clientId: client.client_id, + scopes: codeData.params.scopes || [], + expiresAt: Date.now() + 3600000, // 1 hour + type: 'access' + }; + this.tokens.set(token, tokenData); + return { + access_token: token, + token_type: 'bearer', + expires_in: 3600, + scope: (codeData.params.scopes || []).join(' '), + }; + } + async exchangeRefreshToken(_client, _refreshToken, _scopes) { + throw new Error('Not implemented for example demo'); + } + async verifyAccessToken(token) { + const tokenData = this.tokens.get(token); + if (!tokenData || !tokenData.expiresAt || tokenData.expiresAt < Date.now()) { + throw new Error('Invalid or expired token'); + } + return { + token, + clientId: tokenData.clientId, + scopes: tokenData.scopes, + expiresAt: Math.floor(tokenData.expiresAt / 1000), + }; + } +} +exports.DemoInMemoryAuthProvider = DemoInMemoryAuthProvider; +const setupAuthServer = (authServerUrl) => { + // Create separate auth server app + // NOTE: This is a separate app on a separate port to illustrate + // how to separate an OAuth Authorization Server from a Resource + // server in the SDK. The SDK is not intended to be provide a standalone + // authorization server. + const provider = new DemoInMemoryAuthProvider(); + const authApp = (0, express_1.default)(); + authApp.use(express_1.default.json()); + // For introspection requests + authApp.use(express_1.default.urlencoded()); + // Add OAuth routes to the auth server + // NOTE: this will also add a protected resource metadata route, + // but it won't be used, so leave it. + authApp.use((0, router_js_1.mcpAuthRouter)({ + provider, + issuerUrl: authServerUrl, + scopesSupported: ['mcp:tools'], + })); + authApp.post('/introspect', async (req, res) => { + try { + const { token } = req.body; + if (!token) { + res.status(400).json({ error: 'Token is required' }); + return; + } + const tokenInfo = await provider.verifyAccessToken(token); + res.json({ + active: true, + client_id: tokenInfo.clientId, + scope: tokenInfo.scopes.join(' '), + exp: tokenInfo.expiresAt + }); + return; + } + catch (error) { + res.status(401).json({ + active: false, + error: 'Unauthorized', + error_description: `Invalid token: ${error}` + }); + } + }); + const auth_port = authServerUrl.port; + // Start the auth server + authApp.listen(auth_port, () => { + console.log(`OAuth Authorization Server listening on port ${auth_port}`); + }); + // Note: we could fetch this from the server, but then we end up + // with some top level async which gets annoying. + const oauthMetadata = (0, router_js_1.createOAuthMetadata)({ + provider, + issuerUrl: authServerUrl, + scopesSupported: ['mcp:tools'], + }); + oauthMetadata.introspection_endpoint = new URL("/introspect", authServerUrl).href; + return oauthMetadata; +}; +exports.setupAuthServer = setupAuthServer; +//# sourceMappingURL=demoInMemoryOAuthProvider.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/demoInMemoryOAuthProvider.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/demoInMemoryOAuthProvider.js.map new file mode 100644 index 0000000000..9a6fe56472 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/demoInMemoryOAuthProvider.js.map @@ -0,0 +1 @@ +{"version":3,"file":"demoInMemoryOAuthProvider.js","sourceRoot":"","sources":["../../../../src/examples/server/demoInMemoryOAuthProvider.ts"],"names":[],"mappings":";;;;;;AAAA,6CAAyC;AAIzC,sDAAqD;AAErD,yDAA+E;AAG/E,MAAa,wBAAwB;IAArC;QACU,YAAO,GAAG,IAAI,GAAG,EAAsC,CAAC;IAUlE,CAAC;IARC,KAAK,CAAC,SAAS,CAAC,QAAgB;QAC9B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACpC,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,cAA0C;QAC7D,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;QAC3D,OAAO,cAAc,CAAC;IACxB,CAAC;CACF;AAXD,4DAWC;AAED;;;;;;;GAOG;AACH,MAAa,wBAAwB;IAArC;QACE,iBAAY,GAAG,IAAI,wBAAwB,EAAE,CAAC;QACtC,UAAK,GAAG,IAAI,GAAG,EAEiB,CAAC;QACjC,WAAM,GAAG,IAAI,GAAG,EAAoB,CAAC;IAkG/C,CAAC;IAhGC,KAAK,CAAC,SAAS,CACb,MAAkC,EAClC,MAA2B,EAC3B,GAAa;QAEb,MAAM,IAAI,GAAG,IAAA,wBAAU,GAAE,CAAC;QAE1B,MAAM,YAAY,GAAG,IAAI,eAAe,CAAC;YACvC,IAAI;SACL,CAAC,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AAS,CAAC,SAAS;aACzB,CAAC,CAAC;YACH,OAAM;QACR,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;gBACnB,MAAM,EAAE,KAAK;gBACb,KAAK,EAAE,cAAc;gBACrB,iBAAiB,EAAE,kBAAkB,KAAK,EAAE;aAC7C,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,aAAa,CAAC,IAAI,CAAC;IACrC,wBAAwB;IACxB,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,GAAG,EAAE;QAC7B,OAAO,CAAC,GAAG,CAAC,gDAAgD,SAAS,EAAE,CAAC,CAAC;IAC3E,CAAC,CAAC,CAAC;IAEH,gEAAgE;IAChE,iDAAiD;IACjD,MAAM,aAAa,GAAkB,IAAA,+BAAmB,EAAC;QACvD,QAAQ;QACR,SAAS,EAAE,aAAa;QACxB,eAAe,EAAE,CAAC,WAAW,CAAC;KAC/B,CAAC,CAAA;IAEF,aAAa,CAAC,sBAAsB,GAAG,IAAI,GAAG,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC,IAAI,CAAC;IAElF,OAAO,aAAa,CAAC;AACvB,CAAC,CAAA;AA/DY,QAAA,eAAe,mBA+D3B"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/jsonResponseStreamableHttp.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/jsonResponseStreamableHttp.d.ts new file mode 100644 index 0000000000..477fa6bae7 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/jsonResponseStreamableHttp.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=jsonResponseStreamableHttp.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/jsonResponseStreamableHttp.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/jsonResponseStreamableHttp.d.ts.map new file mode 100644 index 0000000000..ee8117ee2e --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/jsonResponseStreamableHttp.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"jsonResponseStreamableHttp.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/jsonResponseStreamableHttp.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/jsonResponseStreamableHttp.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/jsonResponseStreamableHttp.js new file mode 100644 index 0000000000..ef2c86121f --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/jsonResponseStreamableHttp.js @@ -0,0 +1,142 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const express_1 = __importDefault(require("express")); +const node_crypto_1 = require("node:crypto"); +const mcp_js_1 = require("../../server/mcp.js"); +const streamableHttp_js_1 = require("../../server/streamableHttp.js"); +const zod_1 = require("zod"); +const types_js_1 = require("../../types.js"); +// Create an MCP server with implementation details +const getServer = () => { + const server = new mcp_js_1.McpServer({ + name: 'json-response-streamable-http-server', + version: '1.0.0', + }, { + capabilities: { + logging: {}, + } + }); + // Register a simple tool that returns a greeting + server.tool('greet', 'A simple greeting tool', { + name: zod_1.z.string().describe('Name to greet'), + }, async ({ name }) => { + return { + content: [ + { + type: 'text', + text: `Hello, ${name}!`, + }, + ], + }; + }); + // Register a tool that sends multiple greetings with notifications + server.tool('multi-greet', 'A tool that sends different greetings with delays between them', { + name: zod_1.z.string().describe('Name to greet'), + }, async ({ name }, { sendNotification }) => { + const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)); + await sendNotification({ + method: "notifications/message", + params: { level: "debug", data: `Starting multi-greet for ${name}` } + }); + await sleep(1000); // Wait 1 second before first greeting + await sendNotification({ + method: "notifications/message", + params: { level: "info", data: `Sending first greeting to ${name}` } + }); + await sleep(1000); // Wait another second before second greeting + await sendNotification({ + method: "notifications/message", + params: { level: "info", data: `Sending second greeting to ${name}` } + }); + return { + content: [ + { + type: 'text', + text: `Good morning, ${name}!`, + } + ], + }; + }); + return server; +}; +const app = (0, express_1.default)(); +app.use(express_1.default.json()); +// Map to store transports by session ID +const transports = {}; +app.post('/mcp', async (req, res) => { + console.log('Received MCP request:', req.body); + try { + // Check for existing session ID + const sessionId = req.headers['mcp-session-id']; + let transport; + if (sessionId && transports[sessionId]) { + // Reuse existing transport + transport = transports[sessionId]; + } + else if (!sessionId && (0, types_js_1.isInitializeRequest)(req.body)) { + // New initialization request - use JSON response mode + transport = new streamableHttp_js_1.StreamableHTTPServerTransport({ + sessionIdGenerator: () => (0, node_crypto_1.randomUUID)(), + enableJsonResponse: true, // Enable JSON response mode + onsessioninitialized: (sessionId) => { + // Store the transport by session ID when session is initialized + // This avoids race conditions where requests might come in before the session is stored + console.log(`Session initialized with ID: ${sessionId}`); + transports[sessionId] = transport; + } + }); + // Connect the transport to the MCP server BEFORE handling the request + const server = getServer(); + await server.connect(transport); + await transport.handleRequest(req, res, req.body); + return; // Already handled + } + else { + // Invalid request - no session ID or not initialization request + res.status(400).json({ + jsonrpc: '2.0', + error: { + code: -32000, + message: 'Bad Request: No valid session ID provided', + }, + id: null, + }); + return; + } + // Handle the request with existing transport - no need to reconnect + await transport.handleRequest(req, res, req.body); + } + catch (error) { + console.error('Error handling MCP request:', error); + if (!res.headersSent) { + res.status(500).json({ + jsonrpc: '2.0', + error: { + code: -32603, + message: 'Internal server error', + }, + id: null, + }); + } + } +}); +// Handle GET requests for SSE streams according to spec +app.get('/mcp', async (req, res) => { + // Since this is a very simple example, we don't support GET requests for this server + // The spec requires returning 405 Method Not Allowed in this case + res.status(405).set('Allow', 'POST').send('Method Not Allowed'); +}); +// Start the server +const PORT = 3000; +app.listen(PORT, () => { + console.log(`MCP Streamable HTTP Server listening on port ${PORT}`); +}); +// Handle server shutdown +process.on('SIGINT', async () => { + console.log('Shutting down server...'); + process.exit(0); +}); +//# sourceMappingURL=jsonResponseStreamableHttp.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/jsonResponseStreamableHttp.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/jsonResponseStreamableHttp.js.map new file mode 100644 index 0000000000..131069c9a9 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/jsonResponseStreamableHttp.js.map @@ -0,0 +1 @@ +{"version":3,"file":"jsonResponseStreamableHttp.js","sourceRoot":"","sources":["../../../../src/examples/server/jsonResponseStreamableHttp.ts"],"names":[],"mappings":";;;;;AAAA,sDAAqD;AACrD,6CAAyC;AACzC,gDAAgD;AAChD,sEAA+E;AAC/E,6BAAwB;AACxB,6CAAqE;AAGrE,mDAAmD;AACnD,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,MAAM,GAAG,IAAI,kBAAS,CAAC;QAC3B,IAAI,EAAE,sCAAsC;QAC5C,OAAO,EAAE,OAAO;KACjB,EAAE;QACD,YAAY,EAAE;YACZ,OAAO,EAAE,EAAE;SACZ;KACF,CAAC,CAAC;IAEH,iDAAiD;IACjD,MAAM,CAAC,IAAI,CACT,OAAO,EACP,wBAAwB,EACxB;QACE,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC;KAC3C,EACD,KAAK,EAAE,EAAE,IAAI,EAAE,EAA2B,EAAE;QAC1C,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,UAAU,IAAI,GAAG;iBACxB;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;IAEF,mEAAmE;IACnE,MAAM,CAAC,IAAI,CACT,aAAa,EACb,gEAAgE,EAChE;Q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C,GAAG,CAAC,yBAAyB,CAAC,CAAC;IACvC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/mcpServerOutputSchema.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/mcpServerOutputSchema.d.ts new file mode 100644 index 0000000000..a6cb497473 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/mcpServerOutputSchema.d.ts @@ -0,0 +1,7 @@ +#!/usr/bin/env node +/** + * Example MCP server using the high-level McpServer API with outputSchema + * This demonstrates how to easily create tools with structured output + */ +export {}; +//# sourceMappingURL=mcpServerOutputSchema.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/mcpServerOutputSchema.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/mcpServerOutputSchema.d.ts.map new file mode 100644 index 0000000000..bd3abdcc26 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/mcpServerOutputSchema.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"mcpServerOutputSchema.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/mcpServerOutputSchema.ts"],"names":[],"mappings":";AACA;;;GAGG"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/mcpServerOutputSchema.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/mcpServerOutputSchema.js new file mode 100644 index 0000000000..54be009f4a --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/mcpServerOutputSchema.js @@ -0,0 +1,70 @@ +#!/usr/bin/env node +"use strict"; +/** + * Example MCP server using the high-level McpServer API with outputSchema + * This demonstrates how to easily create tools with structured output + */ +Object.defineProperty(exports, "__esModule", { value: true }); +const mcp_js_1 = require("../../server/mcp.js"); +const stdio_js_1 = require("../../server/stdio.js"); +const zod_1 = require("zod"); +const server = new mcp_js_1.McpServer({ + name: "mcp-output-schema-high-level-example", + version: "1.0.0", +}); +// Define a tool with structured output - Weather data +server.registerTool("get_weather", { + description: "Get weather information for a city", + inputSchema: { + city: zod_1.z.string().describe("City name"), + country: zod_1.z.string().describe("Country code (e.g., US, UK)") + }, + outputSchema: { + temperature: zod_1.z.object({ + celsius: zod_1.z.number(), + fahrenheit: zod_1.z.number() + }), + conditions: zod_1.z.enum(["sunny", "cloudy", "rainy", "stormy", "snowy"]), + humidity: zod_1.z.number().min(0).max(100), + wind: zod_1.z.object({ + speed_kmh: zod_1.z.number(), + direction: zod_1.z.string() + }) + }, +}, async ({ city, country }) => { + // Parameters are available but not used in this example + void city; + void country; + // Simulate weather API call + const temp_c = Math.round((Math.random() * 35 - 5) * 10) / 10; + const conditions = ["sunny", "cloudy", "rainy", "stormy", "snowy"][Math.floor(Math.random() * 5)]; + const structuredContent = { + temperature: { + celsius: temp_c, + fahrenheit: Math.round((temp_c * 9 / 5 + 32) * 10) / 10 + }, + conditions, + humidity: Math.round(Math.random() * 100), + wind: { + speed_kmh: Math.round(Math.random() * 50), + direction: ["N", "NE", "E", "SE", "S", "SW", "W", "NW"][Math.floor(Math.random() * 8)] + } + }; + return { + content: [{ + type: "text", + text: JSON.stringify(structuredContent, null, 2) + }], + structuredContent + }; +}); +async function main() { + const transport = new stdio_js_1.StdioServerTransport(); + await server.connect(transport); + console.error("High-level Output Schema Example Server running on stdio"); +} +main().catch((error) => { + console.error("Server error:", error); + process.exit(1); +}); +//# sourceMappingURL=mcpServerOutputSchema.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/mcpServerOutputSchema.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/mcpServerOutputSchema.js.map new file mode 100644 index 0000000000..e885adb494 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/mcpServerOutputSchema.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mcpServerOutputSchema.js","sourceRoot":"","sources":["../../../../src/examples/server/mcpServerOutputSchema.ts"],"names":[],"mappings":";;AACA;;;GAGG;;AAEH,gDAAgD;AAChD,oDAA6D;AAC7D,6BAAwB;AAExB,MAAM,MAAM,GAAG,IAAI,kBAAS,CAC1B;IACE,IAAI,EAAE,sCAAsC;IAC5C,OAAO,EAAE,OAAO;CACjB,CACF,CAAC;AAEF,sDAAsD;AACtD,MAAM,CAAC,YAAY,CACjB,aAAa,EACb;IACE,WAAW,EAAE,oCAAoC;IACjD,WAAW,EAAE;QACX,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC;QACtC,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;KAC5D;IACD,YAAY,EAAE;QACZ,WAAW,EAAE,OAAC,CAAC,MAAM,CAAC;YACpB,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;YACnB,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE;SACvB,CAAC;QACF,UAAU,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;QACnE,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;QACpC,IAAI,EAAE,OAAC,CAAC,MAAM,CAAC;YACb,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;YACrB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;SACtB,CAAC;KACH;CACF,EACD,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE;IAC1B,wDAAwD;IACxD,KAAK,IAAI,CAAC;IACV,KAAK,OAAO,CAAC;IACb,4BAA4B;IAC5B,MAAM,MAAM,GAAG,IAAI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AC;IAChC,OAAO,CAAC,KAAK,CAAC,0DAA0D,CAAC,CAAC;AAC5E,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;IACtC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleSseServer.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleSseServer.d.ts new file mode 100644 index 0000000000..4269b7814f --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleSseServer.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=simpleSseServer.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleSseServer.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleSseServer.d.ts.map new file mode 100644 index 0000000000..08a1b45021 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleSseServer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"simpleSseServer.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/simpleSseServer.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleSseServer.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleSseServer.js new file mode 100644 index 0000000000..7ca1c62e94 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleSseServer.js @@ -0,0 +1,148 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const express_1 = __importDefault(require("express")); +const mcp_js_1 = require("../../server/mcp.js"); +const sse_js_1 = require("../../server/sse.js"); +const zod_1 = require("zod"); +/** + * This example server demonstrates the deprecated HTTP+SSE transport + * (protocol version 2024-11-05). It mainly used for testing backward compatible clients. + * + * The server exposes two endpoints: + * - /mcp: For establishing the SSE stream (GET) + * - /messages: For receiving client messages (POST) + * + */ +// Create an MCP server instance +const getServer = () => { + const server = new mcp_js_1.McpServer({ + name: 'simple-sse-server', + version: '1.0.0', + }, { capabilities: { logging: {} } }); + server.tool('start-notification-stream', 'Starts sending periodic notifications', { + interval: zod_1.z.number().describe('Interval in milliseconds between notifications').default(1000), + count: zod_1.z.number().describe('Number of notifications to send').default(10), + }, async ({ interval, count }, { sendNotification }) => { + const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)); + let counter = 0; + // Send the initial notification + await sendNotification({ + method: "notifications/message", + params: { + level: "info", + data: `Starting notification stream with ${count} messages every ${interval}ms` + } + }); + // Send periodic notifications + while (counter < count) { + counter++; + await sleep(interval); + try { + await sendNotification({ + method: "notifications/message", + params: { + level: "info", + data: `Notification #${counter} at ${new Date().toISOString()}` + } + }); + } + catch (error) { + console.error("Error sending notification:", error); + } + } + return { + content: [ + { + type: 'text', + text: `Completed sending ${count} notifications every ${interval}ms`, + } + ], + }; + }); + return server; +}; +const app = (0, express_1.default)(); +app.use(express_1.default.json()); +// Store transports by session ID +const transports = {}; +// SSE endpoint for establishing the stream +app.get('/mcp', async (req, res) => { + console.log('Received GET request to /sse (establishing SSE stream)'); + try { + // Create a new SSE transport for the client + // The endpoint for POST messages is '/messages' + const transport = new sse_js_1.SSEServerTransport('/messages', res); + // Store the transport by session ID + const sessionId = transport.sessionId; + transports[sessionId] = transport; + // Set up onclose handler to clean up transport when closed + transport.onclose = () => { + console.log(`SSE transport closed for session ${sessionId}`); + delete transports[sessionId]; + }; + // Connect the transport to the MCP server + const server = getServer(); + await server.connect(transport); + console.log(`Established SSE stream with session ID: ${sessionId}`); + } + catch (error) { + console.error('Error establishing SSE stream:', error); + if (!res.headersSent) { + res.status(500).send('Error establishing SSE stream'); + } + } +}); +// Messages endpoint for receiving client JSON-RPC requests +app.post('/messages', async (req, res) => { + console.log('Received POST request to /messages'); + // Extract session ID from URL query parameter + // In the SSE protocol, this is added by the client based on the endpoint event + const sessionId = req.query.sessionId; + if (!sessionId) { + console.error('No session ID provided in request URL'); + res.status(400).send('Missing sessionId parameter'); + return; + } + const transport = transports[sessionId]; + if (!transport) { + console.error(`No active transport found for session ID: ${sessionId}`); + res.status(404).send('Session not found'); + return; + } + try { + // Handle the POST message with the transport + await transport.handlePostMessage(req, res, req.body); + } + catch (error) { + console.error('Error handling request:', error); + if (!res.headersSent) { + res.status(500).send('Error handling request'); + } + } +}); +// Start the server +const PORT = 3000; +app.listen(PORT, () => { + console.log(`Simple SSE Server (deprecated protocol version 2024-11-05) listening on port ${PORT}`); +}); +// Handle server shutdown +process.on('SIGINT', async () => { + console.log('Shutting down server...'); + // Close all active transports to properly clean up resources + for (const sessionId in transports) { + try { + console.log(`Closing transport for session ${sessionId}`); + await transports[sessionId].close(); + delete transports[sessionId]; + } + catch (error) { + console.error(`Error closing transport for session ${sessionId}:`, error); + } + } + console.log('Server shutdown complete'); + process.exit(0); +}); +//# sourceMappingURL=simpleSseServer.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleSseServer.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleSseServer.js.map new file mode 100644 index 0000000000..be65f3ca61 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleSseServer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"simpleSseServer.js","sourceRoot":"","sources":["../../../../src/examples/server/simpleSseServer.ts"],"names":[],"mappings":";;;;;AAAA,sDAAqD;AACrD,gDAAgD;AAChD,gDAAyD;AACzD,6BAAwB;AAGxB;;;;;;;;GAQG;AAEH,gCAAgC;AAChC,MAAM,SAAS,GAAG,GAAG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CAAC;QAChD,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;YACrB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QACjD,CAAC;IACH,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,mBAAmB;AACnB,MAAM,IAAI,GAAG,IAAI,CAAC;AAClB,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE;IACpB,OAAO,CAAC,GAAG,CAAC,gFAAgF,IAAI,EAAE,CAAC,CAAC;AACtG,CAAC,CAAC,CAAC;AAEH,yBAAyB;AACzB,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;IAC9B,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;IAEvC,6DAA6D;IAC7D,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,IAAI,CAAC;YACH,OAAO,CAAC,GAAG,CAAC,iCAAiC,SAAS,EAAE,CAAC,CAAC;YAC1D,MAAM,UAAU,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,CAAC;YACpC,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC;QAC/B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,uCAAuC,SAAS,GAAG,EAAE,KAAK,CAAC,CAAC;QAC5E,CAAC;IACH,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;IACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleStatelessStreamableHttp.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleStatelessStreamableHttp.d.ts new file mode 100644 index 0000000000..0aa4ad2439 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleStatelessStreamableHttp.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=simpleStatelessStreamableHttp.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleStatelessStreamableHttp.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleStatelessStreamableHttp.d.ts.map new file mode 100644 index 0000000000..92deb06ecb --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleStatelessStreamableHttp.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"simpleStatelessStreamableHttp.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/simpleStatelessStreamableHttp.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleStatelessStreamableHttp.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleStatelessStreamableHttp.js new file mode 100644 index 0000000000..684d3c08f3 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleStatelessStreamableHttp.js @@ -0,0 +1,140 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const express_1 = __importDefault(require("express")); +const mcp_js_1 = require("../../server/mcp.js"); +const streamableHttp_js_1 = require("../../server/streamableHttp.js"); +const zod_1 = require("zod"); +const getServer = () => { + // Create an MCP server with implementation details + const server = new mcp_js_1.McpServer({ + name: 'stateless-streamable-http-server', + version: '1.0.0', + }, { capabilities: { logging: {} } }); + // Register a simple prompt + server.prompt('greeting-template', 'A simple greeting prompt template', { + name: zod_1.z.string().describe('Name to include in greeting'), + }, async ({ name }) => { + return { + messages: [ + { + role: 'user', + content: { + type: 'text', + text: `Please greet ${name} in a friendly manner.`, + }, + }, + ], + }; + }); + // Register a tool specifically for testing resumability + server.tool('start-notification-stream', 'Starts sending periodic notifications for testing resumability', { + interval: zod_1.z.number().describe('Interval in milliseconds between notifications').default(100), + count: zod_1.z.number().describe('Number of notifications to send (0 for 100)').default(10), + }, async ({ interval, count }, { sendNotification }) => { + const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)); + let counter = 0; + while (count === 0 || counter < count) { + counter++; + try { + await sendNotification({ + method: "notifications/message", + params: { + level: "info", + data: `Periodic notification #${counter} at ${new Date().toISOString()}` + } + }); + } + catch (error) { + console.error("Error sending notification:", error); + } + // Wait for the specified interval + await sleep(interval); + } + return { + content: [ + { + type: 'text', + text: `Started sending periodic notifications every ${interval}ms`, + } + ], + }; + }); + // Create a simple resource at a fixed URI + server.resource('greeting-resource', 'https://example.com/greetings/default', { mimeType: 'text/plain' }, async () => { + return { + contents: [ + { + uri: 'https://example.com/greetings/default', + text: 'Hello, world!', + }, + ], + }; + }); + return server; +}; +const app = (0, express_1.default)(); +app.use(express_1.default.json()); +app.post('/mcp', async (req, res) => { + const server = getServer(); + try { + const transport = new streamableHttp_js_1.StreamableHTTPServerTransport({ + sessionIdGenerator: undefined, + }); + await server.connect(transport); + await transport.handleRequest(req, res, req.body); + res.on('close', () => { + console.log('Request closed'); + transport.close(); + server.close(); + }); + } + catch (error) { + console.error('Error handling MCP request:', error); + if (!res.headersSent) { + res.status(500).json({ + jsonrpc: '2.0', + error: { + code: -32603, + message: 'Internal server error', + }, + id: null, + }); + } + } +}); +app.get('/mcp', async (req, res) => { + console.log('Received GET MCP request'); + res.writeHead(405).end(JSON.stringify({ + jsonrpc: "2.0", + error: { + code: -32000, + message: "Method not allowed." + }, + id: null + })); +}); +app.delete('/mcp', async (req, res) => { + console.log('Received DELETE MCP request'); + res.writeHead(405).end(JSON.stringify({ + jsonrpc: "2.0", + error: { + code: -32000, + message: "Method not allowed." + }, + id: null + })); +}); +// Start the server +const PORT = 3000; +app.listen(PORT, () => { + console.log(`MCP Stateless Streamable HTTP Server listening on port ${PORT}`); +}); +// Handle server shutdown +process.on('SIGINT', async () => { + console.log('Shutting down server...'); + process.exit(0); +}); +//# sourceMappingURL=simpleStatelessStreamableHttp.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleStatelessStreamableHttp.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleStatelessStreamableHttp.js.map new file mode 100644 index 0000000000..fc157d1c73 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleStatelessStreamableHttp.js.map @@ -0,0 +1 @@ +{"version":3,"file":"simpleStatelessStreamableHttp.js","sourceRoot":"","sources":["../../../../src/examples/server/simpleStatelessStreamableHttp.ts"],"names":[],"mappings":";;;;;AAAA,sDAAqD;AACrD,gDAAgD;AAChD,sEAA+E;AAC/E,6BAAwB;AAGxB,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,mDAAmD;IACnD,MAAM,MAAM,GAAG,IAAI,kBAAS,CAAC;QAC3B,IAAI,EAAE,kCAAkC;QACxC,OAAO,EAAE,OAAO;KACjB,EAAE,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAEtC,2BAA2B;IAC3B,MAAM,CAAC,MAAM,CACX,mBAAmB,EACnB,mCAAmC,EACnC;QACE,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;KACzD,EACD,KAAK,EAAE,EAAE,IAAI,EAAE,EAA4B,EAAE;QAC3C,OAAO;YACL,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,MAAM;oBACZ,OAAO,EAAE;wBACP,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,gBAAgB,IAAI,wBAAwB;qBACnD;iBACF;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;IAEF,wDAAwD;IACxD,MAAM,CAAC,IAAI,CACT,2BAA2B,EAC3B,gEAAgE,EAChE;QACE,QAAQ,EAAE,OA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No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleStreamableHttp.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleStreamableHttp.d.ts new file mode 100644 index 0000000000..a20be42ca4 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleStreamableHttp.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=simpleStreamableHttp.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleStreamableHttp.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleStreamableHttp.d.ts.map new file mode 100644 index 0000000000..e3cf042241 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleStreamableHttp.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"simpleStreamableHttp.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/simpleStreamableHttp.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleStreamableHttp.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleStreamableHttp.js new file mode 100644 index 0000000000..a4516399cf --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleStreamableHttp.js @@ -0,0 +1,338 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const express_1 = __importDefault(require("express")); +const node_crypto_1 = require("node:crypto"); +const zod_1 = require("zod"); +const mcp_js_1 = require("../../server/mcp.js"); +const streamableHttp_js_1 = require("../../server/streamableHttp.js"); +const router_js_1 = require("../../server/auth/router.js"); +const bearerAuth_js_1 = require("../../server/auth/middleware/bearerAuth.js"); +const types_js_1 = require("../../types.js"); +const inMemoryEventStore_js_1 = require("../shared/inMemoryEventStore.js"); +const demoInMemoryOAuthProvider_js_1 = require("./demoInMemoryOAuthProvider.js"); +// Check for OAuth flag +const useOAuth = process.argv.includes('--oauth'); +// Create an MCP server with implementation details +const getServer = () => { + const server = new mcp_js_1.McpServer({ + name: 'simple-streamable-http-server', + version: '1.0.0', + }, { capabilities: { logging: {} } }); + // Register a simple tool that returns a greeting + server.tool('greet', 'A simple greeting tool', { + name: zod_1.z.string().describe('Name to greet'), + }, async ({ name }) => { + return { + content: [ + { + type: 'text', + text: `Hello, ${name}!`, + }, + ], + }; + }); + // Register a tool that sends multiple greetings with notifications (with annotations) + server.tool('multi-greet', 'A tool that sends different greetings with delays between them', { + name: zod_1.z.string().describe('Name to greet'), + }, { + title: 'Multiple Greeting Tool', + readOnlyHint: true, + openWorldHint: false + }, async ({ name }, { sendNotification }) => { + const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)); + await sendNotification({ + method: "notifications/message", + params: { level: "debug", data: `Starting multi-greet for ${name}` } + }); + await sleep(1000); // Wait 1 second before first greeting + await sendNotification({ + method: "notifications/message", + params: { level: "info", data: `Sending first greeting to ${name}` } + }); + await sleep(1000); // Wait another second before second greeting + await sendNotification({ + method: "notifications/message", + params: { level: "info", data: `Sending second greeting to ${name}` } + }); + return { + content: [ + { + type: 'text', + text: `Good morning, ${name}!`, + } + ], + }; + }); + // Register a simple prompt + server.prompt('greeting-template', 'A simple greeting prompt template', { + name: zod_1.z.string().describe('Name to include in greeting'), + }, async ({ name }) => { + return { + messages: [ + { + role: 'user', + content: { + type: 'text', + text: `Please greet ${name} in a friendly manner.`, + }, + }, + ], + }; + }); + // Register a tool specifically for testing resumability + server.tool('start-notification-stream', 'Starts sending periodic notifications for testing resumability', { + interval: zod_1.z.number().describe('Interval in milliseconds between notifications').default(100), + count: zod_1.z.number().describe('Number of notifications to send (0 for 100)').default(50), + }, async ({ interval, count }, { sendNotification }) => { + const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)); + let counter = 0; + while (count === 0 || counter < count) { + counter++; + try { + await sendNotification({ + method: "notifications/message", + params: { + level: "info", + data: `Periodic notification #${counter} at ${new Date().toISOString()}` + } + }); + } + catch (error) { + console.error("Error sending notification:", error); + } + // Wait for the specified interval + await sleep(interval); + } + return { + content: [ + { + type: 'text', + text: `Started sending periodic notifications every ${interval}ms`, + } + ], + }; + }); + // Create a simple resource at a fixed URI + server.resource('greeting-resource', 'https://example.com/greetings/default', { mimeType: 'text/plain' }, async () => { + return { + contents: [ + { + uri: 'https://example.com/greetings/default', + text: 'Hello, world!', + }, + ], + }; + }); + return server; +}; +const MCP_PORT = 3000; +const AUTH_PORT = 3001; +const app = (0, express_1.default)(); +app.use(express_1.default.json()); +// Set up OAuth if enabled +let authMiddleware = null; +if (useOAuth) { + // Create auth middleware for MCP endpoints + const mcpServerUrl = new URL(`http://localhost:${MCP_PORT}`); + const authServerUrl = new URL(`http://localhost:${AUTH_PORT}`); + const oauthMetadata = (0, demoInMemoryOAuthProvider_js_1.setupAuthServer)(authServerUrl); + const tokenVerifier = { + verifyAccessToken: async (token) => { + const endpoint = oauthMetadata.introspection_endpoint; + if (!endpoint) { + throw new Error('No token verification endpoint available in metadata'); + } + const response = await fetch(endpoint, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: new URLSearchParams({ + token: token + }).toString() + }); + if (!response.ok) { + throw new Error(`Invalid or expired token: ${await response.text()}`); + } + const data = await response.json(); + // Convert the response to AuthInfo format + return { + token, + clientId: data.client_id, + scopes: data.scope ? data.scope.split(' ') : [], + expiresAt: data.exp, + }; + } + }; + // Add metadata routes to the main MCP server + app.use((0, router_js_1.mcpAuthMetadataRouter)({ + oauthMetadata, + resourceServerUrl: mcpServerUrl, + scopesSupported: ['mcp:tools'], + resourceName: 'MCP Demo Server', + })); + authMiddleware = (0, bearerAuth_js_1.requireBearerAuth)({ + verifier: tokenVerifier, + requiredScopes: ['mcp:tools'], + resourceMetadataUrl: (0, router_js_1.getOAuthProtectedResourceMetadataUrl)(mcpServerUrl), + }); +} +// Map to store transports by session ID +const transports = {}; +// MCP POST endpoint with optional auth +const mcpPostHandler = async (req, res) => { + console.log('Received MCP request:', req.body); + if (useOAuth && req.auth) { + console.log('Authenticated user:', req.auth); + } + try { + // Check for existing session ID + const sessionId = req.headers['mcp-session-id']; + let transport; + if (sessionId && transports[sessionId]) { + // Reuse existing transport + transport = transports[sessionId]; + } + else if (!sessionId && (0, types_js_1.isInitializeRequest)(req.body)) { + // New initialization request + const eventStore = new inMemoryEventStore_js_1.InMemoryEventStore(); + transport = new streamableHttp_js_1.StreamableHTTPServerTransport({ + sessionIdGenerator: () => (0, node_crypto_1.randomUUID)(), + eventStore, // Enable resumability + onsessioninitialized: (sessionId) => { + // Store the transport by session ID when session is initialized + // This avoids race conditions where requests might come in before the session is stored + console.log(`Session initialized with ID: ${sessionId}`); + transports[sessionId] = transport; + } + }); + // Set up onclose handler to clean up transport when closed + transport.onclose = () => { + const sid = transport.sessionId; + if (sid && transports[sid]) { + console.log(`Transport closed for session ${sid}, removing from transports map`); + delete transports[sid]; + } + }; + // Connect the transport to the MCP server BEFORE handling the request + // so responses can flow back through the same transport + const server = getServer(); + await server.connect(transport); + await transport.handleRequest(req, res, req.body); + return; // Already handled + } + else { + // Invalid request - no session ID or not initialization request + res.status(400).json({ + jsonrpc: '2.0', + error: { + code: -32000, + message: 'Bad Request: No valid session ID provided', + }, + id: null, + }); + return; + } + // Handle the request with existing transport - no need to reconnect + // The existing transport is already connected to the server + await transport.handleRequest(req, res, req.body); + } + catch (error) { + console.error('Error handling MCP request:', error); + if (!res.headersSent) { + res.status(500).json({ + jsonrpc: '2.0', + error: { + code: -32603, + message: 'Internal server error', + }, + id: null, + }); + } + } +}; +// Set up routes with conditional auth middleware +if (useOAuth && authMiddleware) { + app.post('/mcp', authMiddleware, mcpPostHandler); +} +else { + app.post('/mcp', mcpPostHandler); +} +// Handle GET requests for SSE streams (using built-in support from StreamableHTTP) +const mcpGetHandler = async (req, res) => { + const sessionId = req.headers['mcp-session-id']; + if (!sessionId || !transports[sessionId]) { + res.status(400).send('Invalid or missing session ID'); + return; + } + if (useOAuth && req.auth) { + console.log('Authenticated SSE connection from user:', req.auth); + } + // Check for Last-Event-ID header for resumability + const lastEventId = req.headers['last-event-id']; + if (lastEventId) { + console.log(`Client reconnecting with Last-Event-ID: ${lastEventId}`); + } + else { + console.log(`Establishing new SSE stream for session ${sessionId}`); + } + const transport = transports[sessionId]; + await transport.handleRequest(req, res); +}; +// Set up GET route with conditional auth middleware +if (useOAuth && authMiddleware) { + app.get('/mcp', authMiddleware, mcpGetHandler); +} +else { + app.get('/mcp', mcpGetHandler); +} +// Handle DELETE requests for session termination (according to MCP spec) +const mcpDeleteHandler = async (req, res) => { + const sessionId = req.headers['mcp-session-id']; + if (!sessionId || !transports[sessionId]) { + res.status(400).send('Invalid or missing session ID'); + return; + } + console.log(`Received session termination request for session ${sessionId}`); + try { + const transport = transports[sessionId]; + await transport.handleRequest(req, res); + } + catch (error) { + console.error('Error handling session termination:', error); + if (!res.headersSent) { + res.status(500).send('Error processing session termination'); + } + } +}; +// Set up DELETE route with conditional auth middleware +if (useOAuth && authMiddleware) { + app.delete('/mcp', authMiddleware, mcpDeleteHandler); +} +else { + app.delete('/mcp', mcpDeleteHandler); +} +app.listen(MCP_PORT, () => { + console.log(`MCP Streamable HTTP Server listening on port ${MCP_PORT}`); +}); +// Handle server shutdown +process.on('SIGINT', async () => { + console.log('Shutting down server...'); + // Close all active transports to properly clean up resources + for (const sessionId in transports) { + try { + console.log(`Closing transport for session ${sessionId}`); + await transports[sessionId].close(); + delete transports[sessionId]; + } + catch (error) { + console.error(`Error closing transport for session ${sessionId}:`, error); + } + } + console.log('Server shutdown complete'); + process.exit(0); +}); +//# sourceMappingURL=simpleStreamableHttp.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleStreamableHttp.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleStreamableHttp.js.map new file mode 100644 index 0000000000..50d5dbf0db --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/simpleStreamableHttp.js.map @@ -0,0 +1 @@ +{"version":3,"file":"simpleStreamableHttp.js","sourceRoot":"","sources":["../../../../src/examples/server/simpleStreamableHttp.ts"],"names":[],"mappings":";;;;;AAAA,sDAAqD;AACrD,6CAAyC;AACzC,6BAAwB;AACxB,gDAAgD;AAChD,sEAA+E;AAC/E,2DAA0G;AAC1G,8EAA+E;AAC/E,6CAA0G;AAC1G,2EAAqE;AACrE,iFAAiE;AAGjE,uBAAuB;AACvB,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;AAElD,mDAAmD;AACnD,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,MAAM,GAAG,IAAI,kBAAS,CAAC;QAC3B,IAAI,EAAE,+BAA+B;QACrC,OAAO,EAAE,OAAO;KACjB,EAAE,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAEtC,iDAAiD;IACjD,MAAM,CAAC,IAAI,CACT,OAAO,EACP,wBAAwB,EACxB;QACE,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC;KAC3C,EACD,KAAK,EAAE,EAAE,IAAI,EAAE,EAA2B,EAAE;QAC1C,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,UAAU,IAAI,GAAG;iBACxB;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;IAEF,sFAAsF;IACtF,MAAM,CAAC,IAAI,CACT,aAAa,EACb,gEAAgE,EAChE;QACE,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC;KAC3C,EACD;QACE,KAAK,EAAE,wBAAwB;QAC/B,YAAY,E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6D;IAC7D,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,IAAI,CAAC;YACH,OAAO,CAAC,GAAG,CAAC,iCAAiC,SAAS,EAAE,CAAC,CAAC;YAC1D,MAAM,UAAU,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,CAAC;YACpC,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC;QAC/B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,uCAAuC,SAAS,GAAG,EAAE,KAAK,CAAC,CAAC;QAC5E,CAAC;IACH,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;IACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.d.ts new file mode 100644 index 0000000000..c536d0c80e --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=sseAndStreamableHttpCompatibleServer.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.d.ts.map new file mode 100644 index 0000000000..fb982c84a6 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"sseAndStreamableHttpCompatibleServer.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/sseAndStreamableHttpCompatibleServer.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.js new file mode 100644 index 0000000000..3d2c754b73 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.js @@ -0,0 +1,233 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const express_1 = __importDefault(require("express")); +const node_crypto_1 = require("node:crypto"); +const mcp_js_1 = require("../../server/mcp.js"); +const streamableHttp_js_1 = require("../../server/streamableHttp.js"); +const sse_js_1 = require("../../server/sse.js"); +const zod_1 = require("zod"); +const types_js_1 = require("../../types.js"); +const inMemoryEventStore_js_1 = require("../shared/inMemoryEventStore.js"); +/** + * This example server demonstrates backwards compatibility with both: + * 1. The deprecated HTTP+SSE transport (protocol version 2024-11-05) + * 2. The Streamable HTTP transport (protocol version 2025-03-26) + * + * It maintains a single MCP server instance but exposes two transport options: + * - /mcp: The new Streamable HTTP endpoint (supports GET/POST/DELETE) + * - /sse: The deprecated SSE endpoint for older clients (GET to establish stream) + * - /messages: The deprecated POST endpoint for older clients (POST to send messages) + */ +const getServer = () => { + const server = new mcp_js_1.McpServer({ + name: 'backwards-compatible-server', + version: '1.0.0', + }, { capabilities: { logging: {} } }); + // Register a simple tool that sends notifications over time + server.tool('start-notification-stream', 'Starts sending periodic notifications for testing resumability', { + interval: zod_1.z.number().describe('Interval in milliseconds between notifications').default(100), + count: zod_1.z.number().describe('Number of notifications to send (0 for 100)').default(50), + }, async ({ interval, count }, { sendNotification }) => { + const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)); + let counter = 0; + while (count === 0 || counter < count) { + counter++; + try { + await sendNotification({ + method: "notifications/message", + params: { + level: "info", + data: `Periodic notification #${counter} at ${new Date().toISOString()}` + } + }); + } + catch (error) { + console.error("Error sending notification:", error); + } + // Wait for the specified interval + await sleep(interval); + } + return { + content: [ + { + type: 'text', + text: `Started sending periodic notifications every ${interval}ms`, + } + ], + }; + }); + return server; +}; +// Create Express application +const app = (0, express_1.default)(); +app.use(express_1.default.json()); +// Store transports by session ID +const transports = {}; +//============================================================================= +// STREAMABLE HTTP TRANSPORT (PROTOCOL VERSION 2025-03-26) +//============================================================================= +// Handle all MCP Streamable HTTP requests (GET, POST, DELETE) on a single endpoint +app.all('/mcp', async (req, res) => { + console.log(`Received ${req.method} request to /mcp`); + try { + // Check for existing session ID + const sessionId = req.headers['mcp-session-id']; + let transport; + if (sessionId && transports[sessionId]) { + // Check if the transport is of the correct type + const existingTransport = transports[sessionId]; + if (existingTransport instanceof streamableHttp_js_1.StreamableHTTPServerTransport) { + // Reuse existing transport + transport = existingTransport; + } + else { + // Transport exists but is not a StreamableHTTPServerTransport (could be SSEServerTransport) + res.status(400).json({ + jsonrpc: '2.0', + error: { + code: -32000, + message: 'Bad Request: Session exists but uses a different transport protocol', + }, + id: null, + }); + return; + } + } + else if (!sessionId && req.method === 'POST' && (0, types_js_1.isInitializeRequest)(req.body)) { + const eventStore = new inMemoryEventStore_js_1.InMemoryEventStore(); + transport = new streamableHttp_js_1.StreamableHTTPServerTransport({ + sessionIdGenerator: () => (0, node_crypto_1.randomUUID)(), + eventStore, // Enable resumability + onsessioninitialized: (sessionId) => { + // Store the transport by session ID when session is initialized + console.log(`StreamableHTTP session initialized with ID: ${sessionId}`); + transports[sessionId] = transport; + } + }); + // Set up onclose handler to clean up transport when closed + transport.onclose = () => { + const sid = transport.sessionId; + if (sid && transports[sid]) { + console.log(`Transport closed for session ${sid}, removing from transports map`); + delete transports[sid]; + } + }; + // Connect the transport to the MCP server + const server = getServer(); + await server.connect(transport); + } + else { + // Invalid request - no session ID or not initialization request + res.status(400).json({ + jsonrpc: '2.0', + error: { + code: -32000, + message: 'Bad Request: No valid session ID provided', + }, + id: null, + }); + return; + } + // Handle the request with the transport + await transport.handleRequest(req, res, req.body); + } + catch (error) { + console.error('Error handling MCP request:', error); + if (!res.headersSent) { + res.status(500).json({ + jsonrpc: '2.0', + error: { + code: -32603, + message: 'Internal server error', + }, + id: null, + }); + } + } +}); +//============================================================================= +// DEPRECATED HTTP+SSE TRANSPORT (PROTOCOL VERSION 2024-11-05) +//============================================================================= +app.get('/sse', async (req, res) => { + console.log('Received GET request to /sse (deprecated SSE transport)'); + const transport = new sse_js_1.SSEServerTransport('/messages', res); + transports[transport.sessionId] = transport; + res.on("close", () => { + delete transports[transport.sessionId]; + }); + const server = getServer(); + await server.connect(transport); +}); +app.post("/messages", async (req, res) => { + const sessionId = req.query.sessionId; + let transport; + const existingTransport = transports[sessionId]; + if (existingTransport instanceof sse_js_1.SSEServerTransport) { + // Reuse existing transport + transport = existingTransport; + } + else { + // Transport exists but is not a SSEServerTransport (could be StreamableHTTPServerTransport) + res.status(400).json({ + jsonrpc: '2.0', + error: { + code: -32000, + message: 'Bad Request: Session exists but uses a different transport protocol', + }, + id: null, + }); + return; + } + if (transport) { + await transport.handlePostMessage(req, res, req.body); + } + else { + res.status(400).send('No transport found for sessionId'); + } +}); +// Start the server +const PORT = 3000; +app.listen(PORT, () => { + console.log(`Backwards compatible MCP server listening on port ${PORT}`); + console.log(` +============================================== +SUPPORTED TRANSPORT OPTIONS: + +1. Streamable Http(Protocol version: 2025-03-26) + Endpoint: /mcp + Methods: GET, POST, DELETE + Usage: + - Initialize with POST to /mcp + - Establish SSE stream with GET to /mcp + - Send requests with POST to /mcp + - Terminate session with DELETE to /mcp + +2. Http + SSE (Protocol version: 2024-11-05) + Endpoints: /sse (GET) and /messages (POST) + Usage: + - Establish SSE stream with GET to /sse + - Send requests with POST to /messages?sessionId= +============================================== +`); +}); +// Handle server shutdown +process.on('SIGINT', async () => { + console.log('Shutting down server...'); + // Close all active transports to properly clean up resources + for (const sessionId in transports) { + try { + console.log(`Closing transport for session ${sessionId}`); + await transports[sessionId].close(); + delete transports[sessionId]; + } + catch (error) { + console.error(`Error closing transport for session ${sessionId}:`, error); + } + } + console.log('Server shutdown complete'); + process.exit(0); +}); +//# sourceMappingURL=sseAndStreamableHttpCompatibleServer.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.js.map new file mode 100644 index 0000000000..d65b1d84a1 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sseAndStreamableHttpCompatibleServer.js","sourceRoot":"","sources":["../../../../src/examples/server/sseAndStreamableHttpCompatibleServer.ts"],"names":[],"mappings":";;;;;AAAA,sDAAqD;AACrD,6CAAyC;AACzC,gDAAgD;AAChD,sEAA+E;AAC/E,gDAAyD;AACzD,6BAAwB;AACxB,6CAAqE;AACrE,2EAAqE;AAErE;;;;;;;;;GASG;AAEH,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,MAAM,GAAG,IAAI,kBAAS,CAAC;QAC3B,IAAI,EAAE,6BAA6B;QACnC,OAAO,EAAE,OAAO;KACjB,EAAE,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAEtC,4DAA4D;IAC5D,MAAM,CAAC,IAAI,CACT,2BAA2B,EAC3B,gEAAgE,EAChE;QACE,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gDAAgD,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC;QAC5F,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6CAA6C,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;KACtF,EACD,KAAK,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE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I,CAAC,CAAC;IACxD,CAAC;SAAM,CAAC;QACN,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;IAC3D,CAAC;AACH,CAAC,CAAC,CAAC;AAGH,mBAAmB;AACnB,MAAM,IAAI,GAAG,IAAI,CAAC;AAClB,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE;IACpB,OAAO,CAAC,GAAG,CAAC,qDAAqD,IAAI,EAAE,CAAC,CAAC;IACzE,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;;;;;CAmBb,CAAC,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,yBAAyB;AACzB,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;IAC9B,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;IAEvC,6DAA6D;IAC7D,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,IAAI,CAAC;YACH,OAAO,CAAC,GAAG,CAAC,iCAAiC,SAAS,EAAE,CAAC,CAAC;YAC1D,MAAM,UAAU,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,CAAC;YACpC,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC;QAC/B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,uCAAuC,SAAS,GAAG,EAAE,KAAK,CAAC,CAAC;QAC5E,CAAC;IACH,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;IACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.d.ts new file mode 100644 index 0000000000..4df17831b7 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=standaloneSseWithGetStreamableHttp.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.d.ts.map new file mode 100644 index 0000000000..df60dc51b0 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"standaloneSseWithGetStreamableHttp.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/standaloneSseWithGetStreamableHttp.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.js new file mode 100644 index 0000000000..acf5cda833 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.js @@ -0,0 +1,112 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const express_1 = __importDefault(require("express")); +const node_crypto_1 = require("node:crypto"); +const mcp_js_1 = require("../../server/mcp.js"); +const streamableHttp_js_1 = require("../../server/streamableHttp.js"); +const types_js_1 = require("../../types.js"); +// Create an MCP server with implementation details +const server = new mcp_js_1.McpServer({ + name: 'resource-list-changed-notification-server', + version: '1.0.0', +}); +// Store transports by session ID to send notifications +const transports = {}; +const addResource = (name, content) => { + const uri = `https://mcp-example.com/dynamic/${encodeURIComponent(name)}`; + server.resource(name, uri, { mimeType: 'text/plain', description: `Dynamic resource: ${name}` }, async () => { + return { + contents: [{ uri, text: content }], + }; + }); +}; +addResource('example-resource', 'Initial content for example-resource'); +const resourceChangeInterval = setInterval(() => { + const name = (0, node_crypto_1.randomUUID)(); + addResource(name, `Content for ${name}`); +}, 5000); // Change resources every 5 seconds for testing +const app = (0, express_1.default)(); +app.use(express_1.default.json()); +app.post('/mcp', async (req, res) => { + console.log('Received MCP request:', req.body); + try { + // Check for existing session ID + const sessionId = req.headers['mcp-session-id']; + let transport; + if (sessionId && transports[sessionId]) { + // Reuse existing transport + transport = transports[sessionId]; + } + else if (!sessionId && (0, types_js_1.isInitializeRequest)(req.body)) { + // New initialization request + transport = new streamableHttp_js_1.StreamableHTTPServerTransport({ + sessionIdGenerator: () => (0, node_crypto_1.randomUUID)(), + onsessioninitialized: (sessionId) => { + // Store the transport by session ID when session is initialized + // This avoids race conditions where requests might come in before the session is stored + console.log(`Session initialized with ID: ${sessionId}`); + transports[sessionId] = transport; + } + }); + // Connect the transport to the MCP server + await server.connect(transport); + // Handle the request - the onsessioninitialized callback will store the transport + await transport.handleRequest(req, res, req.body); + return; // Already handled + } + else { + // Invalid request - no session ID or not initialization request + res.status(400).json({ + jsonrpc: '2.0', + error: { + code: -32000, + message: 'Bad Request: No valid session ID provided', + }, + id: null, + }); + return; + } + // Handle the request with existing transport + await transport.handleRequest(req, res, req.body); + } + catch (error) { + console.error('Error handling MCP request:', error); + if (!res.headersSent) { + res.status(500).json({ + jsonrpc: '2.0', + error: { + code: -32603, + message: 'Internal server error', + }, + id: null, + }); + } + } +}); +// Handle GET requests for SSE streams (now using built-in support from StreamableHTTP) +app.get('/mcp', async (req, res) => { + const sessionId = req.headers['mcp-session-id']; + if (!sessionId || !transports[sessionId]) { + res.status(400).send('Invalid or missing session ID'); + return; + } + console.log(`Establishing SSE stream for session ${sessionId}`); + const transport = transports[sessionId]; + await transport.handleRequest(req, res); +}); +// Start the server +const PORT = 3000; +app.listen(PORT, () => { + console.log(`Server listening on port ${PORT}`); +}); +// Handle server shutdown +process.on('SIGINT', async () => { + console.log('Shutting down server...'); + clearInterval(resourceChangeInterval); + await server.close(); + process.exit(0); +}); +//# sourceMappingURL=standaloneSseWithGetStreamableHttp.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.js.map new file mode 100644 index 0000000000..f5de13961a --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.js.map @@ -0,0 +1 @@ +{"version":3,"file":"standaloneSseWithGetStreamableHttp.js","sourceRoot":"","sources":["../../../../src/examples/server/standaloneSseWithGetStreamableHttp.ts"],"names":[],"mappings":";;;;;AAAA,sDAAqD;AACrD,6CAAyC;AACzC,gDAAgD;AAChD,sEAA+E;AAC/E,6CAAyE;AAEzE,mDAAmD;AACnD,MAAM,MAAM,GAAG,IAAI,kBAAS,CAAC;IAC3B,IAAI,EAAE,2CAA2C;IACjD,OAAO,EAAE,OAAO;CACjB,CAAC,CAAC;AAEH,uDAAuD;AACvD,MAAM,UAAU,GAA2D,EAAE,CAAC;AAE9E,MAAM,WAAW,GAAG,CAAC,IAAY,EAAE,OAAe,EAAE,EAAE;IACpD,MAAM,GAAG,GAAG,mCAAmC,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC;IAC1E,MAAM,CAAC,QAAQ,CACb,IAAI,EACJ,GAAG,EACH,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,qBAAqB,IAAI,EAAE,EAAE,EACpE,KAAK,IAAiC,EAAE;QACtC,OAAO;YACL,QAAQ,EAAE,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;SACnC,CAAC;IACJ,CAAC,CACF,CAAC;AAEJ,CAAC,CAAC;AAEF,WAAW,CAAC,kBAAkB,EAAE,sCAAsC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I,CAAC,+BAA+B,CAAC,CAAC;QACtD,OAAO;IACT,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,uCAAuC,SAAS,EAAE,CAAC,CAAC;IAChE,MAAM,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;IACxC,MAAM,SAAS,CAAC,aAAa,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAC1C,CAAC,CAAC,CAAC;AAGH,mBAAmB;AACnB,MAAM,IAAI,GAAG,IAAI,CAAC;AAClB,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE;IACpB,OAAO,CAAC,GAAG,CAAC,4BAA4B,IAAI,EAAE,CAAC,CAAC;AAClD,CAAC,CAAC,CAAC;AAEH,yBAAyB;AACzB,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;IAC9B,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;IACvC,aAAa,CAAC,sBAAsB,CAAC,CAAC;IACtC,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;IACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/shared/inMemoryEventStore.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/shared/inMemoryEventStore.d.ts new file mode 100644 index 0000000000..26ff38cf93 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/shared/inMemoryEventStore.d.ts @@ -0,0 +1,31 @@ +import { JSONRPCMessage } from '../../types.js'; +import { EventStore } from '../../server/streamableHttp.js'; +/** + * Simple in-memory implementation of the EventStore interface for resumability + * This is primarily intended for examples and testing, not for production use + * where a persistent storage solution would be more appropriate. + */ +export declare class InMemoryEventStore implements EventStore { + private events; + /** + * Generates a unique event ID for a given stream ID + */ + private generateEventId; + /** + * Extracts the stream ID from an event ID + */ + private getStreamIdFromEventId; + /** + * Stores an event with a generated event ID + * Implements EventStore.storeEvent + */ + storeEvent(streamId: string, message: JSONRPCMessage): Promise; + /** + * Replays events that occurred after a specific event ID + * Implements EventStore.replayEventsAfter + */ + replayEventsAfter(lastEventId: string, { send }: { + send: (eventId: string, message: JSONRPCMessage) => Promise; + }): Promise; +} +//# sourceMappingURL=inMemoryEventStore.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/shared/inMemoryEventStore.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/shared/inMemoryEventStore.d.ts.map new file mode 100644 index 0000000000..b7d1ba4b79 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/shared/inMemoryEventStore.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inMemoryEventStore.d.ts","sourceRoot":"","sources":["../../../../src/examples/shared/inMemoryEventStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAE5D;;;;GAIG;AACH,qBAAa,kBAAmB,YAAW,UAAU;IACnD,OAAO,CAAC,MAAM,CAAyE;IAEvF;;OAEG;IACH,OAAO,CAAC,eAAe;IAIvB;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAK9B;;;OAGG;IACG,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;IAM5E;;;OAGG;IACG,iBAAiB,CAAC,WAAW,EAAE,MAAM,EACzC,EAAE,IAAI,EAAE,EAAE;QAAE,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;KAAE,GAC9E,OAAO,CAAC,MAAM,CAAC;CAkCnB"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/shared/inMemoryEventStore.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/shared/inMemoryEventStore.js new file mode 100644 index 0000000000..d33ffdb5c1 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/shared/inMemoryEventStore.js @@ -0,0 +1,69 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InMemoryEventStore = void 0; +/** + * Simple in-memory implementation of the EventStore interface for resumability + * This is primarily intended for examples and testing, not for production use + * where a persistent storage solution would be more appropriate. + */ +class InMemoryEventStore { + constructor() { + this.events = new Map(); + } + /** + * Generates a unique event ID for a given stream ID + */ + generateEventId(streamId) { + return `${streamId}_${Date.now()}_${Math.random().toString(36).substring(2, 10)}`; + } + /** + * Extracts the stream ID from an event ID + */ + getStreamIdFromEventId(eventId) { + const parts = eventId.split('_'); + return parts.length > 0 ? parts[0] : ''; + } + /** + * Stores an event with a generated event ID + * Implements EventStore.storeEvent + */ + async storeEvent(streamId, message) { + const eventId = this.generateEventId(streamId); + this.events.set(eventId, { streamId, message }); + return eventId; + } + /** + * Replays events that occurred after a specific event ID + * Implements EventStore.replayEventsAfter + */ + async replayEventsAfter(lastEventId, { send }) { + if (!lastEventId || !this.events.has(lastEventId)) { + return ''; + } + // Extract the stream ID from the event ID + const streamId = this.getStreamIdFromEventId(lastEventId); + if (!streamId) { + return ''; + } + let foundLastEvent = false; + // Sort events by eventId for chronological ordering + const sortedEvents = [...this.events.entries()].sort((a, b) => a[0].localeCompare(b[0])); + for (const [eventId, { streamId: eventStreamId, message }] of sortedEvents) { + // Only include events from the same stream + if (eventStreamId !== streamId) { + continue; + } + // Start sending events after we find the lastEventId + if (eventId === lastEventId) { + foundLastEvent = true; + continue; + } + if (foundLastEvent) { + await send(eventId, message); + } + } + return streamId; + } +} +exports.InMemoryEventStore = InMemoryEventStore; +//# sourceMappingURL=inMemoryEventStore.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/shared/inMemoryEventStore.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/shared/inMemoryEventStore.js.map new file mode 100644 index 0000000000..b7aa3c4a33 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/examples/shared/inMemoryEventStore.js.map @@ -0,0 +1 @@ +{"version":3,"file":"inMemoryEventStore.js","sourceRoot":"","sources":["../../../../src/examples/shared/inMemoryEventStore.ts"],"names":[],"mappings":";;;AAGA;;;;GAIG;AACH,MAAa,kBAAkB;IAA/B;QACU,WAAM,GAA+D,IAAI,GAAG,EAAE,CAAC;IAmEzF,CAAC;IAjEC;;OAEG;IACK,eAAe,CAAC,QAAgB;QACtC,OAAO,GAAG,QAAQ,IAAI,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;IACpF,CAAC;IAED;;OAEG;IACK,sBAAsB,CAAC,OAAe;QAC5C,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACjC,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1C,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,UAAU,CAAC,QAAgB,EAAE,OAAuB;QACxD,MAAM,OAAO,GAAG,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;QAC/C,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;QAChD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,iBAAiB,CAAC,WAAmB,EACzC,EAAE,IAAI,EAAyE;QAE/E,IAAI,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;YAClD,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,0CAA0C;QAC1C,MAAM,QAAQ,GAAG,IAAI,CAAC,sBAAsB,CAAC,WAAW,CAAC,CAAC;QAC1D,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,IAAI,cAAc,GAAG,KAAK,CAAC;QAE3B,oDAAoD;QACpD,MAAM,YAAY,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAEzF,KAAK,MAAM,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,IAAI,YAAY,EAAE,CAAC;YAC3E,2CAA2C;YAC3C,IAAI,aAAa,KAAK,QAAQ,EAAE,CAAC;gBAC/B,SAAS;YACX,CAAC;YAED,qDAAqD;YACrD,IAAI,OAAO,KAAK,WAAW,EAAE,CAAC;gBAC5B,cAAc,GAAG,IAAI,CAAC;gBACtB,SAAS;YACX,CAAC;YAED,IAAI,cAAc,EAAE,CAAC;gBACnB,MAAM,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAC/B,CAAC;QACH,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AApED,gDAoEC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/inMemory.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/inMemory.d.ts new file mode 100644 index 0000000000..2f5ab40576 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/inMemory.d.ts @@ -0,0 +1,31 @@ +import { Transport } from "./shared/transport.js"; +import { JSONRPCMessage, RequestId } from "./types.js"; +import { AuthInfo } from "./server/auth/types.js"; +/** + * In-memory transport for creating clients and servers that talk to each other within the same process. + */ +export declare class InMemoryTransport implements Transport { + private _otherTransport?; + private _messageQueue; + onclose?: () => void; + onerror?: (error: Error) => void; + onmessage?: (message: JSONRPCMessage, extra?: { + authInfo?: AuthInfo; + }) => void; + sessionId?: string; + /** + * Creates a pair of linked in-memory transports that can communicate with each other. One should be passed to a Client and one to a Server. + */ + static createLinkedPair(): [InMemoryTransport, InMemoryTransport]; + start(): Promise; + close(): Promise; + /** + * Sends a message with optional auth info. + * This is useful for testing authentication scenarios. + */ + send(message: JSONRPCMessage, options?: { + relatedRequestId?: RequestId; + authInfo?: AuthInfo; + }): Promise; +} +//# sourceMappingURL=inMemory.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/inMemory.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/inMemory.d.ts.map new file mode 100644 index 0000000000..e5685527de --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/inMemory.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inMemory.d.ts","sourceRoot":"","sources":["../../src/inMemory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAOlD;;GAEG;AACH,qBAAa,iBAAkB,YAAW,SAAS;IACjD,OAAO,CAAC,eAAe,CAAC,CAAoB;IAC5C,OAAO,CAAC,aAAa,CAAuB;IAE5C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,QAAQ,CAAA;KAAE,KAAK,IAAI,CAAC;IAC/E,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,MAAM,CAAC,gBAAgB,IAAI,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAQ3D,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAQtB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAO5B;;;OAGG;IACG,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE;QAAE,gBAAgB,CAAC,EAAE,SAAS,CAAC;QAAC,QAAQ,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAWpH"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/inMemory.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/inMemory.js new file mode 100644 index 0000000000..9717d0a31c --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/inMemory.js @@ -0,0 +1,53 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InMemoryTransport = void 0; +/** + * In-memory transport for creating clients and servers that talk to each other within the same process. + */ +class InMemoryTransport { + constructor() { + this._messageQueue = []; + } + /** + * Creates a pair of linked in-memory transports that can communicate with each other. One should be passed to a Client and one to a Server. + */ + static createLinkedPair() { + const clientTransport = new InMemoryTransport(); + const serverTransport = new InMemoryTransport(); + clientTransport._otherTransport = serverTransport; + serverTransport._otherTransport = clientTransport; + return [clientTransport, serverTransport]; + } + async start() { + var _a; + // Process any messages that were queued before start was called + while (this._messageQueue.length > 0) { + const queuedMessage = this._messageQueue.shift(); + (_a = this.onmessage) === null || _a === void 0 ? void 0 : _a.call(this, queuedMessage.message, queuedMessage.extra); + } + } + async close() { + var _a; + const other = this._otherTransport; + this._otherTransport = undefined; + await (other === null || other === void 0 ? void 0 : other.close()); + (_a = this.onclose) === null || _a === void 0 ? void 0 : _a.call(this); + } + /** + * Sends a message with optional auth info. + * This is useful for testing authentication scenarios. + */ + async send(message, options) { + if (!this._otherTransport) { + throw new Error("Not connected"); + } + if (this._otherTransport.onmessage) { + this._otherTransport.onmessage(message, { authInfo: options === null || options === void 0 ? void 0 : options.authInfo }); + } + else { + this._otherTransport._messageQueue.push({ message, extra: { authInfo: options === null || options === void 0 ? void 0 : options.authInfo } }); + } + } +} +exports.InMemoryTransport = InMemoryTransport; +//# sourceMappingURL=inMemory.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/inMemory.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/inMemory.js.map new file mode 100644 index 0000000000..9f80c511d9 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/inMemory.js.map @@ -0,0 +1 @@ +{"version":3,"file":"inMemory.js","sourceRoot":"","sources":["../../src/inMemory.ts"],"names":[],"mappings":";;;AASA;;GAEG;AACH,MAAa,iBAAiB;IAA9B;QAEU,kBAAa,GAAoB,EAAE,CAAC;IAgD9C,CAAC;IAzCC;;OAEG;IACH,MAAM,CAAC,gBAAgB;QACrB,MAAM,eAAe,GAAG,IAAI,iBAAiB,EAAE,CAAC;QAChD,MAAM,eAAe,GAAG,IAAI,iBAAiB,EAAE,CAAC;QAChD,eAAe,CAAC,eAAe,GAAG,eAAe,CAAC;QAClD,eAAe,CAAC,eAAe,GAAG,eAAe,CAAC;QAClD,OAAO,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,KAAK;;QACT,gEAAgE;QAChE,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACrC,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,EAAG,CAAC;YAClD,MAAA,IAAI,CAAC,SAAS,qDAAG,aAAa,CAAC,OAAO,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;QAC/D,CAAC;IACH,CAAC;IAED,KAAK,CAAC,KAAK;;QACT,MAAM,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC;QACnC,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC;QACjC,MAAM,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK,EAAE,CAAA,CAAC;QACrB,MAAA,IAAI,CAAC,OAAO,oDAAI,CAAC;IACnB,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,IAAI,CAAC,OAAuB,EAAE,OAA+D;QACjG,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;QACnC,CAAC;QAED,IAAI,IAAI,CAAC,eAAe,CAAC,SAAS,EAAE,CAAC;YACnC,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,EAAE,CAAC,CAAC;QAC3E,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;QAC/F,CAAC;IACH,CAAC;CACF;AAlDD,8CAkDC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/package.json b/front_end/third_party/mcp-sdk/ajv/dist/cjs/package.json new file mode 100644 index 0000000000..b731bd61b9 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/package.json @@ -0,0 +1 @@ +{"type": "commonjs"} diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/clients.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/clients.d.ts new file mode 100644 index 0000000000..a5f1357fea --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/clients.d.ts @@ -0,0 +1,19 @@ +import { OAuthClientInformationFull } from "../../shared/auth.js"; +/** + * Stores information about registered OAuth clients for this server. + */ +export interface OAuthRegisteredClientsStore { + /** + * Returns information about a registered client, based on its ID. + */ + getClient(clientId: string): OAuthClientInformationFull | undefined | Promise; + /** + * Registers a new client with the server. The client ID and secret will be automatically generated by the library. A modified version of the client information can be returned to reflect specific values enforced by the server. + * + * NOTE: Implementations should NOT delete expired client secrets in-place. Auth middleware provided by this library will automatically check the `client_secret_expires_at` field and reject requests with expired secrets. Any custom logic for authenticating clients should check the `client_secret_expires_at` field as well. + * + * If unimplemented, dynamic client registration is unsupported. + */ + registerClient?(client: OAuthClientInformationFull): OAuthClientInformationFull | Promise; +} +//# sourceMappingURL=clients.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/clients.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/clients.d.ts.map new file mode 100644 index 0000000000..6f0ba788f7 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/clients.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"clients.d.ts","sourceRoot":"","sources":["../../../../src/server/auth/clients.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;OAEG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,0BAA0B,GAAG,SAAS,GAAG,OAAO,CAAC,0BAA0B,GAAG,SAAS,CAAC,CAAC;IAEtH;;;;;;OAMG;IACH,cAAc,CAAC,CAAC,MAAM,EAAE,0BAA0B,GAAG,0BAA0B,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;CACvH"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/clients.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/clients.js new file mode 100644 index 0000000000..866b88b74b --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/clients.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=clients.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/clients.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/clients.js.map new file mode 100644 index 0000000000..0210104422 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/clients.js.map @@ -0,0 +1 @@ +{"version":3,"file":"clients.js","sourceRoot":"","sources":["../../../../src/server/auth/clients.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/errors.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/errors.d.ts new file mode 100644 index 0000000000..7290363f9b --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/errors.d.ts @@ -0,0 +1,126 @@ +import { OAuthErrorResponse } from "../../shared/auth.js"; +/** + * Base class for all OAuth errors + */ +export declare class OAuthError extends Error { + readonly errorCode: string; + readonly errorUri?: string | undefined; + constructor(errorCode: string, message: string, errorUri?: string | undefined); + /** + * Converts the error to a standard OAuth error response object + */ + toResponseObject(): OAuthErrorResponse; +} +/** + * Invalid request error - The request is missing a required parameter, + * includes an invalid parameter value, includes a parameter more than once, + * or is otherwise malformed. + */ +export declare class InvalidRequestError extends OAuthError { + constructor(message: string, errorUri?: string); +} +/** + * Invalid client error - Client authentication failed (e.g., unknown client, no client + * authentication included, or unsupported authentication method). + */ +export declare class InvalidClientError extends OAuthError { + constructor(message: string, errorUri?: string); +} +/** + * Invalid grant error - The provided authorization grant or refresh token is + * invalid, expired, revoked, does not match the redirection URI used in the + * authorization request, or was issued to another client. + */ +export declare class InvalidGrantError extends OAuthError { + constructor(message: string, errorUri?: string); +} +/** + * Unauthorized client error - The authenticated client is not authorized to use + * this authorization grant type. + */ +export declare class UnauthorizedClientError extends OAuthError { + constructor(message: string, errorUri?: string); +} +/** + * Unsupported grant type error - The authorization grant type is not supported + * by the authorization server. + */ +export declare class UnsupportedGrantTypeError extends OAuthError { + constructor(message: string, errorUri?: string); +} +/** + * Invalid scope error - The requested scope is invalid, unknown, malformed, or + * exceeds the scope granted by the resource owner. + */ +export declare class InvalidScopeError extends OAuthError { + constructor(message: string, errorUri?: string); +} +/** + * Access denied error - The resource owner or authorization server denied the request. + */ +export declare class AccessDeniedError extends OAuthError { + constructor(message: string, errorUri?: string); +} +/** + * Server error - The authorization server encountered an unexpected condition + * that prevented it from fulfilling the request. + */ +export declare class ServerError extends OAuthError { + constructor(message: string, errorUri?: string); +} +/** + * Temporarily unavailable error - The authorization server is currently unable to + * handle the request due to a temporary overloading or maintenance of the server. + */ +export declare class TemporarilyUnavailableError extends OAuthError { + constructor(message: string, errorUri?: string); +} +/** + * Unsupported response type error - The authorization server does not support + * obtaining an authorization code using this method. + */ +export declare class UnsupportedResponseTypeError extends OAuthError { + constructor(message: string, errorUri?: string); +} +/** + * Unsupported token type error - The authorization server does not support + * the requested token type. + */ +export declare class UnsupportedTokenTypeError extends OAuthError { + constructor(message: string, errorUri?: string); +} +/** + * Invalid token error - The access token provided is expired, revoked, malformed, + * or invalid for other reasons. + */ +export declare class InvalidTokenError extends OAuthError { + constructor(message: string, errorUri?: string); +} +/** + * Method not allowed error - The HTTP method used is not allowed for this endpoint. + * (Custom, non-standard error) + */ +export declare class MethodNotAllowedError extends OAuthError { + constructor(message: string, errorUri?: string); +} +/** + * Too many requests error - Rate limit exceeded. + * (Custom, non-standard error based on RFC 6585) + */ +export declare class TooManyRequestsError extends OAuthError { + constructor(message: string, errorUri?: string); +} +/** + * Invalid client metadata error - The client metadata is invalid. + * (Custom error for dynamic client registration - RFC 7591) + */ +export declare class InvalidClientMetadataError extends OAuthError { + constructor(message: string, errorUri?: string); +} +/** + * Insufficient scope error - The request requires higher privileges than provided by the access token. + */ +export declare class InsufficientScopeError extends OAuthError { + constructor(message: string, errorUri?: string); +} +//# sourceMappingURL=errors.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/errors.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/errors.d.ts.map new file mode 100644 index 0000000000..e522108008 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/errors.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/server/auth/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK;aAEjB,SAAS,EAAE,MAAM;aAEjB,QAAQ,CAAC,EAAE,MAAM;gBAFjB,SAAS,EAAE,MAAM,EACjC,OAAO,EAAE,MAAM,EACC,QAAQ,CAAC,EAAE,MAAM,YAAA;IAMnC;;OAEG;IACH,gBAAgB,IAAI,kBAAkB;CAYvC;AAED;;;;GAIG;AACH,qBAAa,mBAAoB,SAAQ,UAAU;gBACrC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM;CAG/C;AAED;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,UAAU;gBACpC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM;CAG/C;AAED;;;;GAIG;AACH,qBAAa,iBAAkB,SAAQ,UAAU;gBACnC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM;CAG/C;AAED;;;GAGG;AACH,qBAAa,uBAAwB,SAAQ,UAAU;gBACzC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM;CAG/C;AAED;;;GAGG;AACH,qBAAa,yBAA0B,SAAQ,UAAU;gBAC3C,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EA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/C"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/errors.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/errors.js new file mode 100644 index 0000000000..7d3ecfa9e8 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/errors.js @@ -0,0 +1,189 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InsufficientScopeError = exports.InvalidClientMetadataError = exports.TooManyRequestsError = exports.MethodNotAllowedError = exports.InvalidTokenError = exports.UnsupportedTokenTypeError = exports.UnsupportedResponseTypeError = exports.TemporarilyUnavailableError = exports.ServerError = exports.AccessDeniedError = exports.InvalidScopeError = exports.UnsupportedGrantTypeError = exports.UnauthorizedClientError = exports.InvalidGrantError = exports.InvalidClientError = exports.InvalidRequestError = exports.OAuthError = void 0; +/** + * Base class for all OAuth errors + */ +class OAuthError extends Error { + constructor(errorCode, message, errorUri) { + super(message); + this.errorCode = errorCode; + this.errorUri = errorUri; + this.name = this.constructor.name; + } + /** + * Converts the error to a standard OAuth error response object + */ + toResponseObject() { + const response = { + error: this.errorCode, + error_description: this.message + }; + if (this.errorUri) { + response.error_uri = this.errorUri; + } + return response; + } +} +exports.OAuthError = OAuthError; +/** + * Invalid request error - The request is missing a required parameter, + * includes an invalid parameter value, includes a parameter more than once, + * or is otherwise malformed. + */ +class InvalidRequestError extends OAuthError { + constructor(message, errorUri) { + super("invalid_request", message, errorUri); + } +} +exports.InvalidRequestError = InvalidRequestError; +/** + * Invalid client error - Client authentication failed (e.g., unknown client, no client + * authentication included, or unsupported authentication method). + */ +class InvalidClientError extends OAuthError { + constructor(message, errorUri) { + super("invalid_client", message, errorUri); + } +} +exports.InvalidClientError = InvalidClientError; +/** + * Invalid grant error - The provided authorization grant or refresh token is + * invalid, expired, revoked, does not match the redirection URI used in the + * authorization request, or was issued to another client. + */ +class InvalidGrantError extends OAuthError { + constructor(message, errorUri) { + super("invalid_grant", message, errorUri); + } +} +exports.InvalidGrantError = InvalidGrantError; +/** + * Unauthorized client error - The authenticated client is not authorized to use + * this authorization grant type. + */ +class UnauthorizedClientError extends OAuthError { + constructor(message, errorUri) { + super("unauthorized_client", message, errorUri); + } +} +exports.UnauthorizedClientError = UnauthorizedClientError; +/** + * Unsupported grant type error - The authorization grant type is not supported + * by the authorization server. + */ +class UnsupportedGrantTypeError extends OAuthError { + constructor(message, errorUri) { + super("unsupported_grant_type", message, errorUri); + } +} +exports.UnsupportedGrantTypeError = UnsupportedGrantTypeError; +/** + * Invalid scope error - The requested scope is invalid, unknown, malformed, or + * exceeds the scope granted by the resource owner. + */ +class InvalidScopeError extends OAuthError { + constructor(message, errorUri) { + super("invalid_scope", message, errorUri); + } +} +exports.InvalidScopeError = InvalidScopeError; +/** + * Access denied error - The resource owner or authorization server denied the request. + */ +class AccessDeniedError extends OAuthError { + constructor(message, errorUri) { + super("access_denied", message, errorUri); + } +} +exports.AccessDeniedError = AccessDeniedError; +/** + * Server error - The authorization server encountered an unexpected condition + * that prevented it from fulfilling the request. + */ +class ServerError extends OAuthError { + constructor(message, errorUri) { + super("server_error", message, errorUri); + } +} +exports.ServerError = ServerError; +/** + * Temporarily unavailable error - The authorization server is currently unable to + * handle the request due to a temporary overloading or maintenance of the server. + */ +class TemporarilyUnavailableError extends OAuthError { + constructor(message, errorUri) { + super("temporarily_unavailable", message, errorUri); + } +} +exports.TemporarilyUnavailableError = TemporarilyUnavailableError; +/** + * Unsupported response type error - The authorization server does not support + * obtaining an authorization code using this method. + */ +class UnsupportedResponseTypeError extends OAuthError { + constructor(message, errorUri) { + super("unsupported_response_type", message, errorUri); + } +} +exports.UnsupportedResponseTypeError = UnsupportedResponseTypeError; +/** + * Unsupported token type error - The authorization server does not support + * the requested token type. + */ +class UnsupportedTokenTypeError extends OAuthError { + constructor(message, errorUri) { + super("unsupported_token_type", message, errorUri); + } +} +exports.UnsupportedTokenTypeError = UnsupportedTokenTypeError; +/** + * Invalid token error - The access token provided is expired, revoked, malformed, + * or invalid for other reasons. + */ +class InvalidTokenError extends OAuthError { + constructor(message, errorUri) { + super("invalid_token", message, errorUri); + } +} +exports.InvalidTokenError = InvalidTokenError; +/** + * Method not allowed error - The HTTP method used is not allowed for this endpoint. + * (Custom, non-standard error) + */ +class MethodNotAllowedError extends OAuthError { + constructor(message, errorUri) { + super("method_not_allowed", message, errorUri); + } +} +exports.MethodNotAllowedError = MethodNotAllowedError; +/** + * Too many requests error - Rate limit exceeded. + * (Custom, non-standard error based on RFC 6585) + */ +class TooManyRequestsError extends OAuthError { + constructor(message, errorUri) { + super("too_many_requests", message, errorUri); + } +} +exports.TooManyRequestsError = TooManyRequestsError; +/** + * Invalid client metadata error - The client metadata is invalid. + * (Custom error for dynamic client registration - RFC 7591) + */ +class InvalidClientMetadataError extends OAuthError { + constructor(message, errorUri) { + super("invalid_client_metadata", message, errorUri); + } +} +exports.InvalidClientMetadataError = InvalidClientMetadataError; +/** + * Insufficient scope error - The request requires higher privileges than provided by the access token. + */ +class InsufficientScopeError extends OAuthError { + constructor(message, errorUri) { + super("insufficient_scope", message, errorUri); + } +} +exports.InsufficientScopeError = InsufficientScopeError; +//# sourceMappingURL=errors.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/errors.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/errors.js.map new file mode 100644 index 0000000000..2fba15c30e --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/errors.js.map @@ -0,0 +1 @@ +{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../src/server/auth/errors.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACH,MAAa,UAAW,SAAQ,KAAK;IACnC,YACkB,SAAiB,EACjC,OAAe,EACC,QAAiB;QAEjC,KAAK,CAAC,OAAO,CAAC,CAAC;QAJC,cAAS,GAAT,SAAS,CAAQ;QAEjB,aAAQ,GAAR,QAAQ,CAAS;QAGjC,IAAI,C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AsB,SAAQ,UAAU;IACnD,YAAY,OAAe,EAAE,QAAiB;QAC5C,KAAK,CAAC,oBAAoB,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IACjD,CAAC;CACF;AAJD,sDAIC;AAED;;;GAGG;AACH,MAAa,oBAAqB,SAAQ,UAAU;IAClD,YAAY,OAAe,EAAE,QAAiB;QAC5C,KAAK,CAAC,mBAAmB,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IAChD,CAAC;CACF;AAJD,oDAIC;AAED;;;GAGG;AACH,MAAa,0BAA2B,SAAQ,UAAU;IACxD,YAAY,OAAe,EAAE,QAAiB;QAC5C,KAAK,CAAC,yBAAyB,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IACtD,CAAC;CACF;AAJD,gEAIC;AAED;;GAEG;AACH,MAAa,sBAAuB,SAAQ,UAAU;IACpD,YAAY,OAAe,EAAE,QAAiB;QAC5C,KAAK,CAAC,oBAAoB,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IACjD,CAAC;CACF;AAJD,wDAIC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/authorize.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/authorize.d.ts new file mode 100644 index 0000000000..5b3264df72 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/authorize.d.ts @@ -0,0 +1,13 @@ +import { RequestHandler } from "express"; +import { OAuthServerProvider } from "../provider.js"; +import { Options as RateLimitOptions } from "express-rate-limit"; +export type AuthorizationHandlerOptions = { + provider: OAuthServerProvider; + /** + * Rate limiting configuration for the authorization endpoint. + * Set to false to disable rate limiting for this endpoint. + */ + rateLimit?: Partial | false; +}; +export declare function authorizationHandler({ provider, rateLimit: rateLimitConfig }: AuthorizationHandlerOptions): RequestHandler; +//# sourceMappingURL=authorize.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/authorize.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/authorize.d.ts.map new file mode 100644 index 0000000000..01876056dc --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/authorize.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"authorize.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/authorize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAa,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAW5E,MAAM,MAAM,2BAA2B,GAAG;IACxC,QAAQ,EAAE,mBAAmB,CAAC;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,KAAK,CAAC;CAC/C,CAAC;AAiBF,wBAAgB,oBAAoB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,EAAE,2BAA2B,GAAG,cAAc,CAmH1H"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/authorize.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/authorize.js new file mode 100644 index 0000000000..2ec2a263f3 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/authorize.js @@ -0,0 +1,149 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.authorizationHandler = authorizationHandler; +const zod_1 = require("zod"); +const express_1 = __importDefault(require("express")); +const express_rate_limit_1 = require("express-rate-limit"); +const allowedMethods_js_1 = require("../middleware/allowedMethods.js"); +const errors_js_1 = require("../errors.js"); +// Parameters that must be validated in order to issue redirects. +const ClientAuthorizationParamsSchema = zod_1.z.object({ + client_id: zod_1.z.string(), + redirect_uri: zod_1.z.string().optional().refine((value) => value === undefined || URL.canParse(value), { message: "redirect_uri must be a valid URL" }), +}); +// Parameters that must be validated for a successful authorization request. Failure can be reported to the redirect URI. +const RequestAuthorizationParamsSchema = zod_1.z.object({ + response_type: zod_1.z.literal("code"), + code_challenge: zod_1.z.string(), + code_challenge_method: zod_1.z.literal("S256"), + scope: zod_1.z.string().optional(), + state: zod_1.z.string().optional(), +}); +function authorizationHandler({ provider, rateLimit: rateLimitConfig }) { + // Create a router to apply middleware + const router = express_1.default.Router(); + router.use((0, allowedMethods_js_1.allowedMethods)(["GET", "POST"])); + router.use(express_1.default.urlencoded({ extended: false })); + // Apply rate limiting unless explicitly disabled + if (rateLimitConfig !== false) { + router.use((0, express_rate_limit_1.rateLimit)({ + windowMs: 15 * 60 * 1000, // 15 minutes + max: 100, // 100 requests per windowMs + standardHeaders: true, + legacyHeaders: false, + message: new errors_js_1.TooManyRequestsError('You have exceeded the rate limit for authorization requests').toResponseObject(), + ...rateLimitConfig + })); + } + router.all("/", async (req, res) => { + var _a; + res.setHeader('Cache-Control', 'no-store'); + // In the authorization flow, errors are split into two categories: + // 1. Pre-redirect errors (direct response with 400) + // 2. Post-redirect errors (redirect with error parameters) + // Phase 1: Validate client_id and redirect_uri. Any errors here must be direct responses. + let client_id, redirect_uri, client; + try { + const result = ClientAuthorizationParamsSchema.safeParse(req.method === 'POST' ? req.body : req.query); + if (!result.success) { + throw new errors_js_1.InvalidRequestError(result.error.message); + } + client_id = result.data.client_id; + redirect_uri = result.data.redirect_uri; + client = await provider.clientsStore.getClient(client_id); + if (!client) { + throw new errors_js_1.InvalidClientError("Invalid client_id"); + } + if (redirect_uri !== undefined) { + if (!client.redirect_uris.includes(redirect_uri)) { + throw new errors_js_1.InvalidRequestError("Unregistered redirect_uri"); + } + } + else if (client.redirect_uris.length === 1) { + redirect_uri = client.redirect_uris[0]; + } + else { + throw new errors_js_1.InvalidRequestError("redirect_uri must be specified when client has multiple registered URIs"); + } + } + catch (error) { + // Pre-redirect errors - return direct response + // + // These don't need to be JSON encoded, as they'll be displayed in a user + // agent, but OTOH they all represent exceptional situations (arguably, + // "programmer error"), so presenting a nice HTML page doesn't help the + // user anyway. + if (error instanceof errors_js_1.OAuthError) { + const status = error instanceof errors_js_1.ServerError ? 500 : 400; + res.status(status).json(error.toResponseObject()); + } + else { + console.error("Unexpected error looking up client:", error); + const serverError = new errors_js_1.ServerError("Internal Server Error"); + res.status(500).json(serverError.toResponseObject()); + } + return; + } + // Phase 2: Validate other parameters. Any errors here should go into redirect responses. + let state; + try { + // Parse and validate authorization parameters + const parseResult = RequestAuthorizationParamsSchema.safeParse(req.method === 'POST' ? req.body : req.query); + if (!parseResult.success) { + throw new errors_js_1.InvalidRequestError(parseResult.error.message); + } + const { scope, code_challenge } = parseResult.data; + state = parseResult.data.state; + // Validate scopes + let requestedScopes = []; + if (scope !== undefined) { + requestedScopes = scope.split(" "); + const allowedScopes = new Set((_a = client.scope) === null || _a === void 0 ? void 0 : _a.split(" ")); + // Check each requested scope against allowed scopes + for (const scope of requestedScopes) { + if (!allowedScopes.has(scope)) { + throw new errors_js_1.InvalidScopeError(`Client was not registered with scope ${scope}`); + } + } + } + // All validation passed, proceed with authorization + await provider.authorize(client, { + state, + scopes: requestedScopes, + redirectUri: redirect_uri, + codeChallenge: code_challenge, + }, res); + } + catch (error) { + // Post-redirect errors - redirect with error parameters + if (error instanceof errors_js_1.OAuthError) { + res.redirect(302, createErrorRedirect(redirect_uri, error, state)); + } + else { + console.error("Unexpected error during authorization:", error); + const serverError = new errors_js_1.ServerError("Internal Server Error"); + res.redirect(302, createErrorRedirect(redirect_uri, serverError, state)); + } + } + }); + return router; +} +/** + * Helper function to create redirect URL with error parameters + */ +function createErrorRedirect(redirectUri, error, state) { + const errorUrl = new URL(redirectUri); + errorUrl.searchParams.set("error", error.errorCode); + errorUrl.searchParams.set("error_description", error.message); + if (error.errorUri) { + errorUrl.searchParams.set("error_uri", error.errorUri); + } + if (state) { + errorUrl.searchParams.set("state", state); + } + return errorUrl.href; +} +//# sourceMappingURL=authorize.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/authorize.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/authorize.js.map new file mode 100644 index 0000000000..c8d426c70c --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/authorize.js.map @@ -0,0 +1 @@ +{"version":3,"file":"authorize.js","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/authorize.ts"],"names":[],"mappings":";;;;;AAuCA,oDAmHC;AAzJD,6BAAwB;AACxB,sDAA8B;AAE9B,2DAA4E;AAC5E,uEAAiE;AACjE,4CAOsB;AAWtB,iEAAiE;AACjE,MAAM,+BAA+B,GAAG,OAAC,CAAC,MAAM,CAAC;IAC/C,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;IACrB,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,IAAI,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,kCAAkC,EAAE,CAAC;CACnJ,CAAC,CAAC;AAEH,yHAAyH;AACzH,MAAM,gCAAgC,GAAG,OAAC,CAAC,MAAM,CAAC;IAChD,aAAa,EAAE,OAAC,CAAC,OAAO,CAAC,MAAM,CAAC;IAChC,cAAc,EAAE,OAAC,CAAC,MAAM,EAAE;IAC1B,qBAAqB,EAAE,OAAC,CAAC,OAAO,CAAC,MAAM,CAAC;IACxC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAC,CAAC;AAEH,SAAg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CAAC;IAC5C,CAAC;IACD,OAAO,QAAQ,CAAC,IAAI,CAAC;AACvB,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/metadata.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/metadata.d.ts new file mode 100644 index 0000000000..f2a4c87f93 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/metadata.d.ts @@ -0,0 +1,4 @@ +import { RequestHandler } from "express"; +import { OAuthMetadata, OAuthProtectedResourceMetadata } from "../../../shared/auth.js"; +export declare function metadataHandler(metadata: OAuthMetadata | OAuthProtectedResourceMetadata): RequestHandler; +//# sourceMappingURL=metadata.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/metadata.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/metadata.d.ts.map new file mode 100644 index 0000000000..55e3a50dc1 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/metadata.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/metadata.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,8BAA8B,EAAE,MAAM,yBAAyB,CAAC;AAIxF,wBAAgB,eAAe,CAAC,QAAQ,EAAE,aAAa,GAAG,8BAA8B,GAAG,cAAc,CAaxG"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/metadata.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/metadata.js new file mode 100644 index 0000000000..2f5cebab11 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/metadata.js @@ -0,0 +1,21 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.metadataHandler = metadataHandler; +const express_1 = __importDefault(require("express")); +const cors_1 = __importDefault(require("cors")); +const allowedMethods_js_1 = require("../middleware/allowedMethods.js"); +function metadataHandler(metadata) { + // Nested router so we can configure middleware and restrict HTTP method + const router = express_1.default.Router(); + // Configure CORS to allow any origin, to make accessible to web-based MCP clients + router.use((0, cors_1.default)()); + router.use((0, allowedMethods_js_1.allowedMethods)(['GET'])); + router.get("/", (req, res) => { + res.status(200).json(metadata); + }); + return router; +} +//# sourceMappingURL=metadata.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/metadata.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/metadata.js.map new file mode 100644 index 0000000000..cd0bd9b246 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/metadata.js.map @@ -0,0 +1 @@ +{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/metadata.ts"],"names":[],"mappings":";;;;;AAKA,0CAaC;AAlBD,sDAAkD;AAElD,gDAAwB;AACxB,uEAAiE;AAEjE,SAAgB,eAAe,CAAC,QAAwD;IACtF,wEAAwE;IACxE,MAAM,MAAM,GAAG,iBAAO,CAAC,MAAM,EAAE,CAAC;IAEhC,kFAAkF;IAClF,MAAM,CAAC,GAAG,CAAC,IAAA,cAAI,GAAE,CAAC,CAAC;IAEnB,MAAM,CAAC,GAAG,CAAC,IAAA,kCAAc,EAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACpC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QAC3B,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACjC,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/register.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/register.d.ts new file mode 100644 index 0000000000..75af4dad8e --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/register.d.ts @@ -0,0 +1,23 @@ +import { RequestHandler } from "express"; +import { OAuthRegisteredClientsStore } from "../clients.js"; +import { Options as RateLimitOptions } from "express-rate-limit"; +export type ClientRegistrationHandlerOptions = { + /** + * A store used to save information about dynamically registered OAuth clients. + */ + clientsStore: OAuthRegisteredClientsStore; + /** + * The number of seconds after which to expire issued client secrets, or 0 to prevent expiration of client secrets (not recommended). + * + * If not set, defaults to 30 days. + */ + clientSecretExpirySeconds?: number; + /** + * Rate limiting configuration for the client registration endpoint. + * Set to false to disable rate limiting for this endpoint. + * Registration endpoints are particularly sensitive to abuse and should be rate limited. + */ + rateLimit?: Partial | false; +}; +export declare function clientRegistrationHandler({ clientsStore, clientSecretExpirySeconds, rateLimit: rateLimitConfig }: ClientRegistrationHandlerOptions): RequestHandler; +//# sourceMappingURL=register.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/register.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/register.d.ts.map new file mode 100644 index 0000000000..833b1fb5fc --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/register.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/register.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAIlD,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAa,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAS5E,MAAM,MAAM,gCAAgC,GAAG;IAC7C;;OAEG;IACH,YAAY,EAAE,2BAA2B,CAAC;IAE1C;;;;OAIG;IACH,yBAAyB,CAAC,EAAE,MAAM,CAAC;IAEnC;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,KAAK,CAAC;CAC/C,CAAC;AAIF,wBAAgB,yBAAyB,CAAC,EACxC,YAAY,EACZ,yBAAgE,EAChE,SAAS,EAAE,eAAe,EAC3B,EAAE,gCAAgC,GAAG,cAAc,CAyEnD"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/register.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/register.js new file mode 100644 index 0000000000..a76c8e6e2e --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/register.js @@ -0,0 +1,79 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.clientRegistrationHandler = clientRegistrationHandler; +const express_1 = __importDefault(require("express")); +const auth_js_1 = require("../../../shared/auth.js"); +const node_crypto_1 = __importDefault(require("node:crypto")); +const cors_1 = __importDefault(require("cors")); +const express_rate_limit_1 = require("express-rate-limit"); +const allowedMethods_js_1 = require("../middleware/allowedMethods.js"); +const errors_js_1 = require("../errors.js"); +const DEFAULT_CLIENT_SECRET_EXPIRY_SECONDS = 30 * 24 * 60 * 60; // 30 days +function clientRegistrationHandler({ clientsStore, clientSecretExpirySeconds = DEFAULT_CLIENT_SECRET_EXPIRY_SECONDS, rateLimit: rateLimitConfig }) { + if (!clientsStore.registerClient) { + throw new Error("Client registration store does not support registering clients"); + } + // Nested router so we can configure middleware and restrict HTTP method + const router = express_1.default.Router(); + // Configure CORS to allow any origin, to make accessible to web-based MCP clients + router.use((0, cors_1.default)()); + router.use((0, allowedMethods_js_1.allowedMethods)(["POST"])); + router.use(express_1.default.json()); + // Apply rate limiting unless explicitly disabled - stricter limits for registration + if (rateLimitConfig !== false) { + router.use((0, express_rate_limit_1.rateLimit)({ + windowMs: 60 * 60 * 1000, // 1 hour + max: 20, // 20 requests per hour - stricter as registration is sensitive + standardHeaders: true, + legacyHeaders: false, + message: new errors_js_1.TooManyRequestsError('You have exceeded the rate limit for client registration requests').toResponseObject(), + ...rateLimitConfig + })); + } + router.post("/", async (req, res) => { + res.setHeader('Cache-Control', 'no-store'); + try { + const parseResult = auth_js_1.OAuthClientMetadataSchema.safeParse(req.body); + if (!parseResult.success) { + throw new errors_js_1.InvalidClientMetadataError(parseResult.error.message); + } + const clientMetadata = parseResult.data; + const isPublicClient = clientMetadata.token_endpoint_auth_method === 'none'; + // Generate client credentials + const clientId = node_crypto_1.default.randomUUID(); + const clientSecret = isPublicClient + ? undefined + : node_crypto_1.default.randomBytes(32).toString('hex'); + const clientIdIssuedAt = Math.floor(Date.now() / 1000); + // Calculate client secret expiry time + const clientsDoExpire = clientSecretExpirySeconds > 0; + const secretExpiryTime = clientsDoExpire ? clientIdIssuedAt + clientSecretExpirySeconds : 0; + const clientSecretExpiresAt = isPublicClient ? undefined : secretExpiryTime; + let clientInfo = { + ...clientMetadata, + client_id: clientId, + client_secret: clientSecret, + client_id_issued_at: clientIdIssuedAt, + client_secret_expires_at: clientSecretExpiresAt, + }; + clientInfo = await clientsStore.registerClient(clientInfo); + res.status(201).json(clientInfo); + } + catch (error) { + if (error instanceof errors_js_1.OAuthError) { + const status = error instanceof errors_js_1.ServerError ? 500 : 400; + res.status(status).json(error.toResponseObject()); + } + else { + console.error("Unexpected error registering client:", error); + const serverError = new errors_js_1.ServerError("Internal Server Error"); + res.status(500).json(serverError.toResponseObject()); + } + } + }); + return router; +} +//# sourceMappingURL=register.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/register.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/register.js.map new file mode 100644 index 0000000000..90c9a3cf96 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/register.js.map @@ -0,0 +1 @@ +{"version":3,"file":"register.js","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/register.ts"],"names":[],"mappings":";;;;;AAqCA,8DA6EC;AAlHD,sDAAkD;AAClD,qDAAgG;AAChG,8DAAiC;AACjC,gDAAwB;AAExB,2DAA4E;AAC5E,uEAAiE;AACjE,4CAKsB;AAuBtB,MAAM,oCAAoC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,UAAU;AAE1E,SAAgB,yBAAyB,CAAC,EACxC,YAAY,EACZ,yBAAyB,GAAG,oCAAoC,EAChE,SAAS,EAAE,eAAe,EACO;IACjC,IAAI,CAAC,YAAY,CAAC,cAAc,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC,CAAC;IACpF,CAAC;IAED,wEAAwE;IACxE,MAAM,MAAM,GAAG,iBAAO,CAAC,MAAM,EAAE,CAAC;IAEhC,kFAAkF;IAClF,MAAM,CAAC,GAAG,CAAC,IAAA,cAAI,GAAE,CAAC,CAAC;IAEnB,MAAM,CAAC,GAAG,CAAC,IAAA,kCAAc,EAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACrC,MAAM,CAAC,GAAG,CAAC,iBAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IAE3B,oFAAoF;IACpF,IAAI,eAAe,KAAK,KAAK,EAAE,CAAC;QAC9B,MAAM,CAAC,GAAG,CAAC,IAAA,8BAAS,EAAC;YACnB,QAAQ,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,SAAS;YACnC,GAAG,EAAE,EAAE,EAAE,+DAA+D;YACxE,eAAe,EAAE,IAAI;YACrB,aAAa,EAAE,KAAK;YACpB,OAAO,EAAE,IAAI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EAAE,QAAQ;gBACnB,aAAa,EAAE,YAAY;gBAC3B,mBAAmB,EAAE,gBAAgB;gBACrC,wBAAwB,EAAE,qBAAqB;aAChD,CAAC;YAEF,UAAU,GAAG,MAAM,YAAY,CAAC,cAAe,CAAC,UAAU,CAAC,CAAC;YAC5D,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACnC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,KAAK,YAAY,sBAAU,EAAE,CAAC;gBAChC,MAAM,MAAM,GAAG,KAAK,YAAY,uBAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;gBACxD,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACpD,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,KAAK,CAAC,sCAAsC,EAAE,KAAK,CAAC,CAAC;gBAC7D,MAAM,WAAW,GAAG,IAAI,uBAAW,CAAC,uBAAuB,CAAC,CAAC;gBAC7D,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACvD,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/revoke.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/revoke.d.ts new file mode 100644 index 0000000000..37b26ccf87 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/revoke.d.ts @@ -0,0 +1,13 @@ +import { OAuthServerProvider } from "../provider.js"; +import { RequestHandler } from "express"; +import { Options as RateLimitOptions } from "express-rate-limit"; +export type RevocationHandlerOptions = { + provider: OAuthServerProvider; + /** + * Rate limiting configuration for the token revocation endpoint. + * Set to false to disable rate limiting for this endpoint. + */ + rateLimit?: Partial | false; +}; +export declare function revocationHandler({ provider, rateLimit: rateLimitConfig }: RevocationHandlerOptions): RequestHandler; +//# sourceMappingURL=revoke.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/revoke.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/revoke.d.ts.map new file mode 100644 index 0000000000..ab5f228127 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/revoke.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"revoke.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/revoke.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAIlD,OAAO,EAAa,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAS5E,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,EAAE,mBAAmB,CAAC;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,KAAK,CAAC;CAC/C,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,EAAE,wBAAwB,GAAG,cAAc,CA4DpH"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/revoke.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/revoke.js new file mode 100644 index 0000000000..143e5f2006 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/revoke.js @@ -0,0 +1,67 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.revocationHandler = revocationHandler; +const express_1 = __importDefault(require("express")); +const cors_1 = __importDefault(require("cors")); +const clientAuth_js_1 = require("../middleware/clientAuth.js"); +const auth_js_1 = require("../../../shared/auth.js"); +const express_rate_limit_1 = require("express-rate-limit"); +const allowedMethods_js_1 = require("../middleware/allowedMethods.js"); +const errors_js_1 = require("../errors.js"); +function revocationHandler({ provider, rateLimit: rateLimitConfig }) { + if (!provider.revokeToken) { + throw new Error("Auth provider does not support revoking tokens"); + } + // Nested router so we can configure middleware and restrict HTTP method + const router = express_1.default.Router(); + // Configure CORS to allow any origin, to make accessible to web-based MCP clients + router.use((0, cors_1.default)()); + router.use((0, allowedMethods_js_1.allowedMethods)(["POST"])); + router.use(express_1.default.urlencoded({ extended: false })); + // Apply rate limiting unless explicitly disabled + if (rateLimitConfig !== false) { + router.use((0, express_rate_limit_1.rateLimit)({ + windowMs: 15 * 60 * 1000, // 15 minutes + max: 50, // 50 requests per windowMs + standardHeaders: true, + legacyHeaders: false, + message: new errors_js_1.TooManyRequestsError('You have exceeded the rate limit for token revocation requests').toResponseObject(), + ...rateLimitConfig + })); + } + // Authenticate and extract client details + router.use((0, clientAuth_js_1.authenticateClient)({ clientsStore: provider.clientsStore })); + router.post("/", async (req, res) => { + res.setHeader('Cache-Control', 'no-store'); + try { + const parseResult = auth_js_1.OAuthTokenRevocationRequestSchema.safeParse(req.body); + if (!parseResult.success) { + throw new errors_js_1.InvalidRequestError(parseResult.error.message); + } + const client = req.client; + if (!client) { + // This should never happen + console.error("Missing client information after authentication"); + throw new errors_js_1.ServerError("Internal Server Error"); + } + await provider.revokeToken(client, parseResult.data); + res.status(200).json({}); + } + catch (error) { + if (error instanceof errors_js_1.OAuthError) { + const status = error instanceof errors_js_1.ServerError ? 500 : 400; + res.status(status).json(error.toResponseObject()); + } + else { + console.error("Unexpected error revoking token:", error); + const serverError = new errors_js_1.ServerError("Internal Server Error"); + res.status(500).json(serverError.toResponseObject()); + } + } + }); + return router; +} +//# sourceMappingURL=revoke.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/revoke.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/revoke.js.map new file mode 100644 index 0000000000..a2d2c4ff6f --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/revoke.js.map @@ -0,0 +1 @@ +{"version":3,"file":"revoke.js","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/revoke.ts"],"names":[],"mappings":";;;;;AAuBA,8CA4DC;AAlFD,sDAAkD;AAClD,gDAAwB;AACxB,+DAAiE;AACjE,qDAA4E;AAC5E,2DAA4E;AAC5E,uEAAiE;AACjE,4CAKsB;AAWtB,SAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAA4B;IAClG,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;IACpE,CAAC;IAED,wEAAwE;IACxE,MAAM,MAAM,GAAG,iBAAO,CAAC,MAAM,EAAE,CAAC;IAEhC,kFAAkF;IAClF,MAAM,CAAC,GAAG,CAAC,IAAA,cAAI,GAAE,CAAC,CAAC;IAEnB,MAAM,CAAC,GAAG,CAAC,IAAA,kCAAc,EAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACrC,MAAM,CAAC,GAAG,CAAC,iBAAO,CAAC,UAAU,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IAEpD,iDAAiD;IACjD,IAAI,eAAe,KAAK,KAAK,EAAE,CAAC;QAC9B,MAAM,CAAC,GAAG,CAAC,IAAA,8BAAS,EAAC;YACnB,QAAQ,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,aAAa;YACvC,GAAG,EAAE,EAAE,EAAE,2BAA2B;YACpC,eAAe,E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D,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACpD,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,KAAK,CAAC,kCAAkC,EAAE,KAAK,CAAC,CAAC;gBACzD,MAAM,WAAW,GAAG,IAAI,uBAAW,CAAC,uBAAuB,CAAC,CAAC;gBAC7D,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACvD,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/token.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/token.d.ts new file mode 100644 index 0000000000..ce8eb64af4 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/token.d.ts @@ -0,0 +1,13 @@ +import { RequestHandler } from "express"; +import { OAuthServerProvider } from "../provider.js"; +import { Options as RateLimitOptions } from "express-rate-limit"; +export type TokenHandlerOptions = { + provider: OAuthServerProvider; + /** + * Rate limiting configuration for the token endpoint. + * Set to false to disable rate limiting for this endpoint. + */ + rateLimit?: Partial | false; +}; +export declare function tokenHandler({ provider, rateLimit: rateLimitConfig }: TokenHandlerOptions): RequestHandler; +//# sourceMappingURL=token.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/token.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/token.d.ts.map new file mode 100644 index 0000000000..1358ed8c8f --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/token.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/token.ts"],"names":[],"mappings":"AACA,OAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAIrD,OAAO,EAAa,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAW5E,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,mBAAmB,CAAC;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,KAAK,CAAC;CAC/C,CAAC;AAiBF,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,EAAE,mBAAmB,GAAG,cAAc,CA6G1G"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/token.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/token.js new file mode 100644 index 0000000000..97f99cf783 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/token.js @@ -0,0 +1,113 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.tokenHandler = tokenHandler; +const zod_1 = require("zod"); +const express_1 = __importDefault(require("express")); +const cors_1 = __importDefault(require("cors")); +const pkce_challenge_1 = require("pkce-challenge"); +const clientAuth_js_1 = require("../middleware/clientAuth.js"); +const express_rate_limit_1 = require("express-rate-limit"); +const allowedMethods_js_1 = require("../middleware/allowedMethods.js"); +const errors_js_1 = require("../errors.js"); +const TokenRequestSchema = zod_1.z.object({ + grant_type: zod_1.z.string(), +}); +const AuthorizationCodeGrantSchema = zod_1.z.object({ + code: zod_1.z.string(), + code_verifier: zod_1.z.string(), + redirect_uri: zod_1.z.string().optional(), +}); +const RefreshTokenGrantSchema = zod_1.z.object({ + refresh_token: zod_1.z.string(), + scope: zod_1.z.string().optional(), +}); +function tokenHandler({ provider, rateLimit: rateLimitConfig }) { + // Nested router so we can configure middleware and restrict HTTP method + const router = express_1.default.Router(); + // Configure CORS to allow any origin, to make accessible to web-based MCP clients + router.use((0, cors_1.default)()); + router.use((0, allowedMethods_js_1.allowedMethods)(["POST"])); + router.use(express_1.default.urlencoded({ extended: false })); + // Apply rate limiting unless explicitly disabled + if (rateLimitConfig !== false) { + router.use((0, express_rate_limit_1.rateLimit)({ + windowMs: 15 * 60 * 1000, // 15 minutes + max: 50, // 50 requests per windowMs + standardHeaders: true, + legacyHeaders: false, + message: new errors_js_1.TooManyRequestsError('You have exceeded the rate limit for token requests').toResponseObject(), + ...rateLimitConfig + })); + } + // Authenticate and extract client details + router.use((0, clientAuth_js_1.authenticateClient)({ clientsStore: provider.clientsStore })); + router.post("/", async (req, res) => { + res.setHeader('Cache-Control', 'no-store'); + try { + const parseResult = TokenRequestSchema.safeParse(req.body); + if (!parseResult.success) { + throw new errors_js_1.InvalidRequestError(parseResult.error.message); + } + const { grant_type } = parseResult.data; + const client = req.client; + if (!client) { + // This should never happen + console.error("Missing client information after authentication"); + throw new errors_js_1.ServerError("Internal Server Error"); + } + switch (grant_type) { + case "authorization_code": { + const parseResult = AuthorizationCodeGrantSchema.safeParse(req.body); + if (!parseResult.success) { + throw new errors_js_1.InvalidRequestError(parseResult.error.message); + } + const { code, code_verifier, redirect_uri } = parseResult.data; + const skipLocalPkceValidation = provider.skipLocalPkceValidation; + // Perform local PKCE validation unless explicitly skipped + // (e.g. to validate code_verifier in upstream server) + if (!skipLocalPkceValidation) { + const codeChallenge = await provider.challengeForAuthorizationCode(client, code); + if (!(await (0, pkce_challenge_1.verifyChallenge)(code_verifier, codeChallenge))) { + throw new errors_js_1.InvalidGrantError("code_verifier does not match the challenge"); + } + } + // Passes the code_verifier to the provider if PKCE validation didn't occur locally + const tokens = await provider.exchangeAuthorizationCode(client, code, skipLocalPkceValidation ? code_verifier : undefined, redirect_uri); + res.status(200).json(tokens); + break; + } + case "refresh_token": { + const parseResult = RefreshTokenGrantSchema.safeParse(req.body); + if (!parseResult.success) { + throw new errors_js_1.InvalidRequestError(parseResult.error.message); + } + const { refresh_token, scope } = parseResult.data; + const scopes = scope === null || scope === void 0 ? void 0 : scope.split(" "); + const tokens = await provider.exchangeRefreshToken(client, refresh_token, scopes); + res.status(200).json(tokens); + break; + } + // Not supported right now + //case "client_credentials": + default: + throw new errors_js_1.UnsupportedGrantTypeError("The grant type is not supported by this authorization server."); + } + } + catch (error) { + if (error instanceof errors_js_1.OAuthError) { + const status = error instanceof errors_js_1.ServerError ? 500 : 400; + res.status(status).json(error.toResponseObject()); + } + else { + console.error("Unexpected error exchanging token:", error); + const serverError = new errors_js_1.ServerError("Internal Server Error"); + res.status(500).json(serverError.toResponseObject()); + } + } + }); + return router; +} +//# sourceMappingURL=token.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/token.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/token.js.map new file mode 100644 index 0000000000..f8c185a2aa --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/handlers/token.js.map @@ -0,0 +1 @@ +{"version":3,"file":"token.js","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/token.ts"],"names":[],"mappings":";;;;;AAyCA,oCA6GC;AAtJD,6BAAwB;AACxB,sDAAkD;AAElD,gDAAwB;AACxB,mDAAiD;AACjD,+DAAiE;AACjE,2DAA4E;AAC5E,uEAAiE;AACjE,4CAOsB;AAWtB,MAAM,kBAAkB,GAAG,OAAC,CAAC,MAAM,CAAC;IAClC,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE;CACvB,CAAC,CAAC;AAEH,MAAM,4BAA4B,GAAG,OAAC,CAAC,MAAM,CAAC;IAC5C,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE;IACzB,YAAY,E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MAAM,GAAG,KAAK,YAAY,uBAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;gBACxD,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACpD,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,KAAK,CAAC,oCAAoC,EAAE,KAAK,CAAC,CAAC;gBAC3D,MAAM,WAAW,GAAG,IAAI,uBAAW,CAAC,uBAAuB,CAAC,CAAC;gBAC7D,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACvD,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/allowedMethods.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/allowedMethods.d.ts new file mode 100644 index 0000000000..9583d3a1d1 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/allowedMethods.d.ts @@ -0,0 +1,9 @@ +import { RequestHandler } from "express"; +/** + * Middleware to handle unsupported HTTP methods with a 405 Method Not Allowed response. + * + * @param allowedMethods Array of allowed HTTP methods for this endpoint (e.g., ['GET', 'POST']) + * @returns Express middleware that returns a 405 error if method not in allowed list + */ +export declare function allowedMethods(allowedMethods: string[]): RequestHandler; +//# sourceMappingURL=allowedMethods.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/allowedMethods.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/allowedMethods.d.ts.map new file mode 100644 index 0000000000..45528c7ec6 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/allowedMethods.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"allowedMethods.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/middleware/allowedMethods.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGzC;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,cAAc,EAAE,MAAM,EAAE,GAAG,cAAc,CAYvE"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/allowedMethods.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/allowedMethods.js new file mode 100644 index 0000000000..ea2ef4f5bc --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/allowedMethods.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.allowedMethods = allowedMethods; +const errors_js_1 = require("../errors.js"); +/** + * Middleware to handle unsupported HTTP methods with a 405 Method Not Allowed response. + * + * @param allowedMethods Array of allowed HTTP methods for this endpoint (e.g., ['GET', 'POST']) + * @returns Express middleware that returns a 405 error if method not in allowed list + */ +function allowedMethods(allowedMethods) { + return (req, res, next) => { + if (allowedMethods.includes(req.method)) { + next(); + return; + } + const error = new errors_js_1.MethodNotAllowedError(`The method ${req.method} is not allowed for this endpoint`); + res.status(405) + .set('Allow', allowedMethods.join(', ')) + .json(error.toResponseObject()); + }; +} +//# sourceMappingURL=allowedMethods.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/allowedMethods.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/allowedMethods.js.map new file mode 100644 index 0000000000..e1f3b82b0a --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/allowedMethods.js.map @@ -0,0 +1 @@ +{"version":3,"file":"allowedMethods.js","sourceRoot":"","sources":["../../../../../src/server/auth/middleware/allowedMethods.ts"],"names":[],"mappings":";;AASA,wCAYC;AApBD,4CAAqD;AAErD;;;;;GAKG;AACH,SAAgB,cAAc,CAAC,cAAwB;IACrD,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QACxB,IAAI,cAAc,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YACxC,IAAI,EAAE,CAAC;YACP,OAAO;QACT,CAAC;QAED,MAAM,KAAK,GAAG,IAAI,iCAAqB,CAAC,cAAc,GAAG,CAAC,MAAM,mCAAmC,CAAC,CAAC;QACrG,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC;aACZ,GAAG,CAAC,OAAO,EAAE,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aACvC,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC;IACpC,CAAC,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/bearerAuth.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/bearerAuth.d.ts new file mode 100644 index 0000000000..282068602a --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/bearerAuth.d.ts @@ -0,0 +1,35 @@ +import { RequestHandler } from "express"; +import { OAuthTokenVerifier } from "../provider.js"; +import { AuthInfo } from "../types.js"; +export type BearerAuthMiddlewareOptions = { + /** + * A provider used to verify tokens. + */ + verifier: OAuthTokenVerifier; + /** + * Optional scopes that the token must have. + */ + requiredScopes?: string[]; + /** + * Optional resource metadata URL to include in WWW-Authenticate header. + */ + resourceMetadataUrl?: string; +}; +declare module "express-serve-static-core" { + interface Request { + /** + * Information about the validated access token, if the `requireBearerAuth` middleware was used. + */ + auth?: AuthInfo; + } +} +/** + * Middleware that requires a valid Bearer token in the Authorization header. + * + * This will validate the token with the auth provider and add the resulting auth info to the request object. + * + * If resourceMetadataUrl is provided, it will be included in the WWW-Authenticate header + * for 401 responses as per the OAuth 2.0 Protected Resource Metadata spec. + */ +export declare function requireBearerAuth({ verifier, requiredScopes, resourceMetadataUrl }: BearerAuthMiddlewareOptions): RequestHandler; +//# sourceMappingURL=bearerAuth.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/bearerAuth.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/bearerAuth.d.ts.map new file mode 100644 index 0000000000..eeefa1996f --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/bearerAuth.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"bearerAuth.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/middleware/bearerAuth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,MAAM,2BAA2B,GAAG;IACxC;;OAEG;IACH,QAAQ,EAAE,kBAAkB,CAAC;IAE7B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAE1B;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,OAAO,QAAQ,2BAA2B,CAAC;IACzC,UAAU,OAAO;QACf;;WAEG;QACH,IAAI,CAAC,EAAE,QAAQ,CAAC;KACjB;CACF;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,cAAmB,EAAE,mBAAmB,EAAE,EAAE,2BAA2B,GAAG,cAAc,CAyDrI"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/bearerAuth.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/bearerAuth.js new file mode 100644 index 0000000000..f1380f198e --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/bearerAuth.js @@ -0,0 +1,68 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.requireBearerAuth = requireBearerAuth; +const errors_js_1 = require("../errors.js"); +/** + * Middleware that requires a valid Bearer token in the Authorization header. + * + * This will validate the token with the auth provider and add the resulting auth info to the request object. + * + * If resourceMetadataUrl is provided, it will be included in the WWW-Authenticate header + * for 401 responses as per the OAuth 2.0 Protected Resource Metadata spec. + */ +function requireBearerAuth({ verifier, requiredScopes = [], resourceMetadataUrl }) { + return async (req, res, next) => { + try { + const authHeader = req.headers.authorization; + if (!authHeader) { + throw new errors_js_1.InvalidTokenError("Missing Authorization header"); + } + const [type, token] = authHeader.split(' '); + if (type.toLowerCase() !== 'bearer' || !token) { + throw new errors_js_1.InvalidTokenError("Invalid Authorization header format, expected 'Bearer TOKEN'"); + } + const authInfo = await verifier.verifyAccessToken(token); + // Check if token has the required scopes (if any) + if (requiredScopes.length > 0) { + const hasAllScopes = requiredScopes.every(scope => authInfo.scopes.includes(scope)); + if (!hasAllScopes) { + throw new errors_js_1.InsufficientScopeError("Insufficient scope"); + } + } + // Check if the token is expired + if (!!authInfo.expiresAt && authInfo.expiresAt < Date.now() / 1000) { + throw new errors_js_1.InvalidTokenError("Token has expired"); + } + req.auth = authInfo; + next(); + } + catch (error) { + if (error instanceof errors_js_1.InvalidTokenError) { + const wwwAuthValue = resourceMetadataUrl + ? `Bearer error="${error.errorCode}", error_description="${error.message}", resource_metadata="${resourceMetadataUrl}"` + : `Bearer error="${error.errorCode}", error_description="${error.message}"`; + res.set("WWW-Authenticate", wwwAuthValue); + res.status(401).json(error.toResponseObject()); + } + else if (error instanceof errors_js_1.InsufficientScopeError) { + const wwwAuthValue = resourceMetadataUrl + ? `Bearer error="${error.errorCode}", error_description="${error.message}", resource_metadata="${resourceMetadataUrl}"` + : `Bearer error="${error.errorCode}", error_description="${error.message}"`; + res.set("WWW-Authenticate", wwwAuthValue); + res.status(403).json(error.toResponseObject()); + } + else if (error instanceof errors_js_1.ServerError) { + res.status(500).json(error.toResponseObject()); + } + else if (error instanceof errors_js_1.OAuthError) { + res.status(400).json(error.toResponseObject()); + } + else { + console.error("Unexpected error authenticating bearer token:", error); + const serverError = new errors_js_1.ServerError("Internal Server Error"); + res.status(500).json(serverError.toResponseObject()); + } + } + }; +} +//# sourceMappingURL=bearerAuth.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/bearerAuth.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/bearerAuth.js.map new file mode 100644 index 0000000000..19453b233a --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/bearerAuth.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bearerAuth.js","sourceRoot":"","sources":["../../../../../src/server/auth/middleware/bearerAuth.ts"],"names":[],"mappings":";;AAuCA,8CAyDC;AA/FD,4CAAkG;AA8BlG;;;;;;;GAOG;AACH,SAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,cAAc,GAAG,EAAE,EAAE,mBAAmB,EAA+B;IACnH,OAAO,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QAC9B,IAAI,CAAC;YACH,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC;YAC7C,IAAI,CAAC,UAAU,EAAE,CAAC;gBAChB,MAAM,IAAI,6BAAiB,CAAC,8BAA8B,CAAC,CAAC;YAC9D,CAAC;YAED,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC5C,IAAI,IAAI,CAAC,WAAW,EAAE,KAAK,QAAQ,IAAI,CAAC,KAAK,EAAE,CAAC;gBAC9C,MAAM,IAAI,6BAAiB,CAAC,8DAA8D,CAAC,CAAC;YAC9F,C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,CAAC,CAAC,iBAAiB,KAAK,CAAC,SAAS,yBAAyB,KAAK,CAAC,OAAO,yBAAyB,mBAAmB,GAAG;oBACvH,CAAC,CAAC,iBAAiB,KAAK,CAAC,SAAS,yBAAyB,KAAK,CAAC,OAAO,GAAG,CAAC;gBAC9E,GAAG,CAAC,GAAG,CAAC,kBAAkB,EAAE,YAAY,CAAC,CAAC;gBAC1C,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACjD,CAAC;iBAAM,IAAI,KAAK,YAAY,uBAAW,EAAE,CAAC;gBACxC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACjD,CAAC;iBAAM,IAAI,KAAK,YAAY,sBAAU,EAAE,CAAC;gBACvC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACjD,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,KAAK,CAAC,+CAA+C,EAAE,KAAK,CAAC,CAAC;gBACtE,MAAM,WAAW,GAAG,IAAI,uBAAW,CAAC,uBAAuB,CAAC,CAAC;gBAC7D,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACvD,CAAC;QACH,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/clientAuth.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/clientAuth.d.ts new file mode 100644 index 0000000000..4a7cd370d8 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/clientAuth.d.ts @@ -0,0 +1,19 @@ +import { RequestHandler } from "express"; +import { OAuthRegisteredClientsStore } from "../clients.js"; +import { OAuthClientInformationFull } from "../../../shared/auth.js"; +export type ClientAuthenticationMiddlewareOptions = { + /** + * A store used to read information about registered OAuth clients. + */ + clientsStore: OAuthRegisteredClientsStore; +}; +declare module "express-serve-static-core" { + interface Request { + /** + * The authenticated client for this request, if the `authenticateClient` middleware was used. + */ + client?: OAuthClientInformationFull; + } +} +export declare function authenticateClient({ clientsStore }: ClientAuthenticationMiddlewareOptions): RequestHandler; +//# sourceMappingURL=clientAuth.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/clientAuth.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/clientAuth.d.ts.map new file mode 100644 index 0000000000..a2f6c79cfb --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/clientAuth.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"clientAuth.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/middleware/clientAuth.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAGrE,MAAM,MAAM,qCAAqC,GAAG;IAClD;;OAEG;IACH,YAAY,EAAE,2BAA2B,CAAC;CAC3C,CAAA;AAOD,OAAO,QAAQ,2BAA2B,CAAC;IACzC,UAAU,OAAO;QACf;;WAEG;QACH,MAAM,CAAC,EAAE,0BAA0B,CAAC;KACrC;CACF;AAED,wBAAgB,kBAAkB,CAAC,EAAE,YAAY,EAAE,EAAE,qCAAqC,GAAG,cAAc,CA6C1G"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/clientAuth.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/clientAuth.js new file mode 100644 index 0000000000..f069e5eb0b --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/clientAuth.js @@ -0,0 +1,53 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.authenticateClient = authenticateClient; +const zod_1 = require("zod"); +const errors_js_1 = require("../errors.js"); +const ClientAuthenticatedRequestSchema = zod_1.z.object({ + client_id: zod_1.z.string(), + client_secret: zod_1.z.string().optional(), +}); +function authenticateClient({ clientsStore }) { + return async (req, res, next) => { + try { + const result = ClientAuthenticatedRequestSchema.safeParse(req.body); + if (!result.success) { + throw new errors_js_1.InvalidRequestError(String(result.error)); + } + const { client_id, client_secret } = result.data; + const client = await clientsStore.getClient(client_id); + if (!client) { + throw new errors_js_1.InvalidClientError("Invalid client_id"); + } + // If client has a secret, validate it + if (client.client_secret) { + // Check if client_secret is required but not provided + if (!client_secret) { + throw new errors_js_1.InvalidClientError("Client secret is required"); + } + // Check if client_secret matches + if (client.client_secret !== client_secret) { + throw new errors_js_1.InvalidClientError("Invalid client_secret"); + } + // Check if client_secret has expired + if (client.client_secret_expires_at && client.client_secret_expires_at < Math.floor(Date.now() / 1000)) { + throw new errors_js_1.InvalidClientError("Client secret has expired"); + } + } + req.client = client; + next(); + } + catch (error) { + if (error instanceof errors_js_1.OAuthError) { + const status = error instanceof errors_js_1.ServerError ? 500 : 400; + res.status(status).json(error.toResponseObject()); + } + else { + console.error("Unexpected error authenticating client:", error); + const serverError = new errors_js_1.ServerError("Internal Server Error"); + res.status(500).json(serverError.toResponseObject()); + } + } + }; +} +//# sourceMappingURL=clientAuth.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/clientAuth.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/clientAuth.js.map new file mode 100644 index 0000000000..950168c26f --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/middleware/clientAuth.js.map @@ -0,0 +1 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C;gBACrC,IAAI,MAAM,CAAC,wBAAwB,IAAI,MAAM,CAAC,wBAAwB,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;oBACvG,MAAM,IAAI,8BAAkB,CAAC,2BAA2B,CAAC,CAAC;gBAC5D,CAAC;YACH,CAAC;YAED,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC;YACpB,IAAI,EAAE,CAAC;QACT,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,KAAK,YAAY,sBAAU,EAAE,CAAC;gBAChC,MAAM,MAAM,GAAG,KAAK,YAAY,uBAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;gBACxD,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACpD,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,KAAK,CAAC,yCAAyC,EAAE,KAAK,CAAC,CAAC;gBAChE,MAAM,WAAW,GAAG,IAAI,uBAAW,CAAC,uBAAuB,CAAC,CAAC;gBAC7D,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACvD,CAAC;QACH,CAAC;IACH,CAAC,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/provider.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/provider.d.ts new file mode 100644 index 0000000000..07e735bf4f --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/provider.d.ts @@ -0,0 +1,67 @@ +import { Response } from "express"; +import { OAuthRegisteredClientsStore } from "./clients.js"; +import { OAuthClientInformationFull, OAuthTokenRevocationRequest, OAuthTokens } from "../../shared/auth.js"; +import { AuthInfo } from "./types.js"; +export type AuthorizationParams = { + state?: string; + scopes?: string[]; + codeChallenge: string; + redirectUri: string; +}; +/** + * Implements an end-to-end OAuth server. + */ +export interface OAuthServerProvider { + /** + * A store used to read information about registered OAuth clients. + */ + get clientsStore(): OAuthRegisteredClientsStore; + /** + * Begins the authorization flow, which can either be implemented by this server itself or via redirection to a separate authorization server. + * + * This server must eventually issue a redirect with an authorization response or an error response to the given redirect URI. Per OAuth 2.1: + * - In the successful case, the redirect MUST include the `code` and `state` (if present) query parameters. + * - In the error case, the redirect MUST include the `error` query parameter, and MAY include an optional `error_description` query parameter. + */ + authorize(client: OAuthClientInformationFull, params: AuthorizationParams, res: Response): Promise; + /** + * Returns the `codeChallenge` that was used when the indicated authorization began. + */ + challengeForAuthorizationCode(client: OAuthClientInformationFull, authorizationCode: string): Promise; + /** + * Exchanges an authorization code for an access token. + */ + exchangeAuthorizationCode(client: OAuthClientInformationFull, authorizationCode: string, codeVerifier?: string, redirectUri?: string): Promise; + /** + * Exchanges a refresh token for an access token. + */ + exchangeRefreshToken(client: OAuthClientInformationFull, refreshToken: string, scopes?: string[]): Promise; + /** + * Verifies an access token and returns information about it. + */ + verifyAccessToken(token: string): Promise; + /** + * Revokes an access or refresh token. If unimplemented, token revocation is not supported (not recommended). + * + * If the given token is invalid or already revoked, this method should do nothing. + */ + revokeToken?(client: OAuthClientInformationFull, request: OAuthTokenRevocationRequest): Promise; + /** + * Whether to skip local PKCE validation. + * + * If true, the server will not perform PKCE validation locally and will pass the code_verifier to the upstream server. + * + * NOTE: This should only be true if the upstream server is performing the actual PKCE validation. + */ + skipLocalPkceValidation?: boolean; +} +/** + * Slim implementation useful for token verification + */ +export interface OAuthTokenVerifier { + /** + * Verifies an access token and returns information about it. + */ + verifyAccessToken(token: string): Promise; +} +//# sourceMappingURL=provider.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/provider.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/provider.d.ts.map new file mode 100644 index 0000000000..8762b37be3 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/provider.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../../src/server/auth/provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC5G,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,IAAI,YAAY,IAAI,2BAA2B,CAAC;IAEhD;;;;;;OAMG;IACH,SAAS,CAAC,MAAM,EAAE,0BAA0B,EAAE,MAAM,EAAE,mBAAmB,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzG;;OAEG;IACH,6BAA6B,CAAC,MAAM,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE9G;;OAEG;IACH,yBAAyB,CACvB,MAAM,EAAE,0BAA0B,EAClC,iBAAiB,EAAE,MAAM,EACzB,YAAY,CAAC,EAAE,MAAM,EACrB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,WAAW,CAAC,CAAC;IAExB;;OAEG;IACH,oBAAoB,CAAC,MAAM,EAAE,0BAA0B,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAExH;;OAEG;IACH,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAEpD;;;;OAIG;IACH,WAAW,CAAC,CAAC,MAAM,EAAE,0BAA0B,EAAE,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtG;;;;;;OAMG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC;AAGD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;CACrD"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/provider.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/provider.js new file mode 100644 index 0000000000..0903bb2eff --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/provider.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=provider.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/provider.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/provider.js.map new file mode 100644 index 0000000000..b968414aa9 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/provider.js.map @@ -0,0 +1 @@ +{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../../../src/server/auth/provider.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/providers/proxyProvider.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/providers/proxyProvider.d.ts new file mode 100644 index 0000000000..270d1da6da --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/providers/proxyProvider.d.ts @@ -0,0 +1,43 @@ +import { Response } from "express"; +import { OAuthRegisteredClientsStore } from "../clients.js"; +import { OAuthClientInformationFull, OAuthTokenRevocationRequest, OAuthTokens } from "../../../shared/auth.js"; +import { AuthInfo } from "../types.js"; +import { AuthorizationParams, OAuthServerProvider } from "../provider.js"; +export type ProxyEndpoints = { + authorizationUrl: string; + tokenUrl: string; + revocationUrl?: string; + registrationUrl?: string; +}; +export type ProxyOptions = { + /** + * Individual endpoint URLs for proxying specific OAuth operations + */ + endpoints: ProxyEndpoints; + /** + * Function to verify access tokens and return auth info + */ + verifyAccessToken: (token: string) => Promise; + /** + * Function to fetch client information from the upstream server + */ + getClient: (clientId: string) => Promise; +}; +/** + * Implements an OAuth server that proxies requests to another OAuth server. + */ +export declare class ProxyOAuthServerProvider implements OAuthServerProvider { + protected readonly _endpoints: ProxyEndpoints; + protected readonly _verifyAccessToken: (token: string) => Promise; + protected readonly _getClient: (clientId: string) => Promise; + skipLocalPkceValidation: boolean; + revokeToken?: (client: OAuthClientInformationFull, request: OAuthTokenRevocationRequest) => Promise; + constructor(options: ProxyOptions); + get clientsStore(): OAuthRegisteredClientsStore; + authorize(client: OAuthClientInformationFull, params: AuthorizationParams, res: Response): Promise; + challengeForAuthorizationCode(_client: OAuthClientInformationFull, _authorizationCode: string): Promise; + exchangeAuthorizationCode(client: OAuthClientInformationFull, authorizationCode: string, codeVerifier?: string, redirectUri?: string): Promise; + exchangeRefreshToken(client: OAuthClientInformationFull, refreshToken: string, scopes?: string[]): Promise; + verifyAccessToken(token: string): Promise; +} +//# sourceMappingURL=proxyProvider.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/providers/proxyProvider.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/providers/proxyProvider.d.ts.map new file mode 100644 index 0000000000..84d4d80755 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/providers/proxyProvider.d.ts.map @@ -0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CAAC,EAAE,CACZ,MAAM,EAAE,0BAA0B,EAClC,OAAO,EAAE,2BAA2B,KACjC,OAAO,CAAC,IAAI,CAAC,CAAC;gBAEP,OAAO,EAAE,YAAY;IAwCjC,IAAI,YAAY,IAAI,2BAA2B,CAuB9C;IAEK,SAAS,CACb,MAAM,EAAE,0BAA0B,EAClC,MAAM,EAAE,mBAAmB,EAC3B,GAAG,EAAE,QAAQ,GACZ,OAAO,CAAC,IAAI,CAAC;IAmBV,6BAA6B,CACjC,OAAO,EAAE,0BAA0B,EACnC,kBAAkB,EAAE,MAAM,GACzB,OAAO,CAAC,MAAM,CAAC;IAMZ,yBAAyB,CAC7B,MAAM,EAAE,0BAA0B,EAClC,iBAAiB,EAAE,MAAM,EACzB,YAAY,CAAC,EAAE,MAAM,EACrB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,WAAW,CAAC;IAoCjB,oBAAoB,CACxB,MAAM,EAAE,0BAA0B,EAClC,YAAY,EAAE,MAAM,EACpB,MAAM,CAAC,EAAE,MAAM,EAAE,GAChB,OAAO,CAAC,WAAW,CAAC;IAgCjB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;CAG1D"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/providers/proxyProvider.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/providers/proxyProvider.js new file mode 100644 index 0000000000..4edb129fb1 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/providers/proxyProvider.js @@ -0,0 +1,148 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ProxyOAuthServerProvider = void 0; +const auth_js_1 = require("../../../shared/auth.js"); +const errors_js_1 = require("../errors.js"); +/** + * Implements an OAuth server that proxies requests to another OAuth server. + */ +class ProxyOAuthServerProvider { + constructor(options) { + var _a; + this.skipLocalPkceValidation = true; + this._endpoints = options.endpoints; + this._verifyAccessToken = options.verifyAccessToken; + this._getClient = options.getClient; + if ((_a = options.endpoints) === null || _a === void 0 ? void 0 : _a.revocationUrl) { + this.revokeToken = async (client, request) => { + const revocationUrl = this._endpoints.revocationUrl; + if (!revocationUrl) { + throw new Error("No revocation endpoint configured"); + } + const params = new URLSearchParams(); + params.set("token", request.token); + params.set("client_id", client.client_id); + if (client.client_secret) { + params.set("client_secret", client.client_secret); + } + if (request.token_type_hint) { + params.set("token_type_hint", request.token_type_hint); + } + const response = await fetch(revocationUrl, { + method: "POST", + headers: { + "Content-Type": "application/x-www-form-urlencoded", + }, + body: params.toString(), + }); + if (!response.ok) { + throw new errors_js_1.ServerError(`Token revocation failed: ${response.status}`); + } + }; + } + } + get clientsStore() { + const registrationUrl = this._endpoints.registrationUrl; + return { + getClient: this._getClient, + ...(registrationUrl && { + registerClient: async (client) => { + const response = await fetch(registrationUrl, { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(client), + }); + if (!response.ok) { + throw new errors_js_1.ServerError(`Client registration failed: ${response.status}`); + } + const data = await response.json(); + return auth_js_1.OAuthClientInformationFullSchema.parse(data); + } + }) + }; + } + async authorize(client, params, res) { + var _a; + // Start with required OAuth parameters + const targetUrl = new URL(this._endpoints.authorizationUrl); + const searchParams = new URLSearchParams({ + client_id: client.client_id, + response_type: "code", + redirect_uri: params.redirectUri, + code_challenge: params.codeChallenge, + code_challenge_method: "S256" + }); + // Add optional standard OAuth parameters + if (params.state) + searchParams.set("state", params.state); + if ((_a = params.scopes) === null || _a === void 0 ? void 0 : _a.length) + searchParams.set("scope", params.scopes.join(" ")); + targetUrl.search = searchParams.toString(); + res.redirect(targetUrl.toString()); + } + async challengeForAuthorizationCode(_client, _authorizationCode) { + // In a proxy setup, we don't store the code challenge ourselves + // Instead, we proxy the token request and let the upstream server validate it + return ""; + } + async exchangeAuthorizationCode(client, authorizationCode, codeVerifier, redirectUri) { + const params = new URLSearchParams({ + grant_type: "authorization_code", + client_id: client.client_id, + code: authorizationCode, + }); + if (client.client_secret) { + params.append("client_secret", client.client_secret); + } + if (codeVerifier) { + params.append("code_verifier", codeVerifier); + } + if (redirectUri) { + params.append("redirect_uri", redirectUri); + } + const response = await fetch(this._endpoints.tokenUrl, { + method: "POST", + headers: { + "Content-Type": "application/x-www-form-urlencoded", + }, + body: params.toString(), + }); + if (!response.ok) { + throw new errors_js_1.ServerError(`Token exchange failed: ${response.status}`); + } + const data = await response.json(); + return auth_js_1.OAuthTokensSchema.parse(data); + } + async exchangeRefreshToken(client, refreshToken, scopes) { + const params = new URLSearchParams({ + grant_type: "refresh_token", + client_id: client.client_id, + refresh_token: refreshToken, + }); + if (client.client_secret) { + params.set("client_secret", client.client_secret); + } + if (scopes === null || scopes === void 0 ? void 0 : scopes.length) { + params.set("scope", scopes.join(" ")); + } + const response = await fetch(this._endpoints.tokenUrl, { + method: "POST", + headers: { + "Content-Type": "application/x-www-form-urlencoded", + }, + body: params.toString(), + }); + if (!response.ok) { + throw new errors_js_1.ServerError(`Token refresh failed: ${response.status}`); + } + const data = await response.json(); + return auth_js_1.OAuthTokensSchema.parse(data); + } + async verifyAccessToken(token) { + return this._verifyAccessToken(token); + } +} +exports.ProxyOAuthServerProvider = ProxyOAuthServerProvider; +//# sourceMappingURL=proxyProvider.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/providers/proxyProvider.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/providers/proxyProvider.js.map new file mode 100644 index 0000000000..064f06a3b3 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/providers/proxyProvider.js.map @@ -0,0 +1 @@ +{"version":3,"file":"proxyProvider.js","sourceRoot":"","sources":["../../../../../src/server/auth/providers/proxyProvider.ts"],"names":[],"mappings":";;;AAEA,qDAMiC;AAGjC,4CAA2C;AA2B3C;;GAEG;AACH,MAAa,wBAAwB;IAYnC,YAAY,OAAqB;;QAPjC,4BAAuB,G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QACnC,OAAO,2BAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,KAAa;QACnC,OAAO,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;CACF;AA7LD,4DA6LC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/router.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/router.d.ts new file mode 100644 index 0000000000..55b2e743f4 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/router.d.ts @@ -0,0 +1,96 @@ +import { RequestHandler } from "express"; +import { ClientRegistrationHandlerOptions } from "./handlers/register.js"; +import { TokenHandlerOptions } from "./handlers/token.js"; +import { AuthorizationHandlerOptions } from "./handlers/authorize.js"; +import { RevocationHandlerOptions } from "./handlers/revoke.js"; +import { OAuthServerProvider } from "./provider.js"; +import { OAuthMetadata } from "../../shared/auth.js"; +export type AuthRouterOptions = { + /** + * A provider implementing the actual authorization logic for this router. + */ + provider: OAuthServerProvider; + /** + * The authorization server's issuer identifier, which is a URL that uses the "https" scheme and has no query or fragment components. + */ + issuerUrl: URL; + /** + * The base URL of the authorization server to use for the metadata endpoints. + * + * If not provided, the issuer URL will be used as the base URL. + */ + baseUrl?: URL; + /** + * An optional URL of a page containing human-readable information that developers might want or need to know when using the authorization server. + */ + serviceDocumentationUrl?: URL; + /** + * An optional list of scopes supported by this authorization server + */ + scopesSupported?: string[]; + /** + * The resource name to be displayed in protected resource metadata + */ + resourceName?: string; + authorizationOptions?: Omit; + clientRegistrationOptions?: Omit; + revocationOptions?: Omit; + tokenOptions?: Omit; +}; +export declare const createOAuthMetadata: (options: { + provider: OAuthServerProvider; + issuerUrl: URL; + baseUrl?: URL; + serviceDocumentationUrl?: URL; + scopesSupported?: string[]; +}) => OAuthMetadata; +/** + * Installs standard MCP authorization server endpoints, including dynamic client registration and token revocation (if supported). + * Also advertises standard authorization server metadata, for easier discovery of supported configurations by clients. + * Note: if your MCP server is only a resource server and not an authorization server, use mcpAuthMetadataRouter instead. + * + * By default, rate limiting is applied to all endpoints to prevent abuse. + * + * This router MUST be installed at the application root, like so: + * + * const app = express(); + * app.use(mcpAuthRouter(...)); + */ +export declare function mcpAuthRouter(options: AuthRouterOptions): RequestHandler; +export type AuthMetadataOptions = { + /** + * OAuth Metadata as would be returned from the authorization server + * this MCP server relies on + */ + oauthMetadata: OAuthMetadata; + /** + * The url of the MCP server, for use in protected resource metadata + */ + resourceServerUrl: URL; + /** + * The url for documentation for the MCP server + */ + serviceDocumentationUrl?: URL; + /** + * An optional list of scopes supported by this MCP server + */ + scopesSupported?: string[]; + /** + * An optional resource name to display in resource metadata + */ + resourceName?: string; +}; +export declare function mcpAuthMetadataRouter(options: AuthMetadataOptions): import("express-serve-static-core").Router; +/** + * Helper function to construct the OAuth 2.0 Protected Resource Metadata URL + * from a given server URL. This replaces the path with the standard metadata endpoint. + * + * @param serverUrl - The base URL of the protected resource server + * @returns The URL for the OAuth protected resource metadata endpoint + * + * @example + * getOAuthProtectedResourceMetadataUrl(new URL('https://api.example.com/mcp')) + * // Returns: 'https://api.example.com/.well-known/oauth-protected-resource' + */ +export declare function getOAuthProtectedResourceMetadataUrl(serverUrl: URL): string; +//# sourceMappingURL=router.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/router.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/router.d.ts.map new file mode 100644 index 0000000000..0434374c4f --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/router.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../../src/server/auth/router.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAA6B,gCAAgC,EAAE,MAAM,wBAAwB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,MAAM,MAAM,mBAAmB,GAAG;IAChC;;;OAGG;IACH,aAAa,EAAE,aAAa,CAAC;IAE7B;;OAEG;IACH,iBAAiB,EAAE,GAAG,CAAC;IAEvB;;OAEG;IACH,uBAAuB,CAAC,EAAE,GAAG,CAAC;IAE9B;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAE3B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAA;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,mBAAmB,8CAuBjE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,oCAAoC,CAAC,SAAS,EAAE,GAAG,GAAG,MAAM,CAE3E"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/router.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/router.js new file mode 100644 index 0000000000..a1e8e961ca --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/router.js @@ -0,0 +1,122 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createOAuthMetadata = void 0; +exports.mcpAuthRouter = mcpAuthRouter; +exports.mcpAuthMetadataRouter = mcpAuthMetadataRouter; +exports.getOAuthProtectedResourceMetadataUrl = getOAuthProtectedResourceMetadataUrl; +const express_1 = __importDefault(require("express")); +const register_js_1 = require("./handlers/register.js"); +const token_js_1 = require("./handlers/token.js"); +const authorize_js_1 = require("./handlers/authorize.js"); +const revoke_js_1 = require("./handlers/revoke.js"); +const metadata_js_1 = require("./handlers/metadata.js"); +const checkIssuerUrl = (issuer) => { + // Technically RFC 8414 does not permit a localhost HTTPS exemption, but this will be necessary for ease of testing + if (issuer.protocol !== "https:" && issuer.hostname !== "localhost" && issuer.hostname !== "127.0.0.1") { + throw new Error("Issuer URL must be HTTPS"); + } + if (issuer.hash) { + throw new Error(`Issuer URL must not have a fragment: ${issuer}`); + } + if (issuer.search) { + throw new Error(`Issuer URL must not have a query string: ${issuer}`); + } +}; +const createOAuthMetadata = (options) => { + var _a; + const issuer = options.issuerUrl; + const baseUrl = options.baseUrl; + checkIssuerUrl(issuer); + const authorization_endpoint = "/authorize"; + const token_endpoint = "/token"; + const registration_endpoint = options.provider.clientsStore.registerClient ? "/register" : undefined; + const revocation_endpoint = options.provider.revokeToken ? "/revoke" : undefined; + const metadata = { + issuer: issuer.href, + service_documentation: (_a = options.serviceDocumentationUrl) === null || _a === void 0 ? void 0 : _a.href, + authorization_endpoint: new URL(authorization_endpoint, baseUrl || issuer).href, + response_types_supported: ["code"], + code_challenge_methods_supported: ["S256"], + token_endpoint: new URL(token_endpoint, baseUrl || issuer).href, + token_endpoint_auth_methods_supported: ["client_secret_post"], + grant_types_supported: ["authorization_code", "refresh_token"], + scopes_supported: options.scopesSupported, + revocation_endpoint: revocation_endpoint ? new URL(revocation_endpoint, baseUrl || issuer).href : undefined, + revocation_endpoint_auth_methods_supported: revocation_endpoint ? ["client_secret_post"] : undefined, + registration_endpoint: registration_endpoint ? new URL(registration_endpoint, baseUrl || issuer).href : undefined, + }; + return metadata; +}; +exports.createOAuthMetadata = createOAuthMetadata; +/** + * Installs standard MCP authorization server endpoints, including dynamic client registration and token revocation (if supported). + * Also advertises standard authorization server metadata, for easier discovery of supported configurations by clients. + * Note: if your MCP server is only a resource server and not an authorization server, use mcpAuthMetadataRouter instead. + * + * By default, rate limiting is applied to all endpoints to prevent abuse. + * + * This router MUST be installed at the application root, like so: + * + * const app = express(); + * app.use(mcpAuthRouter(...)); + */ +function mcpAuthRouter(options) { + const oauthMetadata = (0, exports.createOAuthMetadata)(options); + const router = express_1.default.Router(); + router.use(new URL(oauthMetadata.authorization_endpoint).pathname, (0, authorize_js_1.authorizationHandler)({ provider: options.provider, ...options.authorizationOptions })); + router.use(new URL(oauthMetadata.token_endpoint).pathname, (0, token_js_1.tokenHandler)({ provider: options.provider, ...options.tokenOptions })); + router.use(mcpAuthMetadataRouter({ + oauthMetadata, + // This router is used for AS+RS combo's, so the issuer is also the resource server + resourceServerUrl: new URL(oauthMetadata.issuer), + serviceDocumentationUrl: options.serviceDocumentationUrl, + scopesSupported: options.scopesSupported, + resourceName: options.resourceName + })); + if (oauthMetadata.registration_endpoint) { + router.use(new URL(oauthMetadata.registration_endpoint).pathname, (0, register_js_1.clientRegistrationHandler)({ + clientsStore: options.provider.clientsStore, + ...options, + })); + } + if (oauthMetadata.revocation_endpoint) { + router.use(new URL(oauthMetadata.revocation_endpoint).pathname, (0, revoke_js_1.revocationHandler)({ provider: options.provider, ...options.revocationOptions })); + } + return router; +} +function mcpAuthMetadataRouter(options) { + var _a; + checkIssuerUrl(new URL(options.oauthMetadata.issuer)); + const router = express_1.default.Router(); + const protectedResourceMetadata = { + resource: options.resourceServerUrl.href, + authorization_servers: [ + options.oauthMetadata.issuer + ], + scopes_supported: options.scopesSupported, + resource_name: options.resourceName, + resource_documentation: (_a = options.serviceDocumentationUrl) === null || _a === void 0 ? void 0 : _a.href, + }; + router.use("/.well-known/oauth-protected-resource", (0, metadata_js_1.metadataHandler)(protectedResourceMetadata)); + // Always add this for backwards compatibility + router.use("/.well-known/oauth-authorization-server", (0, metadata_js_1.metadataHandler)(options.oauthMetadata)); + return router; +} +/** + * Helper function to construct the OAuth 2.0 Protected Resource Metadata URL + * from a given server URL. This replaces the path with the standard metadata endpoint. + * + * @param serverUrl - The base URL of the protected resource server + * @returns The URL for the OAuth protected resource metadata endpoint + * + * @example + * getOAuthProtectedResourceMetadataUrl(new URL('https://api.example.com/mcp')) + * // Returns: 'https://api.example.com/.well-known/oauth-protected-resource' + */ +function getOAuthProtectedResourceMetadataUrl(serverUrl) { + return new URL('/.well-known/oauth-protected-resource', serverUrl).href; +} +//# sourceMappingURL=router.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/router.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/router.js.map new file mode 100644 index 0000000000..f10f7515cb --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/router.js.map @@ -0,0 +1 @@ +{"version":3,"file":"router.js","sourceRoot":"","sources":["../../../../src/server/auth/router.ts"],"names":[],"mappings":";;;;;;AAmHA,sCA0CC;AA8BD,sDAuBC;AAaD,oFAEC;AAjOD,sDAAkD;AAClD,wDAAqG;AACrG,kDAAwE;AACxE,0DAA4F;AAC5F,oDAAmF;AACnF,wDAAyD;AA6CzD,MAAM,cAAc,GAAG,CAAC,MAAW,EAAQ,EAAE;IAC3C,mHAAmH;IACnH,IAAI,MAAM,CAAC,QAAQ,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,KAAK,WAAW,IAAI,MAAM,CAAC,QAAQ,KAAK,WAAW,EAAE,CAAC;QACvG,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAC9C,CAAC;IACD,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,wCAAwC,MAAM,EAAE,CAAC,CAAC;IACpE,CAAC;IACD,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CAAC,4CAA4C,MAAM,EAAE,CAAC,CAAC;IACxE,CAAC;AACH,CAAC,CAAA;AAEM,MAAM,mBAAmB,GAAG,CAAC,OAMnC,EAAiB,EAAE;;IAClB,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IACjC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAEhC,cAAc,CAAC,MAAM,CAAC,CAAC;IAEvB,MAAM,sBAAsB,GAAG,YAAY,CAAC;IAC5C,MAAM,cAAc,GAAG,QAAQ,CAAC;IAChC,MAAM,qBAAqB,GAAG,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC;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AAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AA8BD,SAAgB,qBAAqB,CAAC,OAA4B;;IAChE,cAAc,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;IAEtD,MAAM,MAAM,GAAG,iBAAO,CAAC,MAAM,EAAE,CAAC;IAEhC,MAAM,yBAAyB,GAAmC;QAChE,QAAQ,EAAE,OAAO,CAAC,iBAAiB,CAAC,IAAI;QAExC,qBAAqB,EAAE;YACrB,OAAO,CAAC,aAAa,CAAC,MAAM;SAC7B;QAED,gBAAgB,EAAE,OAAO,CAAC,eAAe;QACzC,aAAa,EAAE,OAAO,CAAC,YAAY;QACnC,sBAAsB,EAAE,MAAA,OAAO,CAAC,uBAAuB,0CAAE,IAAI;KAC9D,CAAC;IAEF,MAAM,CAAC,GAAG,CAAC,uCAAuC,EAAE,IAAA,6BAAe,EAAC,yBAAyB,CAAC,CAAC,CAAC;IAEhG,8CAA8C;IAC9C,MAAM,CAAC,GAAG,CAAC,yCAAyC,EAAE,IAAA,6BAAe,EAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC;IAE9F,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAgB,oCAAoC,CAAC,SAAc;IACjE,OAAO,IAAI,GAAG,CAAC,uCAAuC,EAAE,SAAS,CAAC,CAAC,IAAI,CAAC;AAC1E,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/types.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/types.d.ts new file mode 100644 index 0000000000..08e55f38b9 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/types.d.ts @@ -0,0 +1,27 @@ +/** + * Information about a validated access token, provided to request handlers. + */ +export interface AuthInfo { + /** + * The access token. + */ + token: string; + /** + * The client ID associated with this token. + */ + clientId: string; + /** + * Scopes associated with this token. + */ + scopes: string[]; + /** + * When the token expires (in seconds since epoch). + */ + expiresAt?: number; + /** + * Additional data associated with the token. + * This field should be used for any additional data that needs to be attached to the auth info. + */ + extra?: Record; +} +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/types.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/types.d.ts.map new file mode 100644 index 0000000000..6ccb8ceb29 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/server/auth/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,MAAM,EAAE,MAAM,EAAE,CAAC;IAEjB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;MAGE;IACF,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/types.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/types.js new file mode 100644 index 0000000000..11e638d1ee --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/types.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/types.js.map new file mode 100644 index 0000000000..0d8063dee4 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/auth/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/server/auth/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/completable.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/completable.d.ts new file mode 100644 index 0000000000..b75be29a44 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/completable.d.ts @@ -0,0 +1,22 @@ +import { ZodTypeAny, ZodTypeDef, ZodType, ParseInput, ParseReturnType, RawCreateParams } from "zod"; +export declare enum McpZodTypeKind { + Completable = "McpCompletable" +} +export type CompleteCallback = (value: T["_input"]) => T["_input"][] | Promise; +export interface CompletableDef extends ZodTypeDef { + type: T; + complete: CompleteCallback; + typeName: McpZodTypeKind.Completable; +} +export declare class Completable extends ZodType, T["_input"]> { + _parse(input: ParseInput): ParseReturnType; + unwrap(): T; + static create: (type: T_1, params: RawCreateParams & { + complete: CompleteCallback; + }) => Completable; +} +/** + * Wraps a Zod type to provide autocompletion capabilities. Useful for, e.g., prompt arguments in MCP. + */ +export declare function completable(schema: T, complete: CompleteCallback): Completable; +//# sourceMappingURL=completable.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/completable.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/completable.d.ts.map new file mode 100644 index 0000000000..f026d670ae --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/completable.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"completable.d.ts","sourceRoot":"","sources":["../../../src/server/completable.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,UAAU,EACV,OAAO,EACP,UAAU,EACV,eAAe,EACf,eAAe,EAGhB,MAAM,KAAK,CAAC;AAEb,oBAAY,cAAc;IACxB,WAAW,mBAAmB;CAC/B;AAED,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,UAAU,GAAG,UAAU,IAAI,CAChE,KAAK,EAAE,CAAC,CAAC,QAAQ,CAAC,KACf,CAAC,CAAC,QAAQ,CAAC,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AAE5C,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,UAAU,GAAG,UAAU,CAC/D,SAAQ,UAAU;IAClB,IAAI,EAAE,CAAC,CAAC;IACR,QAAQ,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAC9B,QAAQ,EAAE,cAAc,CAAC,WAAW,CAAC;CACtC;AAED,qBAAa,WAAW,CAAC,CAAC,SAAS,UAAU,CAAE,SAAQ,OAAO,CAC5D,CAAC,CAAC,SAAS,CAAC,EACZ,cAAc,CAAC,CAAC,CAAC,EACjB,CAAC,CAAC,QAAQ,CAAC,CACZ;IACC,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,eAAe,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAU3D,MAAM;IAIN,MAAM,CAAC,MAAM,eAAc,UAAU,QAC7B,GAAC,UACC,eAAe,GAAG;QACxB,QAAQ,EAAE,gBAAgB,CAAC,GAAC,CAAC,CAAC;KAC/B,KACA,WAAW,CAAC,GAAC,CAAC,CAOf;CACH;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,UAAU,EAC9C,MAAM,EAAE,CAAC,EACT,QAAQ,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAC5B,WAAW,CAAC,CAAC,CAAC,CAEhB"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/completable.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/completable.js new file mode 100644 index 0000000000..11903eaa23 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/completable.js @@ -0,0 +1,65 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Completable = exports.McpZodTypeKind = void 0; +exports.completable = completable; +const zod_1 = require("zod"); +var McpZodTypeKind; +(function (McpZodTypeKind) { + McpZodTypeKind["Completable"] = "McpCompletable"; +})(McpZodTypeKind || (exports.McpZodTypeKind = McpZodTypeKind = {})); +class Completable extends zod_1.ZodType { + _parse(input) { + const { ctx } = this._processInputParams(input); + const data = ctx.data; + return this._def.type._parse({ + data, + path: ctx.path, + parent: ctx, + }); + } + unwrap() { + return this._def.type; + } +} +exports.Completable = Completable; +Completable.create = (type, params) => { + return new Completable({ + type, + typeName: McpZodTypeKind.Completable, + complete: params.complete, + ...processCreateParams(params), + }); +}; +/** + * Wraps a Zod type to provide autocompletion capabilities. Useful for, e.g., prompt arguments in MCP. + */ +function completable(schema, complete) { + return Completable.create(schema, { ...schema._def, complete }); +} +// Not sure why this isn't exported from Zod: +// https://github.com/colinhacks/zod/blob/f7ad26147ba291cb3fb257545972a8e00e767470/src/types.ts#L130 +function processCreateParams(params) { + if (!params) + return {}; + const { errorMap, invalid_type_error, required_error, description } = params; + if (errorMap && (invalid_type_error || required_error)) { + throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`); + } + if (errorMap) + return { errorMap: errorMap, description }; + const customMap = (iss, ctx) => { + var _a, _b; + const { message } = params; + if (iss.code === "invalid_enum_value") { + return { message: message !== null && message !== void 0 ? message : ctx.defaultError }; + } + if (typeof ctx.data === "undefined") { + return { message: (_a = message !== null && message !== void 0 ? message : required_error) !== null && _a !== void 0 ? _a : ctx.defaultError }; + } + if (iss.code !== "invalid_type") + return { message: ctx.defaultError }; + return { message: (_b = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _b !== void 0 ? _b : ctx.defaultError }; + }; + return { errorMap: customMap, description }; +} +//# sourceMappingURL=completable.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/completable.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/completable.js.map new file mode 100644 index 0000000000..70a324ac50 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/completable.js.map @@ -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,WAAW,EAAE,GAAG,MAAM,CAAC;IAC7E,IAAI,QAAQ,IAAI,CAAC,kBAAkB,IAAI,cAAc,CAAC,EAAE,CAAC;QACvD,MAAM,IAAI,KAAK,CACb,0FAA0F,CAC3F,CAAC;IACJ,CAAC;IACD,IAAI,QAAQ;QAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;IACzD,MAAM,SAAS,GAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;;QAC1C,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;QAE3B,IAAI,GAAG,CAAC,IAAI,KAAK,oBAAoB,EAAE,CAAC;YACtC,OAAO,EAAE,OAAO,EAAE,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,GAAG,CAAC,YAAY,EAAE,CAAC;QAClD,CAAC;QACD,IAAI,OAAO,GAAG,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;YACpC,OAAO,EAAE,OAAO,EAAE,MAAA,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,cAAc,mCAAI,GAAG,CAAC,YAAY,EAAE,CAAC;QACpE,CAAC;QACD,IAAI,GAAG,CAAC,IAAI,KAAK,cAAc;YAAE,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,YAAY,EAAE,CAAC;QACtE,OAAO,EAAE,OAAO,EAAE,MAAA,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,kBAAkB,mCAAI,GAAG,CAAC,YAAY,EAAE,CAAC;IACxE,CAAC,CAAC;IACF,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;AAC9C,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/index.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/index.d.ts new file mode 100644 index 0000000000..c322ed600e --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/index.d.ts @@ -0,0 +1,135 @@ +import { Protocol, ProtocolOptions, RequestOptions } from "../shared/protocol.js"; +import { ClientCapabilities, CreateMessageRequest, Implementation, ListRootsRequest, LoggingMessageNotification, Notification, Request, ResourceUpdatedNotification, Result, ServerCapabilities, ServerNotification, ServerRequest, ServerResult } from "../types.js"; +export type ServerOptions = ProtocolOptions & { + /** + * Capabilities to advertise as being supported by this server. + */ + capabilities?: ServerCapabilities; + /** + * Optional instructions describing how to use the server and its features. + */ + instructions?: string; +}; +/** + * An MCP server on top of a pluggable transport. + * + * This server will automatically respond to the initialization flow as initiated from the client. + * + * To use with custom types, extend the base Request/Notification/Result types and pass them as type parameters: + * + * ```typescript + * // Custom schemas + * const CustomRequestSchema = RequestSchema.extend({...}) + * const CustomNotificationSchema = NotificationSchema.extend({...}) + * const CustomResultSchema = ResultSchema.extend({...}) + * + * // Type aliases + * type CustomRequest = z.infer + * type CustomNotification = z.infer + * type CustomResult = z.infer + * + * // Create typed server + * const server = new Server({ + * name: "CustomServer", + * version: "1.0.0" + * }) + * ``` + */ +export declare class Server extends Protocol { + private _serverInfo; + private _clientCapabilities?; + private _clientVersion?; + private _capabilities; + private _instructions?; + /** + * Callback for when initialization has fully completed (i.e., the client has sent an `initialized` notification). + */ + oninitialized?: () => void; + /** + * Initializes this server with the given name and version information. + */ + constructor(_serverInfo: Implementation, options?: ServerOptions); + /** + * Registers new capabilities. This can only be called before connecting to a transport. + * + * The new capabilities will be merged with any existing capabilities previously given (e.g., at initialization). + */ + registerCapabilities(capabilities: ServerCapabilities): void; + protected assertCapabilityForMethod(method: RequestT["method"]): void; + protected assertNotificationCapability(method: (ServerNotification | NotificationT)["method"]): void; + protected assertRequestHandlerCapability(method: string): void; + private _oninitialize; + /** + * After initialization has completed, this will be populated with the client's reported capabilities. + */ + getClientCapabilities(): ClientCapabilities | undefined; + /** + * After initialization has completed, this will be populated with information about the client's name and version. + */ + getClientVersion(): Implementation | undefined; + private getCapabilities; + ping(): Promise<{ + _meta?: import("zod").objectOutputType<{}, import("zod").ZodTypeAny, "passthrough"> | undefined; + }>; + createMessage(params: CreateMessageRequest["params"], options?: RequestOptions): Promise, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + model: import("zod").ZodString; + stopReason: import("zod").ZodOptional, import("zod").ZodString]>>; + role: import("zod").ZodEnum<["user", "assistant"]>; + content: import("zod").ZodDiscriminatedUnion<"type", [import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"audio">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"audio">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"audio">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>]>; + }>, import("zod").ZodTypeAny, "passthrough">>; + listRoots(params?: ListRootsRequest["params"], options?: RequestOptions): Promise, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + roots: import("zod").ZodArray; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + uri: import("zod").ZodString; + name: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + uri: import("zod").ZodString; + name: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">>, "many">; + }>, import("zod").ZodTypeAny, "passthrough">>; + sendLoggingMessage(params: LoggingMessageNotification["params"]): Promise; + sendResourceUpdated(params: ResourceUpdatedNotification["params"]): Promise; + sendResourceListChanged(): Promise; + sendToolListChanged(): Promise; + sendPromptListChanged(): Promise; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/index.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/index.d.ts.map new file mode 100644 index 0000000000..810ca16bd5 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EACR,eAAe,EACf,cAAc,EACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EAGpB,cAAc,EAMd,gBAAgB,EAEhB,0BAA0B,EAC1B,YAAY,EACZ,OAAO,EACP,2BAA2B,EAC3B,MAAM,EACN,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,YAAY,EAEb,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,aAAa,GAAG,eAAe,GAAG;IAC5C;;OAEG;IACH,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAElC;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,qBAAa,MAAM,CACjB,QAAQ,SAAS,OAAO,GAAG,OAAO,EAClC,a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BAA0B,CAAC,QAAQ,CAAC;IAI/D,mBAAmB,CAAC,MAAM,EAAE,2BAA2B,CAAC,QAAQ,CAAC;IAOjE,uBAAuB;IAMvB,mBAAmB;IAInB,qBAAqB;CAG5B"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/index.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/index.js new file mode 100644 index 0000000000..2d8a0b1f78 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/index.js @@ -0,0 +1,200 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Server = void 0; +const protocol_js_1 = require("../shared/protocol.js"); +const types_js_1 = require("../types.js"); +/** + * An MCP server on top of a pluggable transport. + * + * This server will automatically respond to the initialization flow as initiated from the client. + * + * To use with custom types, extend the base Request/Notification/Result types and pass them as type parameters: + * + * ```typescript + * // Custom schemas + * const CustomRequestSchema = RequestSchema.extend({...}) + * const CustomNotificationSchema = NotificationSchema.extend({...}) + * const CustomResultSchema = ResultSchema.extend({...}) + * + * // Type aliases + * type CustomRequest = z.infer + * type CustomNotification = z.infer + * type CustomResult = z.infer + * + * // Create typed server + * const server = new Server({ + * name: "CustomServer", + * version: "1.0.0" + * }) + * ``` + */ +class Server extends protocol_js_1.Protocol { + /** + * Initializes this server with the given name and version information. + */ + constructor(_serverInfo, options) { + var _a; + super(options); + this._serverInfo = _serverInfo; + this._capabilities = (_a = options === null || options === void 0 ? void 0 : options.capabilities) !== null && _a !== void 0 ? _a : {}; + this._instructions = options === null || options === void 0 ? void 0 : options.instructions; + this.setRequestHandler(types_js_1.InitializeRequestSchema, (request) => this._oninitialize(request)); + this.setNotificationHandler(types_js_1.InitializedNotificationSchema, () => { var _a; return (_a = this.oninitialized) === null || _a === void 0 ? void 0 : _a.call(this); }); + } + /** + * Registers new capabilities. This can only be called before connecting to a transport. + * + * The new capabilities will be merged with any existing capabilities previously given (e.g., at initialization). + */ + registerCapabilities(capabilities) { + if (this.transport) { + throw new Error("Cannot register capabilities after connecting to transport"); + } + this._capabilities = (0, protocol_js_1.mergeCapabilities)(this._capabilities, capabilities); + } + assertCapabilityForMethod(method) { + var _a, _b; + switch (method) { + case "sampling/createMessage": + if (!((_a = this._clientCapabilities) === null || _a === void 0 ? void 0 : _a.sampling)) { + throw new Error(`Client does not support sampling (required for ${method})`); + } + break; + case "roots/list": + if (!((_b = this._clientCapabilities) === null || _b === void 0 ? void 0 : _b.roots)) { + throw new Error(`Client does not support listing roots (required for ${method})`); + } + break; + case "ping": + // No specific capability required for ping + break; + } + } + assertNotificationCapability(method) { + switch (method) { + case "notifications/message": + if (!this._capabilities.logging) { + throw new Error(`Server does not support logging (required for ${method})`); + } + break; + case "notifications/resources/updated": + case "notifications/resources/list_changed": + if (!this._capabilities.resources) { + throw new Error(`Server does not support notifying about resources (required for ${method})`); + } + break; + case "notifications/tools/list_changed": + if (!this._capabilities.tools) { + throw new Error(`Server does not support notifying of tool list changes (required for ${method})`); + } + break; + case "notifications/prompts/list_changed": + if (!this._capabilities.prompts) { + throw new Error(`Server does not support notifying of prompt list changes (required for ${method})`); + } + break; + case "notifications/cancelled": + // Cancellation notifications are always allowed + break; + case "notifications/progress": + // Progress notifications are always allowed + break; + } + } + assertRequestHandlerCapability(method) { + switch (method) { + case "sampling/createMessage": + if (!this._capabilities.sampling) { + throw new Error(`Server does not support sampling (required for ${method})`); + } + break; + case "logging/setLevel": + if (!this._capabilities.logging) { + throw new Error(`Server does not support logging (required for ${method})`); + } + break; + case "prompts/get": + case "prompts/list": + if (!this._capabilities.prompts) { + throw new Error(`Server does not support prompts (required for ${method})`); + } + break; + case "resources/list": + case "resources/templates/list": + case "resources/read": + if (!this._capabilities.resources) { + throw new Error(`Server does not support resources (required for ${method})`); + } + break; + case "tools/call": + case "tools/list": + if (!this._capabilities.tools) { + throw new Error(`Server does not support tools (required for ${method})`); + } + break; + case "ping": + case "initialize": + // No specific capability required for these methods + break; + } + } + async _oninitialize(request) { + const requestedVersion = request.params.protocolVersion; + this._clientCapabilities = request.params.capabilities; + this._clientVersion = request.params.clientInfo; + return { + protocolVersion: types_js_1.SUPPORTED_PROTOCOL_VERSIONS.includes(requestedVersion) + ? requestedVersion + : types_js_1.LATEST_PROTOCOL_VERSION, + capabilities: this.getCapabilities(), + serverInfo: this._serverInfo, + ...(this._instructions && { instructions: this._instructions }), + }; + } + /** + * After initialization has completed, this will be populated with the client's reported capabilities. + */ + getClientCapabilities() { + return this._clientCapabilities; + } + /** + * After initialization has completed, this will be populated with information about the client's name and version. + */ + getClientVersion() { + return this._clientVersion; + } + getCapabilities() { + return this._capabilities; + } + async ping() { + return this.request({ method: "ping" }, types_js_1.EmptyResultSchema); + } + async createMessage(params, options) { + return this.request({ method: "sampling/createMessage", params }, types_js_1.CreateMessageResultSchema, options); + } + async listRoots(params, options) { + return this.request({ method: "roots/list", params }, types_js_1.ListRootsResultSchema, options); + } + async sendLoggingMessage(params) { + return this.notification({ method: "notifications/message", params }); + } + async sendResourceUpdated(params) { + return this.notification({ + method: "notifications/resources/updated", + params, + }); + } + async sendResourceListChanged() { + return this.notification({ + method: "notifications/resources/list_changed", + }); + } + async sendToolListChanged() { + return this.notification({ method: "notifications/tools/list_changed" }); + } + async sendPromptListChanged() { + return this.notification({ method: "notifications/prompts/list_changed" }); + } +} +exports.Server = Server; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/index.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/index.js.map new file mode 100644 index 0000000000..d7ec816edb --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":";;;AAAA,uDAK+B;AAC/B,0CAuBqB;AAcrB;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAa,MAIX,SAAQ,sBAIT;IAWC;;OA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AAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,mBAAmB;QACvB,OAAO,IAAI,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,kCAAkC,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED,KAAK,CAAC,qBAAqB;QACzB,OAAO,IAAI,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,oCAAoC,EAAE,CAAC,CAAC;IAC7E,CAAC;CACF;AAvQD,wBAuQC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/mcp.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/mcp.d.ts new file mode 100644 index 0000000000..525ec440b4 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/mcp.d.ts @@ -0,0 +1,271 @@ +import { Server, ServerOptions } from "./index.js"; +import { z, ZodRawShape, ZodObject, AnyZodObject, ZodTypeAny, ZodType, ZodTypeDef, ZodOptional } from "zod"; +import { Implementation, CallToolResult, Resource, ListResourcesResult, GetPromptResult, ReadResourceResult, ServerRequest, ServerNotification, ToolAnnotations } from "../types.js"; +import { UriTemplate, Variables } from "../shared/uriTemplate.js"; +import { RequestHandlerExtra } from "../shared/protocol.js"; +import { Transport } from "../shared/transport.js"; +/** + * High-level MCP server that provides a simpler API for working with resources, tools, and prompts. + * For advanced usage (like sending notifications or setting custom request handlers), use the underlying + * Server instance available via the `server` property. + */ +export declare class McpServer { + /** + * The underlying Server instance, useful for advanced operations like sending notifications. + */ + readonly server: Server; + private _registeredResources; + private _registeredResourceTemplates; + private _registeredTools; + private _registeredPrompts; + constructor(serverInfo: Implementation, options?: ServerOptions); + /** + * Attaches to the given transport, starts it, and starts listening for messages. + * + * The `server` object assumes ownership of the Transport, replacing any callbacks that have already been set, and expects that it is the only user of the Transport instance going forward. + */ + connect(transport: Transport): Promise; + /** + * Closes the connection. + */ + close(): Promise; + private _toolHandlersInitialized; + private setToolRequestHandlers; + private _completionHandlerInitialized; + private setCompletionRequestHandler; + private handlePromptCompletion; + private handleResourceCompletion; + private _resourceHandlersInitialized; + private setResourceRequestHandlers; + private _promptHandlersInitialized; + private setPromptRequestHandlers; + /** + * Registers a resource `name` at a fixed URI, which will use the given callback to respond to read requests. + */ + resource(name: string, uri: string, readCallback: ReadResourceCallback): RegisteredResource; + /** + * Registers a resource `name` at a fixed URI with metadata, which will use the given callback to respond to read requests. + */ + resource(name: string, uri: string, metadata: ResourceMetadata, readCallback: ReadResourceCallback): RegisteredResource; + /** + * Registers a resource `name` with a template pattern, which will use the given callback to respond to read requests. + */ + resource(name: string, template: ResourceTemplate, readCallback: ReadResourceTemplateCallback): RegisteredResourceTemplate; + /** + * Registers a resource `name` with a template pattern and metadata, which will use the given callback to respond to read requests. + */ + resource(name: string, template: ResourceTemplate, metadata: ResourceMetadata, readCallback: ReadResourceTemplateCallback): RegisteredResourceTemplate; + private _createRegisteredTool; + /** + * Registers a zero-argument tool `name`, which will run the given function when the client calls it. + */ + tool(name: string, cb: ToolCallback): RegisteredTool; + /** + * Registers a zero-argument tool `name` (with a description) which will run the given function when the client calls it. + */ + tool(name: string, description: string, cb: ToolCallback): RegisteredTool; + /** + * Registers a tool taking either a parameter schema for validation or annotations for additional metadata. + * This unified overload handles both `tool(name, paramsSchema, cb)` and `tool(name, annotations, cb)` cases. + * + * Note: We use a union type for the second parameter because TypeScript cannot reliably disambiguate + * between ToolAnnotations and ZodRawShape during overload resolution, as both are plain object types. + */ + tool(name: string, paramsSchemaOrAnnotations: Args | ToolAnnotations, cb: ToolCallback): RegisteredTool; + /** + * Registers a tool `name` (with a description) taking either parameter schema or annotations. + * This unified overload handles both `tool(name, description, paramsSchema, cb)` and + * `tool(name, description, annotations, cb)` cases. + * + * Note: We use a union type for the third parameter because TypeScript cannot reliably disambiguate + * between ToolAnnotations and ZodRawShape during overload resolution, as both are plain object types. + */ + tool(name: string, description: string, paramsSchemaOrAnnotations: Args | ToolAnnotations, cb: ToolCallback): RegisteredTool; + /** + * Registers a tool with both parameter schema and annotations. + */ + tool(name: string, paramsSchema: Args, annotations: ToolAnnotations, cb: ToolCallback): RegisteredTool; + /** + * Registers a tool with description, parameter schema, and annotations. + */ + tool(name: string, description: string, paramsSchema: Args, annotations: ToolAnnotations, cb: ToolCallback): RegisteredTool; + /** + * Registers a tool with a config object and callback. + */ + registerTool(name: string, config: { + description?: string; + inputSchema?: InputArgs; + outputSchema?: OutputArgs; + annotations?: ToolAnnotations; + }, cb: ToolCallback): RegisteredTool; + /** + * Registers a zero-argument prompt `name`, which will run the given function when the client calls it. + */ + prompt(name: string, cb: PromptCallback): RegisteredPrompt; + /** + * Registers a zero-argument prompt `name` (with a description) which will run the given function when the client calls it. + */ + prompt(name: string, description: string, cb: PromptCallback): RegisteredPrompt; + /** + * Registers a prompt `name` accepting the given arguments, which must be an object containing named properties associated with Zod schemas. When the client calls it, the function will be run with the parsed and validated arguments. + */ + prompt(name: string, argsSchema: Args, cb: PromptCallback): RegisteredPrompt; + /** + * Registers a prompt `name` (with a description) accepting the given arguments, which must be an object containing named properties associated with Zod schemas. When the client calls it, the function will be run with the parsed and validated arguments. + */ + prompt(name: string, description: string, argsSchema: Args, cb: PromptCallback): RegisteredPrompt; + /** + * Checks if the server is connected to a transport. + * @returns True if the server is connected + */ + isConnected(): boolean; + /** + * Sends a resource list changed event to the client, if connected. + */ + sendResourceListChanged(): void; + /** + * Sends a tool list changed event to the client, if connected. + */ + sendToolListChanged(): void; + /** + * Sends a prompt list changed event to the client, if connected. + */ + sendPromptListChanged(): void; +} +/** + * A callback to complete one variable within a resource template's URI template. + */ +export type CompleteResourceTemplateCallback = (value: string) => string[] | Promise; +/** + * A resource template combines a URI pattern with optional functionality to enumerate + * all resources matching that pattern. + */ +export declare class ResourceTemplate { + private _callbacks; + private _uriTemplate; + constructor(uriTemplate: string | UriTemplate, _callbacks: { + /** + * A callback to list all resources matching this template. This is required to specified, even if `undefined`, to avoid accidentally forgetting resource listing. + */ + list: ListResourcesCallback | undefined; + /** + * An optional callback to autocomplete variables within the URI template. Useful for clients and users to discover possible values. + */ + complete?: { + [variable: string]: CompleteResourceTemplateCallback; + }; + }); + /** + * Gets the URI template pattern. + */ + get uriTemplate(): UriTemplate; + /** + * Gets the list callback, if one was provided. + */ + get listCallback(): ListResourcesCallback | undefined; + /** + * Gets the callback for completing a specific URI template variable, if one was provided. + */ + completeCallback(variable: string): CompleteResourceTemplateCallback | undefined; +} +/** + * Callback for a tool handler registered with Server.tool(). + * + * Parameters will include tool arguments, if applicable, as well as other request handler context. + * + * The callback should return: + * - `structuredContent` if the tool has an outputSchema defined + * - `content` if the tool does not have an outputSchema + * - Both fields are optional but typically one should be provided + */ +export type ToolCallback = Args extends ZodRawShape ? (args: z.objectOutputType, extra: RequestHandlerExtra) => CallToolResult | Promise : (extra: RequestHandlerExtra) => CallToolResult | Promise; +export type RegisteredTool = { + description?: string; + inputSchema?: AnyZodObject; + outputSchema?: AnyZodObject; + annotations?: ToolAnnotations; + callback: ToolCallback; + enabled: boolean; + enable(): void; + disable(): void; + update(updates: { + name?: string | null; + description?: string; + paramsSchema?: InputArgs; + outputSchema?: OutputArgs; + annotations?: ToolAnnotations; + callback?: ToolCallback; + enabled?: boolean; + }): void; + remove(): void; +}; +/** + * Additional, optional information for annotating a resource. + */ +export type ResourceMetadata = Omit; +/** + * Callback to list all resources matching a given template. + */ +export type ListResourcesCallback = (extra: RequestHandlerExtra) => ListResourcesResult | Promise; +/** + * Callback to read a resource at a given URI. + */ +export type ReadResourceCallback = (uri: URL, extra: RequestHandlerExtra) => ReadResourceResult | Promise; +export type RegisteredResource = { + name: string; + metadata?: ResourceMetadata; + readCallback: ReadResourceCallback; + enabled: boolean; + enable(): void; + disable(): void; + update(updates: { + name?: string; + uri?: string | null; + metadata?: ResourceMetadata; + callback?: ReadResourceCallback; + enabled?: boolean; + }): void; + remove(): void; +}; +/** + * Callback to read a resource at a given URI, following a filled-in URI template. + */ +export type ReadResourceTemplateCallback = (uri: URL, variables: Variables, extra: RequestHandlerExtra) => ReadResourceResult | Promise; +export type RegisteredResourceTemplate = { + resourceTemplate: ResourceTemplate; + metadata?: ResourceMetadata; + readCallback: ReadResourceTemplateCallback; + enabled: boolean; + enable(): void; + disable(): void; + update(updates: { + name?: string | null; + template?: ResourceTemplate; + metadata?: ResourceMetadata; + callback?: ReadResourceTemplateCallback; + enabled?: boolean; + }): void; + remove(): void; +}; +type PromptArgsRawShape = { + [k: string]: ZodType | ZodOptional>; +}; +export type PromptCallback = Args extends PromptArgsRawShape ? (args: z.objectOutputType, extra: RequestHandlerExtra) => GetPromptResult | Promise : (extra: RequestHandlerExtra) => GetPromptResult | Promise; +export type RegisteredPrompt = { + description?: string; + argsSchema?: ZodObject; + callback: PromptCallback; + enabled: boolean; + enable(): void; + disable(): void; + update(updates: { + name?: string | null; + description?: string; + argsSchema?: Args; + callback?: PromptCallback; + enabled?: boolean; + }): void; + remove(): void; +}; +export {}; +//# sourceMappingURL=mcp.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/mcp.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/mcp.d.ts.map new file mode 100644 index 0000000000..3a6627ee09 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/mcp.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../src/server/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEnD,OAAO,EACL,CAAC,EACD,WAAW,EACX,SAAS,EAET,YAAY,EACZ,UAAU,EACV,OAAO,EACP,UAAU,EACV,WAAW,EACZ,MAAM,KAAK,CAAC;AACb,OAAO,EACL,cAAc,EAGd,cAAc,EAOd,QAAQ,EACR,mBAAmB,EAYnB,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EAClB,eAAe,EAChB,MAAM,aAAa,CAAC;AAErB,OAAO,EAA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Ae,CAAC,CAAC;AAElH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,SAAS,CAAC,kBAAkB,CAAC,CAAC;IAC3C,QAAQ,EAAE,cAAc,CAAC,SAAS,GAAG,kBAAkB,CAAC,CAAC;IACzD,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,IAAI,IAAI,CAAC;IACf,OAAO,IAAI,IAAI,CAAC;IAChB,MAAM,CAAC,IAAI,SAAS,kBAAkB,EAAE,OAAO,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,IAAI,CAAC;QAAC,QAAQ,CAAC,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAA;IAC7K,MAAM,IAAI,IAAI,CAAA;CACf,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/mcp.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/mcp.js new file mode 100644 index 0000000000..d6f5f0f929 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/mcp.js @@ -0,0 +1,608 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ResourceTemplate = exports.McpServer = void 0; +const index_js_1 = require("./index.js"); +const zod_to_json_schema_1 = require("zod-to-json-schema"); +const zod_1 = require("zod"); +const types_js_1 = require("../types.js"); +const completable_js_1 = require("./completable.js"); +const uriTemplate_js_1 = require("../shared/uriTemplate.js"); +/** + * High-level MCP server that provides a simpler API for working with resources, tools, and prompts. + * For advanced usage (like sending notifications or setting custom request handlers), use the underlying + * Server instance available via the `server` property. + */ +class McpServer { + constructor(serverInfo, options) { + this._registeredResources = {}; + this._registeredResourceTemplates = {}; + this._registeredTools = {}; + this._registeredPrompts = {}; + this._toolHandlersInitialized = false; + this._completionHandlerInitialized = false; + this._resourceHandlersInitialized = false; + this._promptHandlersInitialized = false; + this.server = new index_js_1.Server(serverInfo, options); + } + /** + * Attaches to the given transport, starts it, and starts listening for messages. + * + * The `server` object assumes ownership of the Transport, replacing any callbacks that have already been set, and expects that it is the only user of the Transport instance going forward. + */ + async connect(transport) { + return await this.server.connect(transport); + } + /** + * Closes the connection. + */ + async close() { + await this.server.close(); + } + setToolRequestHandlers() { + if (this._toolHandlersInitialized) { + return; + } + this.server.assertCanSetRequestHandler(types_js_1.ListToolsRequestSchema.shape.method.value); + this.server.assertCanSetRequestHandler(types_js_1.CallToolRequestSchema.shape.method.value); + this.server.registerCapabilities({ + tools: { + listChanged: true + } + }); + this.server.setRequestHandler(types_js_1.ListToolsRequestSchema, () => ({ + tools: Object.entries(this._registeredTools).filter(([, tool]) => tool.enabled).map(([name, tool]) => { + const toolDefinition = { + name, + description: tool.description, + inputSchema: tool.inputSchema + ? (0, zod_to_json_schema_1.zodToJsonSchema)(tool.inputSchema, { + strictUnions: true, + }) + : EMPTY_OBJECT_JSON_SCHEMA, + annotations: tool.annotations, + }; + if (tool.outputSchema) { + toolDefinition.outputSchema = (0, zod_to_json_schema_1.zodToJsonSchema)(tool.outputSchema, { strictUnions: true }); + } + return toolDefinition; + }), + })); + this.server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request, extra) => { + const tool = this._registeredTools[request.params.name]; + if (!tool) { + throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Tool ${request.params.name} not found`); + } + if (!tool.enabled) { + throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Tool ${request.params.name} disabled`); + } + let result; + if (tool.inputSchema) { + const parseResult = await tool.inputSchema.safeParseAsync(request.params.arguments); + if (!parseResult.success) { + throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Invalid arguments for tool ${request.params.name}: ${parseResult.error.message}`); + } + const args = parseResult.data; + const cb = tool.callback; + try { + result = await Promise.resolve(cb(args, extra)); + } + catch (error) { + result = { + content: [ + { + type: "text", + text: error instanceof Error ? error.message : String(error), + }, + ], + isError: true, + }; + } + } + else { + const cb = tool.callback; + try { + result = await Promise.resolve(cb(extra)); + } + catch (error) { + result = { + content: [ + { + type: "text", + text: error instanceof Error ? error.message : String(error), + }, + ], + isError: true, + }; + } + } + if (tool.outputSchema) { + if (!result.structuredContent) { + throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Tool ${request.params.name} has an output schema but no structured content was provided`); + } + // if the tool has an output schema, validate structured content + const parseResult = await tool.outputSchema.safeParseAsync(result.structuredContent); + if (!parseResult.success) { + throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Invalid structured content for tool ${request.params.name}: ${parseResult.error.message}`); + } + } + return result; + }); + this._toolHandlersInitialized = true; + } + setCompletionRequestHandler() { + if (this._completionHandlerInitialized) { + return; + } + this.server.assertCanSetRequestHandler(types_js_1.CompleteRequestSchema.shape.method.value); + this.server.registerCapabilities({ + completions: {}, + }); + this.server.setRequestHandler(types_js_1.CompleteRequestSchema, async (request) => { + switch (request.params.ref.type) { + case "ref/prompt": + return this.handlePromptCompletion(request, request.params.ref); + case "ref/resource": + return this.handleResourceCompletion(request, request.params.ref); + default: + throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Invalid completion reference: ${request.params.ref}`); + } + }); + this._completionHandlerInitialized = true; + } + async handlePromptCompletion(request, ref) { + const prompt = this._registeredPrompts[ref.name]; + if (!prompt) { + throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Prompt ${ref.name} not found`); + } + if (!prompt.enabled) { + throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Prompt ${ref.name} disabled`); + } + if (!prompt.argsSchema) { + return EMPTY_COMPLETION_RESULT; + } + const field = prompt.argsSchema.shape[request.params.argument.name]; + if (!(field instanceof completable_js_1.Completable)) { + return EMPTY_COMPLETION_RESULT; + } + const def = field._def; + const suggestions = await def.complete(request.params.argument.value); + return createCompletionResult(suggestions); + } + async handleResourceCompletion(request, ref) { + const template = Object.values(this._registeredResourceTemplates).find((t) => t.resourceTemplate.uriTemplate.toString() === ref.uri); + if (!template) { + if (this._registeredResources[ref.uri]) { + // Attempting to autocomplete a fixed resource URI is not an error in the spec (but probably should be). + return EMPTY_COMPLETION_RESULT; + } + throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Resource template ${request.params.ref.uri} not found`); + } + const completer = template.resourceTemplate.completeCallback(request.params.argument.name); + if (!completer) { + return EMPTY_COMPLETION_RESULT; + } + const suggestions = await completer(request.params.argument.value); + return createCompletionResult(suggestions); + } + setResourceRequestHandlers() { + if (this._resourceHandlersInitialized) { + return; + } + this.server.assertCanSetRequestHandler(types_js_1.ListResourcesRequestSchema.shape.method.value); + this.server.assertCanSetRequestHandler(types_js_1.ListResourceTemplatesRequestSchema.shape.method.value); + this.server.assertCanSetRequestHandler(types_js_1.ReadResourceRequestSchema.shape.method.value); + this.server.registerCapabilities({ + resources: { + listChanged: true + } + }); + this.server.setRequestHandler(types_js_1.ListResourcesRequestSchema, async (request, extra) => { + const resources = Object.entries(this._registeredResources).filter(([_, resource]) => resource.enabled).map(([uri, resource]) => ({ + uri, + name: resource.name, + ...resource.metadata, + })); + const templateResources = []; + for (const template of Object.values(this._registeredResourceTemplates)) { + if (!template.resourceTemplate.listCallback) { + continue; + } + const result = await template.resourceTemplate.listCallback(extra); + for (const resource of result.resources) { + templateResources.push({ + ...template.metadata, + // the defined resource metadata should override the template metadata if present + ...resource, + }); + } + } + return { resources: [...resources, ...templateResources] }; + }); + this.server.setRequestHandler(types_js_1.ListResourceTemplatesRequestSchema, async () => { + const resourceTemplates = Object.entries(this._registeredResourceTemplates).map(([name, template]) => ({ + name, + uriTemplate: template.resourceTemplate.uriTemplate.toString(), + ...template.metadata, + })); + return { resourceTemplates }; + }); + this.server.setRequestHandler(types_js_1.ReadResourceRequestSchema, async (request, extra) => { + const uri = new URL(request.params.uri); + // First check for exact resource match + const resource = this._registeredResources[uri.toString()]; + if (resource) { + if (!resource.enabled) { + throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Resource ${uri} disabled`); + } + return resource.readCallback(uri, extra); + } + // Then check templates + for (const template of Object.values(this._registeredResourceTemplates)) { + const variables = template.resourceTemplate.uriTemplate.match(uri.toString()); + if (variables) { + return template.readCallback(uri, variables, extra); + } + } + throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Resource ${uri} not found`); + }); + this.setCompletionRequestHandler(); + this._resourceHandlersInitialized = true; + } + setPromptRequestHandlers() { + if (this._promptHandlersInitialized) { + return; + } + this.server.assertCanSetRequestHandler(types_js_1.ListPromptsRequestSchema.shape.method.value); + this.server.assertCanSetRequestHandler(types_js_1.GetPromptRequestSchema.shape.method.value); + this.server.registerCapabilities({ + prompts: { + listChanged: true + } + }); + this.server.setRequestHandler(types_js_1.ListPromptsRequestSchema, () => ({ + prompts: Object.entries(this._registeredPrompts).filter(([, prompt]) => prompt.enabled).map(([name, prompt]) => { + return { + name, + description: prompt.description, + arguments: prompt.argsSchema + ? promptArgumentsFromSchema(prompt.argsSchema) + : undefined, + }; + }), + })); + this.server.setRequestHandler(types_js_1.GetPromptRequestSchema, async (request, extra) => { + const prompt = this._registeredPrompts[request.params.name]; + if (!prompt) { + throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Prompt ${request.params.name} not found`); + } + if (!prompt.enabled) { + throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Prompt ${request.params.name} disabled`); + } + if (prompt.argsSchema) { + const parseResult = await prompt.argsSchema.safeParseAsync(request.params.arguments); + if (!parseResult.success) { + throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Invalid arguments for prompt ${request.params.name}: ${parseResult.error.message}`); + } + const args = parseResult.data; + const cb = prompt.callback; + return await Promise.resolve(cb(args, extra)); + } + else { + const cb = prompt.callback; + return await Promise.resolve(cb(extra)); + } + }); + this.setCompletionRequestHandler(); + this._promptHandlersInitialized = true; + } + resource(name, uriOrTemplate, ...rest) { + let metadata; + if (typeof rest[0] === "object") { + metadata = rest.shift(); + } + const readCallback = rest[0]; + if (typeof uriOrTemplate === "string") { + if (this._registeredResources[uriOrTemplate]) { + throw new Error(`Resource ${uriOrTemplate} is already registered`); + } + const registeredResource = { + name, + metadata, + readCallback: readCallback, + enabled: true, + disable: () => registeredResource.update({ enabled: false }), + enable: () => registeredResource.update({ enabled: true }), + remove: () => registeredResource.update({ uri: null }), + update: (updates) => { + if (typeof updates.uri !== "undefined" && updates.uri !== uriOrTemplate) { + delete this._registeredResources[uriOrTemplate]; + if (updates.uri) + this._registeredResources[updates.uri] = registeredResource; + } + if (typeof updates.name !== "undefined") + registeredResource.name = updates.name; + if (typeof updates.metadata !== "undefined") + registeredResource.metadata = updates.metadata; + if (typeof updates.callback !== "undefined") + registeredResource.readCallback = updates.callback; + if (typeof updates.enabled !== "undefined") + registeredResource.enabled = updates.enabled; + this.sendResourceListChanged(); + }, + }; + this._registeredResources[uriOrTemplate] = registeredResource; + this.setResourceRequestHandlers(); + this.sendResourceListChanged(); + return registeredResource; + } + else { + if (this._registeredResourceTemplates[name]) { + throw new Error(`Resource template ${name} is already registered`); + } + const registeredResourceTemplate = { + resourceTemplate: uriOrTemplate, + metadata, + readCallback: readCallback, + enabled: true, + disable: () => registeredResourceTemplate.update({ enabled: false }), + enable: () => registeredResourceTemplate.update({ enabled: true }), + remove: () => registeredResourceTemplate.update({ name: null }), + update: (updates) => { + if (typeof updates.name !== "undefined" && updates.name !== name) { + delete this._registeredResourceTemplates[name]; + if (updates.name) + this._registeredResourceTemplates[updates.name] = registeredResourceTemplate; + } + if (typeof updates.template !== "undefined") + registeredResourceTemplate.resourceTemplate = updates.template; + if (typeof updates.metadata !== "undefined") + registeredResourceTemplate.metadata = updates.metadata; + if (typeof updates.callback !== "undefined") + registeredResourceTemplate.readCallback = updates.callback; + if (typeof updates.enabled !== "undefined") + registeredResourceTemplate.enabled = updates.enabled; + this.sendResourceListChanged(); + }, + }; + this._registeredResourceTemplates[name] = registeredResourceTemplate; + this.setResourceRequestHandlers(); + this.sendResourceListChanged(); + return registeredResourceTemplate; + } + } + _createRegisteredTool(name, description, inputSchema, outputSchema, annotations, callback) { + const registeredTool = { + description, + inputSchema: inputSchema === undefined ? undefined : zod_1.z.object(inputSchema), + outputSchema: outputSchema === undefined ? undefined : zod_1.z.object(outputSchema), + annotations, + callback, + enabled: true, + disable: () => registeredTool.update({ enabled: false }), + enable: () => registeredTool.update({ enabled: true }), + remove: () => registeredTool.update({ name: null }), + update: (updates) => { + if (typeof updates.name !== "undefined" && updates.name !== name) { + delete this._registeredTools[name]; + if (updates.name) + this._registeredTools[updates.name] = registeredTool; + } + if (typeof updates.description !== "undefined") + registeredTool.description = updates.description; + if (typeof updates.paramsSchema !== "undefined") + registeredTool.inputSchema = zod_1.z.object(updates.paramsSchema); + if (typeof updates.callback !== "undefined") + registeredTool.callback = updates.callback; + if (typeof updates.annotations !== "undefined") + registeredTool.annotations = updates.annotations; + if (typeof updates.enabled !== "undefined") + registeredTool.enabled = updates.enabled; + this.sendToolListChanged(); + }, + }; + this._registeredTools[name] = registeredTool; + this.setToolRequestHandlers(); + this.sendToolListChanged(); + return registeredTool; + } + /** + * tool() implementation. Parses arguments passed to overrides defined above. + */ + tool(name, ...rest) { + if (this._registeredTools[name]) { + throw new Error(`Tool ${name} is already registered`); + } + let description; + let inputSchema; + let outputSchema; + let annotations; + // Tool properties are passed as separate arguments, with omissions allowed. + // Support for this style is frozen as of protocol version 2025-03-26. Future additions + // to tool definition should *NOT* be added. + if (typeof rest[0] === "string") { + description = rest.shift(); + } + // Handle the different overload combinations + if (rest.length > 1) { + // We have at least one more arg before the callback + const firstArg = rest[0]; + if (isZodRawShape(firstArg)) { + // We have a params schema as the first arg + inputSchema = rest.shift(); + // Check if the next arg is potentially annotations + if (rest.length > 1 && typeof rest[0] === "object" && rest[0] !== null && !(isZodRawShape(rest[0]))) { + // Case: tool(name, paramsSchema, annotations, cb) + // Or: tool(name, description, paramsSchema, annotations, cb) + annotations = rest.shift(); + } + } + else if (typeof firstArg === "object" && firstArg !== null) { + // Not a ZodRawShape, so must be annotations in this position + // Case: tool(name, annotations, cb) + // Or: tool(name, description, annotations, cb) + annotations = rest.shift(); + } + } + const callback = rest[0]; + return this._createRegisteredTool(name, description, inputSchema, outputSchema, annotations, callback); + } + /** + * Registers a tool with a config object and callback. + */ + registerTool(name, config, cb) { + if (this._registeredTools[name]) { + throw new Error(`Tool ${name} is already registered`); + } + const { description, inputSchema, outputSchema, annotations } = config; + return this._createRegisteredTool(name, description, inputSchema, outputSchema, annotations, cb); + } + prompt(name, ...rest) { + if (this._registeredPrompts[name]) { + throw new Error(`Prompt ${name} is already registered`); + } + let description; + if (typeof rest[0] === "string") { + description = rest.shift(); + } + let argsSchema; + if (rest.length > 1) { + argsSchema = rest.shift(); + } + const cb = rest[0]; + const registeredPrompt = { + description, + argsSchema: argsSchema === undefined ? undefined : zod_1.z.object(argsSchema), + callback: cb, + enabled: true, + disable: () => registeredPrompt.update({ enabled: false }), + enable: () => registeredPrompt.update({ enabled: true }), + remove: () => registeredPrompt.update({ name: null }), + update: (updates) => { + if (typeof updates.name !== "undefined" && updates.name !== name) { + delete this._registeredPrompts[name]; + if (updates.name) + this._registeredPrompts[updates.name] = registeredPrompt; + } + if (typeof updates.description !== "undefined") + registeredPrompt.description = updates.description; + if (typeof updates.argsSchema !== "undefined") + registeredPrompt.argsSchema = zod_1.z.object(updates.argsSchema); + if (typeof updates.callback !== "undefined") + registeredPrompt.callback = updates.callback; + if (typeof updates.enabled !== "undefined") + registeredPrompt.enabled = updates.enabled; + this.sendPromptListChanged(); + }, + }; + this._registeredPrompts[name] = registeredPrompt; + this.setPromptRequestHandlers(); + this.sendPromptListChanged(); + return registeredPrompt; + } + /** + * Checks if the server is connected to a transport. + * @returns True if the server is connected + */ + isConnected() { + return this.server.transport !== undefined; + } + /** + * Sends a resource list changed event to the client, if connected. + */ + sendResourceListChanged() { + if (this.isConnected()) { + this.server.sendResourceListChanged(); + } + } + /** + * Sends a tool list changed event to the client, if connected. + */ + sendToolListChanged() { + if (this.isConnected()) { + this.server.sendToolListChanged(); + } + } + /** + * Sends a prompt list changed event to the client, if connected. + */ + sendPromptListChanged() { + if (this.isConnected()) { + this.server.sendPromptListChanged(); + } + } +} +exports.McpServer = McpServer; +/** + * A resource template combines a URI pattern with optional functionality to enumerate + * all resources matching that pattern. + */ +class ResourceTemplate { + constructor(uriTemplate, _callbacks) { + this._callbacks = _callbacks; + this._uriTemplate = + typeof uriTemplate === "string" + ? new uriTemplate_js_1.UriTemplate(uriTemplate) + : uriTemplate; + } + /** + * Gets the URI template pattern. + */ + get uriTemplate() { + return this._uriTemplate; + } + /** + * Gets the list callback, if one was provided. + */ + get listCallback() { + return this._callbacks.list; + } + /** + * Gets the callback for completing a specific URI template variable, if one was provided. + */ + completeCallback(variable) { + var _a; + return (_a = this._callbacks.complete) === null || _a === void 0 ? void 0 : _a[variable]; + } +} +exports.ResourceTemplate = ResourceTemplate; +const EMPTY_OBJECT_JSON_SCHEMA = { + type: "object", +}; +// Helper to check if an object is a Zod schema (ZodRawShape) +function isZodRawShape(obj) { + if (typeof obj !== "object" || obj === null) + return false; + const isEmptyObject = Object.keys(obj).length === 0; + // Check if object is empty or at least one property is a ZodType instance + // Note: use heuristic check to avoid instanceof failure across different Zod versions + return isEmptyObject || Object.values(obj).some(isZodTypeLike); +} +function isZodTypeLike(value) { + return value !== null && + typeof value === 'object' && + 'parse' in value && typeof value.parse === 'function' && + 'safeParse' in value && typeof value.safeParse === 'function'; +} +function promptArgumentsFromSchema(schema) { + return Object.entries(schema.shape).map(([name, field]) => ({ + name, + description: field.description, + required: !field.isOptional(), + })); +} +function createCompletionResult(suggestions) { + return { + completion: { + values: suggestions.slice(0, 100), + total: suggestions.length, + hasMore: suggestions.length > 100, + }, + }; +} +const EMPTY_COMPLETION_RESULT = { + completion: { + values: [], + hasMore: false, + }, +}; +//# sourceMappingURL=mcp.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/mcp.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/mcp.js.map new file mode 100644 index 0000000000..cdb3fec0a7 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/mcp.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../../src/server/mcp.ts"],"names":[],"mappings":";;;AAAA,yCAAmD;AACnD,2DAAqD;AACrD,6BAUa;AACb,0CA6BqB;AACrB,qDAA+D;AAC/D,6DAAkE;AAIlE;;;;GAIG;AACH,MAAa,SAAS;IAapB,YAAY,UAA0B,EAAE,OAAuB;QAPvD,yBAAoB,GAA0C,EAAE,CAAC;QACjE,iCAA4B,GAEhC,EAAE,CAAC;QACC,qBAAgB,GAAuC,EAAE,CAAC;QAC1D,uBAAkB,GAAyC,EAAE,CAAC;QAsB9D,6BAAwB,GAAG,KAAK,CAAC;QA6IjC,kCAA6B,GAAG,KAAK,CAAC;QAqGtC,iCAA4B,GAAG,KAAK,CAAC;QAkHrC,+BAA0B,GAAG,KAAK,CAAC;QAvXzC,IAAI,CAAC,MAAM,GAAG,IAAI,iBAAM,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAChD,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,OAAO,CAAC,SAAoB;QAChC,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAC9C,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,KAAK;QACT,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IAC5B,CAAC;IAIO,sBAAsB;QAC5B,IAAI,IAAI,CAAC,wBAAwB,EAAE,CAAC;YAClC,OAAO;QACT,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,0BAA0B,CACpC,iCAAsB,CAAC,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MAAM,uBAAuB,GAAmB;IAC9C,UAAU,EAAE;QACV,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,KAAK;KACf;CACF,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/sse.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/sse.d.ts new file mode 100644 index 0000000000..5fb4e8d36d --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/sse.d.ts @@ -0,0 +1,53 @@ +import { IncomingMessage, ServerResponse } from "node:http"; +import { Transport } from "../shared/transport.js"; +import { JSONRPCMessage } from "../types.js"; +import { AuthInfo } from "./auth/types.js"; +/** + * Server transport for SSE: this will send messages over an SSE connection and receive messages from HTTP POST requests. + * + * This transport is only available in Node.js environments. + */ +export declare class SSEServerTransport implements Transport { + private _endpoint; + private res; + private _sseResponse?; + private _sessionId; + onclose?: () => void; + onerror?: (error: Error) => void; + onmessage?: (message: JSONRPCMessage, extra?: { + authInfo?: AuthInfo; + }) => void; + /** + * Creates a new SSE server transport, which will direct the client to POST messages to the relative or absolute URL identified by `_endpoint`. + */ + constructor(_endpoint: string, res: ServerResponse); + /** + * Handles the initial SSE connection request. + * + * This should be called when a GET request is made to establish the SSE stream. + */ + start(): Promise; + /** + * Handles incoming POST messages. + * + * This should be called when a POST request is made to send a message to the server. + */ + handlePostMessage(req: IncomingMessage & { + auth?: AuthInfo; + }, res: ServerResponse, parsedBody?: unknown): Promise; + /** + * Handle a client message, regardless of how it arrived. This can be used to inform the server of messages that arrive via a means different than HTTP POST. + */ + handleMessage(message: unknown, extra?: { + authInfo?: AuthInfo; + }): Promise; + close(): Promise; + send(message: JSONRPCMessage): Promise; + /** + * Returns the session ID for this transport. + * + * This can be used to route incoming POST requests. + */ + get sessionId(): string; +} +//# sourceMappingURL=sse.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/sse.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/sse.d.ts.map new file mode 100644 index 0000000000..66c20c62ac --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/sse.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"sse.d.ts","sourceRoot":"","sources":["../../../src/server/sse.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAwB,MAAM,aAAa,CAAC;AAGnE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAK3C;;;;GAIG;AACH,qBAAa,kBAAmB,YAAW,SAAS;IAYhD,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,GAAG;IAZb,OAAO,CAAC,YAAY,CAAC,CAAiB;IACtC,OAAO,CAAC,UAAU,CAAS;IAE3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,QAAQ,CAAA;KAAE,KAAK,IAAI,CAAC;IAE/E;;OAEG;gBAEO,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,cAAc;IAK7B;;;;OAIG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAkC5B;;;;OAIG;IACG,iBAAiB,CACrB,GAAG,EAAE,eAAe,GAAG;QAAE,IAAI,CAAC,EAAE,QAAQ,CAAA;KAAE,EAC1C,GAAG,EAAE,cAAc,EACnB,UAAU,CAAC,EAAE,OAAO,GACnB,OAAO,CAAC,IAAI,CAAC;IAmChB;;OAEG;IACG,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAY/E,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAMtB,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAUlD;;;;OAIG;IACH,IAAI,SAAS,IAAI,MAAM,CAEtB;CACF"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/sse.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/sse.js new file mode 100644 index 0000000000..ba367078b0 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/sse.js @@ -0,0 +1,132 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SSEServerTransport = void 0; +const node_crypto_1 = require("node:crypto"); +const types_js_1 = require("../types.js"); +const raw_body_1 = __importDefault(require("raw-body")); +const content_type_1 = __importDefault(require("content-type")); +const url_1 = require("url"); +const MAXIMUM_MESSAGE_SIZE = "4mb"; +/** + * Server transport for SSE: this will send messages over an SSE connection and receive messages from HTTP POST requests. + * + * This transport is only available in Node.js environments. + */ +class SSEServerTransport { + /** + * Creates a new SSE server transport, which will direct the client to POST messages to the relative or absolute URL identified by `_endpoint`. + */ + constructor(_endpoint, res) { + this._endpoint = _endpoint; + this.res = res; + this._sessionId = (0, node_crypto_1.randomUUID)(); + } + /** + * Handles the initial SSE connection request. + * + * This should be called when a GET request is made to establish the SSE stream. + */ + async start() { + if (this._sseResponse) { + throw new Error("SSEServerTransport already started! If using Server class, note that connect() calls start() automatically."); + } + this.res.writeHead(200, { + "Content-Type": "text/event-stream", + "Cache-Control": "no-cache, no-transform", + Connection: "keep-alive", + }); + // Send the endpoint event + // Use a dummy base URL because this._endpoint is relative. + // This allows using URL/URLSearchParams for robust parameter handling. + const dummyBase = 'http://localhost'; // Any valid base works + const endpointUrl = new url_1.URL(this._endpoint, dummyBase); + endpointUrl.searchParams.set('sessionId', this._sessionId); + // Reconstruct the relative URL string (pathname + search + hash) + const relativeUrlWithSession = endpointUrl.pathname + endpointUrl.search + endpointUrl.hash; + this.res.write(`event: endpoint\ndata: ${relativeUrlWithSession}\n\n`); + this._sseResponse = this.res; + this.res.on("close", () => { + var _a; + this._sseResponse = undefined; + (_a = this.onclose) === null || _a === void 0 ? void 0 : _a.call(this); + }); + } + /** + * Handles incoming POST messages. + * + * This should be called when a POST request is made to send a message to the server. + */ + async handlePostMessage(req, res, parsedBody) { + var _a, _b, _c; + if (!this._sseResponse) { + const message = "SSE connection not established"; + res.writeHead(500).end(message); + throw new Error(message); + } + const authInfo = req.auth; + let body; + try { + const ct = content_type_1.default.parse((_a = req.headers["content-type"]) !== null && _a !== void 0 ? _a : ""); + if (ct.type !== "application/json") { + throw new Error(`Unsupported content-type: ${ct}`); + } + body = parsedBody !== null && parsedBody !== void 0 ? parsedBody : await (0, raw_body_1.default)(req, { + limit: MAXIMUM_MESSAGE_SIZE, + encoding: (_b = ct.parameters.charset) !== null && _b !== void 0 ? _b : "utf-8", + }); + } + catch (error) { + res.writeHead(400).end(String(error)); + (_c = this.onerror) === null || _c === void 0 ? void 0 : _c.call(this, error); + return; + } + try { + await this.handleMessage(typeof body === 'string' ? JSON.parse(body) : body, { authInfo }); + } + catch (_d) { + res.writeHead(400).end(`Invalid message: ${body}`); + return; + } + res.writeHead(202).end("Accepted"); + } + /** + * Handle a client message, regardless of how it arrived. This can be used to inform the server of messages that arrive via a means different than HTTP POST. + */ + async handleMessage(message, extra) { + var _a, _b; + let parsedMessage; + try { + parsedMessage = types_js_1.JSONRPCMessageSchema.parse(message); + } + catch (error) { + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + throw error; + } + (_b = this.onmessage) === null || _b === void 0 ? void 0 : _b.call(this, parsedMessage, extra); + } + async close() { + var _a, _b; + (_a = this._sseResponse) === null || _a === void 0 ? void 0 : _a.end(); + this._sseResponse = undefined; + (_b = this.onclose) === null || _b === void 0 ? void 0 : _b.call(this); + } + async send(message) { + if (!this._sseResponse) { + throw new Error("Not connected"); + } + this._sseResponse.write(`event: message\ndata: ${JSON.stringify(message)}\n\n`); + } + /** + * Returns the session ID for this transport. + * + * This can be used to route incoming POST requests. + */ + get sessionId() { + return this._sessionId; + } +} +exports.SSEServerTransport = SSEServerTransport; +//# sourceMappingURL=sse.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/sse.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/sse.js.map new file mode 100644 index 0000000000..28caedecb5 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/sse.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sse.js","sourceRoot":"","sources":["../../../src/server/sse.ts"],"names":[],"mappings":";;;;;;AAAA,6CAAyC;AAGzC,0CAAmE;AACnE,wDAAkC;AAClC,gEAAuC;AAEvC,6BAA0B;AAE1B,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAEnC;;;;GAIG;AACH,MAAa,kBAAkB;IAQ7B;;OAEG;IACH,YACU,SAAiB,EACjB,GAAmB;QADnB,cAAS,GAAT,SAAS,CAAQ;QACjB,QAAG,GAAH,GAAG,CAAgB;QAE3B,IAAI,CAAC,UAAU,GAAG,IAAA,wBAAU,GAAE,CAAC;IACjC,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,KAAK;QACT,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CACb,6GAA6G,CAC9G,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE;YACtB,cAAc,EAAE,mBAAmB;YACnC,eAAe,EAAE,wBAAwB;YACzC,UAAU,EAAE,YAAY;SACzB,CAAC,CAAC;QAEH,0BAA0B;QAC1B,2DAA2D;QAC3D,uEAAuE;QACvE,MAAM,SAAS,GAAG,k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S,qDAAG,aAAa,EAAE,KAAK,CAAC,CAAC;IACzC,CAAC;IAED,KAAK,CAAC,KAAK;;QACT,MAAA,IAAI,CAAC,YAAY,0CAAE,GAAG,EAAE,CAAC;QACzB,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC;QAC9B,MAAA,IAAI,CAAC,OAAO,oDAAI,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,OAAuB;QAChC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YACvB,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;QACnC,CAAC;QAED,IAAI,CAAC,YAAY,CAAC,KAAK,CACrB,yBAAyB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CACvD,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;CACF;AA5ID,gDA4IC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/stdio.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/stdio.d.ts new file mode 100644 index 0000000000..92ab191948 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/stdio.d.ts @@ -0,0 +1,28 @@ +import { Readable, Writable } from "node:stream"; +import { JSONRPCMessage } from "../types.js"; +import { Transport } from "../shared/transport.js"; +/** + * Server transport for stdio: this communicates with a MCP client by reading from the current process' stdin and writing to stdout. + * + * This transport is only available in Node.js environments. + */ +export declare class StdioServerTransport implements Transport { + private _stdin; + private _stdout; + private _readBuffer; + private _started; + constructor(_stdin?: Readable, _stdout?: Writable); + onclose?: () => void; + onerror?: (error: Error) => void; + onmessage?: (message: JSONRPCMessage) => void; + _ondata: (chunk: Buffer) => void; + _onerror: (error: Error) => void; + /** + * Starts listening for messages on stdin. + */ + start(): Promise; + private processReadBuffer; + close(): Promise; + send(message: JSONRPCMessage): Promise; +} +//# sourceMappingURL=stdio.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/stdio.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/stdio.d.ts.map new file mode 100644 index 0000000000..d2d2417ab7 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/stdio.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"stdio.d.ts","sourceRoot":"","sources":["../../../src/server/stdio.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD;;;;GAIG;AACH,qBAAa,oBAAqB,YAAW,SAAS;IAKlD,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,OAAO;IALjB,OAAO,CAAC,WAAW,CAAgC;IACnD,OAAO,CAAC,QAAQ,CAAS;gBAGf,MAAM,GAAE,QAAwB,EAChC,OAAO,GAAE,QAAyB;IAG5C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;IAG9C,OAAO,UAAW,MAAM,UAGtB;IACF,QAAQ,UAAW,KAAK,UAEtB;IAEF;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAY5B,OAAO,CAAC,iBAAiB;IAenB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAkB5B,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAU7C"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/stdio.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/stdio.js new file mode 100644 index 0000000000..0500c2217d --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/stdio.js @@ -0,0 +1,85 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.StdioServerTransport = void 0; +const node_process_1 = __importDefault(require("node:process")); +const stdio_js_1 = require("../shared/stdio.js"); +/** + * Server transport for stdio: this communicates with a MCP client by reading from the current process' stdin and writing to stdout. + * + * This transport is only available in Node.js environments. + */ +class StdioServerTransport { + constructor(_stdin = node_process_1.default.stdin, _stdout = node_process_1.default.stdout) { + this._stdin = _stdin; + this._stdout = _stdout; + this._readBuffer = new stdio_js_1.ReadBuffer(); + this._started = false; + // Arrow functions to bind `this` properly, while maintaining function identity. + this._ondata = (chunk) => { + this._readBuffer.append(chunk); + this.processReadBuffer(); + }; + this._onerror = (error) => { + var _a; + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + }; + } + /** + * Starts listening for messages on stdin. + */ + async start() { + if (this._started) { + throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically."); + } + this._started = true; + this._stdin.on("data", this._ondata); + this._stdin.on("error", this._onerror); + } + processReadBuffer() { + var _a, _b; + while (true) { + try { + const message = this._readBuffer.readMessage(); + if (message === null) { + break; + } + (_a = this.onmessage) === null || _a === void 0 ? void 0 : _a.call(this, message); + } + catch (error) { + (_b = this.onerror) === null || _b === void 0 ? void 0 : _b.call(this, error); + } + } + } + async close() { + var _a; + // Remove our event listeners first + this._stdin.off("data", this._ondata); + this._stdin.off("error", this._onerror); + // Check if we were the only data listener + const remainingDataListeners = this._stdin.listenerCount('data'); + if (remainingDataListeners === 0) { + // Only pause stdin if we were the only listener + // This prevents interfering with other parts of the application that might be using stdin + this._stdin.pause(); + } + // Clear the buffer and notify closure + this._readBuffer.clear(); + (_a = this.onclose) === null || _a === void 0 ? void 0 : _a.call(this); + } + send(message) { + return new Promise((resolve) => { + const json = (0, stdio_js_1.serializeMessage)(message); + if (this._stdout.write(json)) { + resolve(); + } + else { + this._stdout.once("drain", resolve); + } + }); + } +} +exports.StdioServerTransport = StdioServerTransport; +//# sourceMappingURL=stdio.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/stdio.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/stdio.js.map new file mode 100644 index 0000000000..4cbd76844d --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/stdio.js.map @@ -0,0 +1 @@ +{"version":3,"file":"stdio.js","sourceRoot":"","sources":["../../../src/server/stdio.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAmC;AAEnC,iDAAkE;AAIlE;;;;GAIG;AACH,MAAa,oBAAoB;IAI/B,YACU,SAAmB,sBAAO,CAAC,KAAK,EAChC,UAAoB,sBAAO,CAAC,MAAM;QADlC,WAAM,GAAN,MAAM,CAA0B;QAChC,YAAO,GAAP,OAAO,CAA2B;QALpC,gBAAW,GAAe,IAAI,qBAAU,EAAE,CAAC;QAC3C,aAAQ,GAAG,KAAK,CAAC;QAWzB,gFAAgF;QAChF,YAAO,GAAG,CAAC,KAAa,EAAE,EAAE;YAC1B,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC/B,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAC3B,CAAC,CAAC;QACF,aAAQ,GAAG,CAAC,KAAY,EAAE,EAAE;;YAC1B,MAAA,IAAI,CAAC,OAAO,qDAAG,KAAK,CAAC,CAAC;QACxB,CAAC,CAAC;IAbC,CAAC;IAeJ;;OAEG;IACH,KAAK,CAAC,KAAK;QACT,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,MAAM,IAAI,KAAK,CACb,+GAA+G,CAChH,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,MAAM,CAAC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CAAC;YACvC,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC7B,OAAO,EAAE,CAAC;YACZ,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YACtC,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAhFD,oDAgFC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/streamableHttp.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/streamableHttp.d.ts new file mode 100644 index 0000000000..2a2e86095e --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/streamableHttp.d.ts @@ -0,0 +1,151 @@ +import { IncomingMessage, ServerResponse } from "node:http"; +import { Transport } from "../shared/transport.js"; +import { JSONRPCMessage, RequestId } from "../types.js"; +import { AuthInfo } from "./auth/types.js"; +export type StreamId = string; +export type EventId = string; +/** + * Interface for resumability support via event storage + */ +export interface EventStore { + /** + * Stores an event for later retrieval + * @param streamId ID of the stream the event belongs to + * @param message The JSON-RPC message to store + * @returns The generated event ID for the stored event + */ + storeEvent(streamId: StreamId, message: JSONRPCMessage): Promise; + replayEventsAfter(lastEventId: EventId, { send }: { + send: (eventId: EventId, message: JSONRPCMessage) => Promise; + }): Promise; +} +/** + * Configuration options for StreamableHTTPServerTransport + */ +export interface StreamableHTTPServerTransportOptions { + /** + * Function that generates a session ID for the transport. + * The session ID SHOULD be globally unique and cryptographically secure (e.g., a securely generated UUID, a JWT, or a cryptographic hash) + * + * Return undefined to disable session management. + */ + sessionIdGenerator: (() => string) | undefined; + /** + * A callback for session initialization events + * This is called when the server initializes a new session. + * Useful in cases when you need to register multiple mcp sessions + * and need to keep track of them. + * @param sessionId The generated session ID + */ + onsessioninitialized?: (sessionId: string) => void; + /** + * If true, the server will return JSON responses instead of starting an SSE stream. + * This can be useful for simple request/response scenarios without streaming. + * Default is false (SSE streams are preferred). + */ + enableJsonResponse?: boolean; + /** + * Event store for resumability support + * If provided, resumability will be enabled, allowing clients to reconnect and resume messages + */ + eventStore?: EventStore; +} +/** + * Server transport for Streamable HTTP: this implements the MCP Streamable HTTP transport specification. + * It supports both SSE streaming and direct HTTP responses. + * + * Usage example: + * + * ```typescript + * // Stateful mode - server sets the session ID + * const statefulTransport = new StreamableHTTPServerTransport({ + * sessionIdGenerator: () => randomUUID(), + * }); + * + * // Stateless mode - explicitly set session ID to undefined + * const statelessTransport = new StreamableHTTPServerTransport({ + * sessionIdGenerator: undefined, + * }); + * + * // Using with pre-parsed request body + * app.post('/mcp', (req, res) => { + * transport.handleRequest(req, res, req.body); + * }); + * ``` + * + * In stateful mode: + * - Session ID is generated and included in response headers + * - Session ID is always included in initialization responses + * - Requests with invalid session IDs are rejected with 404 Not Found + * - Non-initialization requests without a session ID are rejected with 400 Bad Request + * - State is maintained in-memory (connections, message history) + * + * In stateless mode: + * - No Session ID is included in any responses + * - No session validation is performed + */ +export declare class StreamableHTTPServerTransport implements Transport { + private sessionIdGenerator; + private _started; + private _streamMapping; + private _requestToStreamMapping; + private _requestResponseMap; + private _initialized; + private _enableJsonResponse; + private _standaloneSseStreamId; + private _eventStore?; + private _onsessioninitialized?; + sessionId?: string | undefined; + onclose?: () => void; + onerror?: (error: Error) => void; + onmessage?: (message: JSONRPCMessage, extra?: { + authInfo?: AuthInfo; + }) => void; + constructor(options: StreamableHTTPServerTransportOptions); + /** + * Starts the transport. This is required by the Transport interface but is a no-op + * for the Streamable HTTP transport as connections are managed per-request. + */ + start(): Promise; + /** + * Handles an incoming HTTP request, whether GET or POST + */ + handleRequest(req: IncomingMessage & { + auth?: AuthInfo; + }, res: ServerResponse, parsedBody?: unknown): Promise; + /** + * Handles GET requests for SSE stream + */ + private handleGetRequest; + /** + * Replays events that would have been sent after the specified event ID + * Only used when resumability is enabled + */ + private replayEvents; + /** + * Writes an event to the SSE stream with proper formatting + */ + private writeSSEEvent; + /** + * Handles unsupported requests (PUT, PATCH, etc.) + */ + private handleUnsupportedRequest; + /** + * Handles POST requests containing JSON-RPC messages + */ + private handlePostRequest; + /** + * Handles DELETE requests to terminate sessions + */ + private handleDeleteRequest; + /** + * Validates session ID for non-initialization requests + * Returns true if the session is valid, false otherwise + */ + private validateSession; + close(): Promise; + send(message: JSONRPCMessage, options?: { + relatedRequestId?: RequestId; + }): Promise; +} +//# sourceMappingURL=streamableHttp.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/streamableHttp.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/streamableHttp.d.ts.map new file mode 100644 index 0000000000..3dfcb4fb35 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/streamableHttp.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"streamableHttp.d.ts","sourceRoot":"","sources":["../../../src/server/streamableHttp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAA4E,cAAc,EAAwB,SAAS,EAAE,MAAM,aAAa,CAAC;AAIxJ,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAI3C,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAC9B,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC;AAE7B;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB;;;;;OAKG;IACH,UAAU,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAE1E,iBAAiB,CAAC,WAAW,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE;QAChD,IAAI,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,IAA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AG;QAAE,IAAI,CAAC,EAAE,QAAQ,CAAA;KAAE,EAAE,GAAG,EAAE,cAAc,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAYzH;;OAEG;YACW,gBAAgB;IAqE9B;;;OAGG;YACW,YAAY;IA8B1B;;OAEG;IACH,OAAO,CAAC,aAAa;IAWrB;;OAEG;YACW,wBAAwB;IAatC;;OAEG;YACW,iBAAiB;IAmK/B;;OAEG;YACW,mBAAmB;IAQjC;;;OAGG;IACH,OAAO,CAAC,eAAe;IA4DjB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAYtB,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE;QAAE,gBAAgB,CAAC,EAAE,SAAS,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAgG/F"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/streamableHttp.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/streamableHttp.js new file mode 100644 index 0000000000..b26bb382dc --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/streamableHttp.js @@ -0,0 +1,539 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.StreamableHTTPServerTransport = void 0; +const types_js_1 = require("../types.js"); +const raw_body_1 = __importDefault(require("raw-body")); +const content_type_1 = __importDefault(require("content-type")); +const node_crypto_1 = require("node:crypto"); +const MAXIMUM_MESSAGE_SIZE = "4mb"; +/** + * Server transport for Streamable HTTP: this implements the MCP Streamable HTTP transport specification. + * It supports both SSE streaming and direct HTTP responses. + * + * Usage example: + * + * ```typescript + * // Stateful mode - server sets the session ID + * const statefulTransport = new StreamableHTTPServerTransport({ + * sessionIdGenerator: () => randomUUID(), + * }); + * + * // Stateless mode - explicitly set session ID to undefined + * const statelessTransport = new StreamableHTTPServerTransport({ + * sessionIdGenerator: undefined, + * }); + * + * // Using with pre-parsed request body + * app.post('/mcp', (req, res) => { + * transport.handleRequest(req, res, req.body); + * }); + * ``` + * + * In stateful mode: + * - Session ID is generated and included in response headers + * - Session ID is always included in initialization responses + * - Requests with invalid session IDs are rejected with 404 Not Found + * - Non-initialization requests without a session ID are rejected with 400 Bad Request + * - State is maintained in-memory (connections, message history) + * + * In stateless mode: + * - No Session ID is included in any responses + * - No session validation is performed + */ +class StreamableHTTPServerTransport { + constructor(options) { + var _a; + this._started = false; + this._streamMapping = new Map(); + this._requestToStreamMapping = new Map(); + this._requestResponseMap = new Map(); + this._initialized = false; + this._enableJsonResponse = false; + this._standaloneSseStreamId = '_GET_stream'; + this.sessionIdGenerator = options.sessionIdGenerator; + this._enableJsonResponse = (_a = options.enableJsonResponse) !== null && _a !== void 0 ? _a : false; + this._eventStore = options.eventStore; + this._onsessioninitialized = options.onsessioninitialized; + } + /** + * Starts the transport. This is required by the Transport interface but is a no-op + * for the Streamable HTTP transport as connections are managed per-request. + */ + async start() { + if (this._started) { + throw new Error("Transport already started"); + } + this._started = true; + } + /** + * Handles an incoming HTTP request, whether GET or POST + */ + async handleRequest(req, res, parsedBody) { + if (req.method === "POST") { + await this.handlePostRequest(req, res, parsedBody); + } + else if (req.method === "GET") { + await this.handleGetRequest(req, res); + } + else if (req.method === "DELETE") { + await this.handleDeleteRequest(req, res); + } + else { + await this.handleUnsupportedRequest(res); + } + } + /** + * Handles GET requests for SSE stream + */ + async handleGetRequest(req, res) { + // The client MUST include an Accept header, listing text/event-stream as a supported content type. + const acceptHeader = req.headers.accept; + if (!(acceptHeader === null || acceptHeader === void 0 ? void 0 : acceptHeader.includes("text/event-stream"))) { + res.writeHead(406).end(JSON.stringify({ + jsonrpc: "2.0", + error: { + code: -32000, + message: "Not Acceptable: Client must accept text/event-stream" + }, + id: null + })); + return; + } + // If an Mcp-Session-Id is returned by the server during initialization, + // clients using the Streamable HTTP transport MUST include it + // in the Mcp-Session-Id header on all of their subsequent HTTP requests. + if (!this.validateSession(req, res)) { + return; + } + // Handle resumability: check for Last-Event-ID header + if (this._eventStore) { + const lastEventId = req.headers['last-event-id']; + if (lastEventId) { + await this.replayEvents(lastEventId, res); + return; + } + } + // The server MUST either return Content-Type: text/event-stream in response to this HTTP GET, + // or else return HTTP 405 Method Not Allowed + const headers = { + "Content-Type": "text/event-stream", + "Cache-Control": "no-cache, no-transform", + Connection: "keep-alive", + }; + // After initialization, always include the session ID if we have one + if (this.sessionId !== undefined) { + headers["mcp-session-id"] = this.sessionId; + } + // Check if there's already an active standalone SSE stream for this session + if (this._streamMapping.get(this._standaloneSseStreamId) !== undefined) { + // Only one GET SSE stream is allowed per session + res.writeHead(409).end(JSON.stringify({ + jsonrpc: "2.0", + error: { + code: -32000, + message: "Conflict: Only one SSE stream is allowed per session" + }, + id: null + })); + return; + } + // We need to send headers immediately as messages will arrive much later, + // otherwise the client will just wait for the first message + res.writeHead(200, headers).flushHeaders(); + // Assign the response to the standalone SSE stream + this._streamMapping.set(this._standaloneSseStreamId, res); + // Set up close handler for client disconnects + res.on("close", () => { + this._streamMapping.delete(this._standaloneSseStreamId); + }); + } + /** + * Replays events that would have been sent after the specified event ID + * Only used when resumability is enabled + */ + async replayEvents(lastEventId, res) { + var _a, _b; + if (!this._eventStore) { + return; + } + try { + const headers = { + "Content-Type": "text/event-stream", + "Cache-Control": "no-cache, no-transform", + Connection: "keep-alive", + }; + if (this.sessionId !== undefined) { + headers["mcp-session-id"] = this.sessionId; + } + res.writeHead(200, headers).flushHeaders(); + const streamId = await ((_a = this._eventStore) === null || _a === void 0 ? void 0 : _a.replayEventsAfter(lastEventId, { + send: async (eventId, message) => { + var _a; + if (!this.writeSSEEvent(res, message, eventId)) { + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, new Error("Failed replay events")); + res.end(); + } + } + })); + this._streamMapping.set(streamId, res); + } + catch (error) { + (_b = this.onerror) === null || _b === void 0 ? void 0 : _b.call(this, error); + } + } + /** + * Writes an event to the SSE stream with proper formatting + */ + writeSSEEvent(res, message, eventId) { + let eventData = `event: message\n`; + // Include event ID if provided - this is important for resumability + if (eventId) { + eventData += `id: ${eventId}\n`; + } + eventData += `data: ${JSON.stringify(message)}\n\n`; + return res.write(eventData); + } + /** + * Handles unsupported requests (PUT, PATCH, etc.) + */ + async handleUnsupportedRequest(res) { + res.writeHead(405, { + "Allow": "GET, POST, DELETE" + }).end(JSON.stringify({ + jsonrpc: "2.0", + error: { + code: -32000, + message: "Method not allowed." + }, + id: null + })); + } + /** + * Handles POST requests containing JSON-RPC messages + */ + async handlePostRequest(req, res, parsedBody) { + var _a, _b, _c, _d, _e; + try { + // Validate the Accept header + const acceptHeader = req.headers.accept; + // The client MUST include an Accept header, listing both application/json and text/event-stream as supported content types. + if (!(acceptHeader === null || acceptHeader === void 0 ? void 0 : acceptHeader.includes("application/json")) || !acceptHeader.includes("text/event-stream")) { + res.writeHead(406).end(JSON.stringify({ + jsonrpc: "2.0", + error: { + code: -32000, + message: "Not Acceptable: Client must accept both application/json and text/event-stream" + }, + id: null + })); + return; + } + const ct = req.headers["content-type"]; + if (!ct || !ct.includes("application/json")) { + res.writeHead(415).end(JSON.stringify({ + jsonrpc: "2.0", + error: { + code: -32000, + message: "Unsupported Media Type: Content-Type must be application/json" + }, + id: null + })); + return; + } + const authInfo = req.auth; + let rawMessage; + if (parsedBody !== undefined) { + rawMessage = parsedBody; + } + else { + const parsedCt = content_type_1.default.parse(ct); + const body = await (0, raw_body_1.default)(req, { + limit: MAXIMUM_MESSAGE_SIZE, + encoding: (_a = parsedCt.parameters.charset) !== null && _a !== void 0 ? _a : "utf-8", + }); + rawMessage = JSON.parse(body.toString()); + } + let messages; + // handle batch and single messages + if (Array.isArray(rawMessage)) { + messages = rawMessage.map(msg => types_js_1.JSONRPCMessageSchema.parse(msg)); + } + else { + messages = [types_js_1.JSONRPCMessageSchema.parse(rawMessage)]; + } + // Check if this is an initialization request + // https://spec.modelcontextprotocol.io/specification/2025-03-26/basic/lifecycle/ + const isInitializationRequest = messages.some(types_js_1.isInitializeRequest); + if (isInitializationRequest) { + // If it's a server with session management and the session ID is already set we should reject the request + // to avoid re-initialization. + if (this._initialized && this.sessionId !== undefined) { + res.writeHead(400).end(JSON.stringify({ + jsonrpc: "2.0", + error: { + code: -32600, + message: "Invalid Request: Server already initialized" + }, + id: null + })); + return; + } + if (messages.length > 1) { + res.writeHead(400).end(JSON.stringify({ + jsonrpc: "2.0", + error: { + code: -32600, + message: "Invalid Request: Only one initialization request is allowed" + }, + id: null + })); + return; + } + this.sessionId = (_b = this.sessionIdGenerator) === null || _b === void 0 ? void 0 : _b.call(this); + this._initialized = true; + // If we have a session ID and an onsessioninitialized handler, call it immediately + // This is needed in cases where the server needs to keep track of multiple sessions + if (this.sessionId && this._onsessioninitialized) { + this._onsessioninitialized(this.sessionId); + } + } + // If an Mcp-Session-Id is returned by the server during initialization, + // clients using the Streamable HTTP transport MUST include it + // in the Mcp-Session-Id header on all of their subsequent HTTP requests. + if (!isInitializationRequest && !this.validateSession(req, res)) { + return; + } + // check if it contains requests + const hasRequests = messages.some(types_js_1.isJSONRPCRequest); + if (!hasRequests) { + // if it only contains notifications or responses, return 202 + res.writeHead(202).end(); + // handle each message + for (const message of messages) { + (_c = this.onmessage) === null || _c === void 0 ? void 0 : _c.call(this, message, { authInfo }); + } + } + else if (hasRequests) { + // The default behavior is to use SSE streaming + // but in some cases server will return JSON responses + const streamId = (0, node_crypto_1.randomUUID)(); + if (!this._enableJsonResponse) { + const headers = { + "Content-Type": "text/event-stream", + "Cache-Control": "no-cache", + Connection: "keep-alive", + }; + // After initialization, always include the session ID if we have one + if (this.sessionId !== undefined) { + headers["mcp-session-id"] = this.sessionId; + } + res.writeHead(200, headers); + } + // Store the response for this request to send messages back through this connection + // We need to track by request ID to maintain the connection + for (const message of messages) { + if ((0, types_js_1.isJSONRPCRequest)(message)) { + this._streamMapping.set(streamId, res); + this._requestToStreamMapping.set(message.id, streamId); + } + } + // Set up close handler for client disconnects + res.on("close", () => { + this._streamMapping.delete(streamId); + }); + // handle each message + for (const message of messages) { + (_d = this.onmessage) === null || _d === void 0 ? void 0 : _d.call(this, message, { authInfo }); + } + // The server SHOULD NOT close the SSE stream before sending all JSON-RPC responses + // This will be handled by the send() method when responses are ready + } + } + catch (error) { + // return JSON-RPC formatted error + res.writeHead(400).end(JSON.stringify({ + jsonrpc: "2.0", + error: { + code: -32700, + message: "Parse error", + data: String(error) + }, + id: null + })); + (_e = this.onerror) === null || _e === void 0 ? void 0 : _e.call(this, error); + } + } + /** + * Handles DELETE requests to terminate sessions + */ + async handleDeleteRequest(req, res) { + if (!this.validateSession(req, res)) { + return; + } + await this.close(); + res.writeHead(200).end(); + } + /** + * Validates session ID for non-initialization requests + * Returns true if the session is valid, false otherwise + */ + validateSession(req, res) { + if (this.sessionIdGenerator === undefined) { + // If the sessionIdGenerator ID is not set, the session management is disabled + // and we don't need to validate the session ID + return true; + } + if (!this._initialized) { + // If the server has not been initialized yet, reject all requests + res.writeHead(400).end(JSON.stringify({ + jsonrpc: "2.0", + error: { + code: -32000, + message: "Bad Request: Server not initialized" + }, + id: null + })); + return false; + } + const sessionId = req.headers["mcp-session-id"]; + if (!sessionId) { + // Non-initialization requests without a session ID should return 400 Bad Request + res.writeHead(400).end(JSON.stringify({ + jsonrpc: "2.0", + error: { + code: -32000, + message: "Bad Request: Mcp-Session-Id header is required" + }, + id: null + })); + return false; + } + else if (Array.isArray(sessionId)) { + res.writeHead(400).end(JSON.stringify({ + jsonrpc: "2.0", + error: { + code: -32000, + message: "Bad Request: Mcp-Session-Id header must be a single value" + }, + id: null + })); + return false; + } + else if (sessionId !== this.sessionId) { + // Reject requests with invalid session ID with 404 Not Found + res.writeHead(404).end(JSON.stringify({ + jsonrpc: "2.0", + error: { + code: -32001, + message: "Session not found" + }, + id: null + })); + return false; + } + return true; + } + async close() { + var _a; + // Close all SSE connections + this._streamMapping.forEach((response) => { + response.end(); + }); + this._streamMapping.clear(); + // Clear any pending responses + this._requestResponseMap.clear(); + (_a = this.onclose) === null || _a === void 0 ? void 0 : _a.call(this); + } + async send(message, options) { + let requestId = options === null || options === void 0 ? void 0 : options.relatedRequestId; + if ((0, types_js_1.isJSONRPCResponse)(message) || (0, types_js_1.isJSONRPCError)(message)) { + // If the message is a response, use the request ID from the message + requestId = message.id; + } + // Check if this message should be sent on the standalone SSE stream (no request ID) + // Ignore notifications from tools (which have relatedRequestId set) + // Those will be sent via dedicated response SSE streams + if (requestId === undefined) { + // For standalone SSE streams, we can only send requests and notifications + if ((0, types_js_1.isJSONRPCResponse)(message) || (0, types_js_1.isJSONRPCError)(message)) { + throw new Error("Cannot send a response on a standalone SSE stream unless resuming a previous client request"); + } + const standaloneSse = this._streamMapping.get(this._standaloneSseStreamId); + if (standaloneSse === undefined) { + // The spec says the server MAY send messages on the stream, so it's ok to discard if no stream + return; + } + // Generate and store event ID if event store is provided + let eventId; + if (this._eventStore) { + // Stores the event and gets the generated event ID + eventId = await this._eventStore.storeEvent(this._standaloneSseStreamId, message); + } + // Send the message to the standalone SSE stream + this.writeSSEEvent(standaloneSse, message, eventId); + return; + } + // Get the response for this request + const streamId = this._requestToStreamMapping.get(requestId); + const response = this._streamMapping.get(streamId); + if (!streamId) { + throw new Error(`No connection established for request ID: ${String(requestId)}`); + } + if (!this._enableJsonResponse) { + // For SSE responses, generate event ID if event store is provided + let eventId; + if (this._eventStore) { + eventId = await this._eventStore.storeEvent(streamId, message); + } + if (response) { + // Write the event to the response stream + this.writeSSEEvent(response, message, eventId); + } + } + if ((0, types_js_1.isJSONRPCResponse)(message) || (0, types_js_1.isJSONRPCError)(message)) { + this._requestResponseMap.set(requestId, message); + const relatedIds = Array.from(this._requestToStreamMapping.entries()) + .filter(([_, streamId]) => this._streamMapping.get(streamId) === response) + .map(([id]) => id); + // Check if we have responses for all requests using this connection + const allResponsesReady = relatedIds.every(id => this._requestResponseMap.has(id)); + if (allResponsesReady) { + if (!response) { + throw new Error(`No connection established for request ID: ${String(requestId)}`); + } + if (this._enableJsonResponse) { + // All responses ready, send as JSON + const headers = { + 'Content-Type': 'application/json', + }; + if (this.sessionId !== undefined) { + headers['mcp-session-id'] = this.sessionId; + } + const responses = relatedIds + .map(id => this._requestResponseMap.get(id)); + response.writeHead(200, headers); + if (responses.length === 1) { + response.end(JSON.stringify(responses[0])); + } + else { + response.end(JSON.stringify(responses)); + } + } + else { + // End the SSE stream + response.end(); + } + // Clean up + for (const id of relatedIds) { + this._requestResponseMap.delete(id); + this._requestToStreamMapping.delete(id); + } + } + } + } +} +exports.StreamableHTTPServerTransport = StreamableHTTPServerTransport; +//# sourceMappingURL=streamableHttp.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/streamableHttp.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/streamableHttp.js.map new file mode 100644 index 0000000000..c3f20e0c90 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/server/streamableHttp.js.map @@ -0,0 +1 @@ +{"version":3,"file":"streamableHttp.js","sourceRoot":"","sources":["../../../src/server/streamableHttp.ts"],"names":[],"mappings":";;;;;;AAEA,0CAAwJ;AACxJ,wDAAkC;AAClC,gEAAuC;AACvC,6CAAyC;AAGzC,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAyDnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAa,6BAA6B;IAkBxC,YAAY,OAA6C;;QAfjD,aAAQ,GAAY,KAAK,CAAC;QAC1B,mBAAc,GAAgC,IAAI,GAAG,EAAE,CAAC;QACxD,4BAAuB,GAA2B,IAAI,GAAG,EAAE,CAAC;QAC5D,wBAAmB,GAAmC,IAAI,GAAG,EAAE,CAAC;QAChE,iBAAY,GAAY,KAAK,CAAC;QAC9B,wBAAmB,GAAY,KAAK,CAAC;QACrC,2BAAsB,GAAW,aAAa,CAAC;QAUrD,IAAI,CAAC,kBAA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CAAC;oBAC7B,oCAAoC;oBACpC,MAAM,OAAO,GAA2B;wBACtC,cAAc,EAAE,kBAAkB;qBACnC,CAAC;oBACF,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;wBACjC,OAAO,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC;oBAC7C,CAAC;oBAED,MAAM,SAAS,GAAG,UAAU;yBACzB,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,EAAE,CAAE,CAAC,CAAC;oBAEhD,QAAQ,CAAC,SAAS,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;oBACjC,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;wBAC3B,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;oBAC7C,CAAC;yBAAM,CAAC;wBACN,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;oBAC1C,CAAC;gBACH,CAAC;qBAAM,CAAC;oBACN,qBAAqB;oBACrB,QAAQ,CAAC,GAAG,EAAE,CAAC;gBACjB,CAAC;gBACD,WAAW;gBACX,KAAK,MAAM,EAAE,IAAI,UAAU,EAAE,CAAC;oBAC5B,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;oBACpC,IAAI,CAAC,uBAAuB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;gBAC1C,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAxhBD,sEAwhBC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/auth.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/auth.d.ts new file mode 100644 index 0000000000..a14f1e706a --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/auth.d.ts @@ -0,0 +1,321 @@ +import { z } from "zod"; +/** + * RFC 9728 OAuth Protected Resource Metadata + */ +export declare const OAuthProtectedResourceMetadataSchema: z.ZodObject<{ + resource: z.ZodString; + authorization_servers: z.ZodOptional>; + jwks_uri: z.ZodOptional; + scopes_supported: z.ZodOptional>; + bearer_methods_supported: z.ZodOptional>; + resource_signing_alg_values_supported: z.ZodOptional>; + resource_name: z.ZodOptional; + resource_documentation: z.ZodOptional; + resource_policy_uri: z.ZodOptional; + resource_tos_uri: z.ZodOptional; + tls_client_certificate_bound_access_tokens: z.ZodOptional; + authorization_details_types_supported: z.ZodOptional>; + dpop_signing_alg_values_supported: z.ZodOptional>; + dpop_bound_access_tokens_required: z.ZodOptional; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + resource: z.ZodString; + authorization_servers: z.ZodOptional>; + jwks_uri: z.ZodOptional; + scopes_supported: z.ZodOptional>; + bearer_methods_supported: z.ZodOptional>; + resource_signing_alg_values_supported: z.ZodOptional>; + resource_name: z.ZodOptional; + resource_documentation: z.ZodOptional; + resource_policy_uri: z.ZodOptional; + resource_tos_uri: z.ZodOptional; + tls_client_certificate_bound_access_tokens: z.ZodOptional; + authorization_details_types_supported: z.ZodOptional>; + dpop_signing_alg_values_supported: z.ZodOptional>; + dpop_bound_access_tokens_required: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + resource: z.ZodString; + authorization_servers: z.ZodOptional>; + jwks_uri: z.ZodOptional; + scopes_supported: z.ZodOptional>; + bearer_methods_supported: z.ZodOptional>; + resource_signing_alg_values_supported: z.ZodOptional>; + resource_name: z.ZodOptional; + resource_documentation: z.ZodOptional; + resource_policy_uri: z.ZodOptional; + resource_tos_uri: z.ZodOptional; + tls_client_certificate_bound_access_tokens: z.ZodOptional; + authorization_details_types_supported: z.ZodOptional>; + dpop_signing_alg_values_supported: z.ZodOptional>; + dpop_bound_access_tokens_required: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">>; +/** + * RFC 8414 OAuth 2.0 Authorization Server Metadata + */ +export declare const OAuthMetadataSchema: z.ZodObject<{ + issuer: z.ZodString; + authorization_endpoint: z.ZodString; + token_endpoint: z.ZodString; + registration_endpoint: z.ZodOptional; + scopes_supported: z.ZodOptional>; + response_types_supported: z.ZodArray; + response_modes_supported: z.ZodOptional>; + grant_types_supported: z.ZodOptional>; + token_endpoint_auth_methods_supported: z.ZodOptional>; + token_endpoint_auth_signing_alg_values_supported: z.ZodOptional>; + service_documentation: z.ZodOptional; + revocation_endpoint: z.ZodOptional; + revocation_endpoint_auth_methods_supported: z.ZodOptional>; + revocation_endpoint_auth_signing_alg_values_supported: z.ZodOptional>; + introspection_endpoint: z.ZodOptional; + introspection_endpoint_auth_methods_supported: z.ZodOptional>; + introspection_endpoint_auth_signing_alg_values_supported: z.ZodOptional>; + code_challenge_methods_supported: z.ZodOptional>; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + issuer: z.ZodString; + authorization_endpoint: z.ZodString; + token_endpoint: z.ZodString; + registration_endpoint: z.ZodOptional; + scopes_supported: z.ZodOptional>; + response_types_supported: z.ZodArray; + response_modes_supported: z.ZodOptional>; + grant_types_supported: z.ZodOptional>; + token_endpoint_auth_methods_supported: z.ZodOptional>; + token_endpoint_auth_signing_alg_values_supported: z.ZodOptional>; + service_documentation: z.ZodOptional; + revocation_endpoint: z.ZodOptional; + revocation_endpoint_auth_methods_supported: z.ZodOptional>; + revocation_endpoint_auth_signing_alg_values_supported: z.ZodOptional>; + introspection_endpoint: z.ZodOptional; + introspection_endpoint_auth_methods_supported: z.ZodOptional>; + introspection_endpoint_auth_signing_alg_values_supported: z.ZodOptional>; + code_challenge_methods_supported: z.ZodOptional>; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + issuer: z.ZodString; + authorization_endpoint: z.ZodString; + token_endpoint: z.ZodString; + registration_endpoint: z.ZodOptional; + scopes_supported: z.ZodOptional>; + response_types_supported: z.ZodArray; + response_modes_supported: z.ZodOptional>; + grant_types_supported: z.ZodOptional>; + token_endpoint_auth_methods_supported: z.ZodOptional>; + token_endpoint_auth_signing_alg_values_supported: z.ZodOptional>; + service_documentation: z.ZodOptional; + revocation_endpoint: z.ZodOptional; + revocation_endpoint_auth_methods_supported: z.ZodOptional>; + revocation_endpoint_auth_signing_alg_values_supported: z.ZodOptional>; + introspection_endpoint: z.ZodOptional; + introspection_endpoint_auth_methods_supported: z.ZodOptional>; + introspection_endpoint_auth_signing_alg_values_supported: z.ZodOptional>; + code_challenge_methods_supported: z.ZodOptional>; +}, z.ZodTypeAny, "passthrough">>; +/** + * OAuth 2.1 token response + */ +export declare const OAuthTokensSchema: z.ZodObject<{ + access_token: z.ZodString; + token_type: z.ZodString; + expires_in: z.ZodOptional; + scope: z.ZodOptional; + refresh_token: z.ZodOptional; +}, "strip", z.ZodTypeAny, { + access_token: string; + token_type: string; + expires_in?: number | undefined; + scope?: string | undefined; + refresh_token?: string | undefined; +}, { + access_token: string; + token_type: string; + expires_in?: number | undefined; + scope?: string | undefined; + refresh_token?: string | undefined; +}>; +/** + * OAuth 2.1 error response + */ +export declare const OAuthErrorResponseSchema: z.ZodObject<{ + error: z.ZodString; + error_description: z.ZodOptional; + error_uri: z.ZodOptional; +}, "strip", z.ZodTypeAny, { + error: string; + error_description?: string | undefined; + error_uri?: string | undefined; +}, { + error: string; + error_description?: string | undefined; + error_uri?: string | undefined; +}>; +/** + * RFC 7591 OAuth 2.0 Dynamic Client Registration metadata + */ +export declare const OAuthClientMetadataSchema: z.ZodObject<{ + redirect_uris: z.ZodEffects, string[], string[]>; + token_endpoint_auth_method: z.ZodOptional; + grant_types: z.ZodOptional>; + response_types: z.ZodOptional>; + client_name: z.ZodOptional; + client_uri: z.ZodOptional; + logo_uri: z.ZodOptional; + scope: z.ZodOptional; + contacts: z.ZodOptional>; + tos_uri: z.ZodOptional; + policy_uri: z.ZodOptional; + jwks_uri: z.ZodOptional; + jwks: z.ZodOptional; + software_id: z.ZodOptional; + software_version: z.ZodOptional; +}, "strip", z.ZodTypeAny, { + redirect_uris: string[]; + jwks_uri?: string | undefined; + scope?: string | undefined; + token_endpoint_auth_method?: string | undefined; + grant_types?: string[] | undefined; + response_types?: string[] | undefined; + client_name?: string | undefined; + client_uri?: string | undefined; + logo_uri?: string | undefined; + contacts?: string[] | undefined; + tos_uri?: string | undefined; + policy_uri?: string | undefined; + jwks?: any; + software_id?: string | undefined; + software_version?: string | undefined; +}, { + redirect_uris: string[]; + jwks_uri?: string | undefined; + scope?: string | undefined; + token_endpoint_auth_method?: string | undefined; + grant_types?: string[] | undefined; + response_types?: string[] | undefined; + client_name?: string | undefined; + client_uri?: string | undefined; + logo_uri?: string | undefined; + contacts?: string[] | undefined; + tos_uri?: string | undefined; + policy_uri?: string | undefined; + jwks?: any; + software_id?: string | undefined; + software_version?: string | undefined; +}>; +/** + * RFC 7591 OAuth 2.0 Dynamic Client Registration client information + */ +export declare const OAuthClientInformationSchema: z.ZodObject<{ + client_id: z.ZodString; + client_secret: z.ZodOptional; + client_id_issued_at: z.ZodOptional; + client_secret_expires_at: z.ZodOptional; +}, "strip", z.ZodTypeAny, { + client_id: string; + client_secret?: string | undefined; + client_id_issued_at?: number | undefined; + client_secret_expires_at?: number | undefined; +}, { + client_id: string; + client_secret?: string | undefined; + client_id_issued_at?: number | undefined; + client_secret_expires_at?: number | undefined; +}>; +/** + * RFC 7591 OAuth 2.0 Dynamic Client Registration full response (client information plus metadata) + */ +export declare const OAuthClientInformationFullSchema: z.ZodObject, string[], string[]>; + token_endpoint_auth_method: z.ZodOptional; + grant_types: z.ZodOptional>; + response_types: z.ZodOptional>; + client_name: z.ZodOptional; + client_uri: z.ZodOptional; + logo_uri: z.ZodOptional; + scope: z.ZodOptional; + contacts: z.ZodOptional>; + tos_uri: z.ZodOptional; + policy_uri: z.ZodOptional; + jwks_uri: z.ZodOptional; + jwks: z.ZodOptional; + software_id: z.ZodOptional; + software_version: z.ZodOptional; +}, { + client_id: z.ZodString; + client_secret: z.ZodOptional; + client_id_issued_at: z.ZodOptional; + client_secret_expires_at: z.ZodOptional; +}>, "strip", z.ZodTypeAny, { + redirect_uris: string[]; + client_id: string; + jwks_uri?: string | undefined; + scope?: string | undefined; + token_endpoint_auth_method?: string | undefined; + grant_types?: string[] | undefined; + response_types?: string[] | undefined; + client_name?: string | undefined; + client_uri?: string | undefined; + logo_uri?: string | undefined; + contacts?: string[] | undefined; + tos_uri?: string | undefined; + policy_uri?: string | undefined; + jwks?: any; + software_id?: string | undefined; + software_version?: string | undefined; + client_secret?: string | undefined; + client_id_issued_at?: number | undefined; + client_secret_expires_at?: number | undefined; +}, { + redirect_uris: string[]; + client_id: string; + jwks_uri?: string | undefined; + scope?: string | undefined; + token_endpoint_auth_method?: string | undefined; + grant_types?: string[] | undefined; + response_types?: string[] | undefined; + client_name?: string | undefined; + client_uri?: string | undefined; + logo_uri?: string | undefined; + contacts?: string[] | undefined; + tos_uri?: string | undefined; + policy_uri?: string | undefined; + jwks?: any; + software_id?: string | undefined; + software_version?: string | undefined; + client_secret?: string | undefined; + client_id_issued_at?: number | undefined; + client_secret_expires_at?: number | undefined; +}>; +/** + * RFC 7591 OAuth 2.0 Dynamic Client Registration error response + */ +export declare const OAuthClientRegistrationErrorSchema: z.ZodObject<{ + error: z.ZodString; + error_description: z.ZodOptional; +}, "strip", z.ZodTypeAny, { + error: string; + error_description?: string | undefined; +}, { + error: string; + error_description?: string | undefined; +}>; +/** + * RFC 7009 OAuth 2.0 Token Revocation request + */ +export declare const OAuthTokenRevocationRequestSchema: z.ZodObject<{ + token: z.ZodString; + token_type_hint: z.ZodOptional; +}, "strip", z.ZodTypeAny, { + token: string; + token_type_hint?: string | undefined; +}, { + token: string; + token_type_hint?: string | undefined; +}>; +export type OAuthMetadata = z.infer; +export type OAuthTokens = z.infer; +export type OAuthErrorResponse = z.infer; +export type OAuthClientMetadata = z.infer; +export type OAuthClientInformation = z.infer; +export type OAuthClientInformationFull = z.infer; +export type OAuthClientRegistrationError = z.infer; +export type OAuthTokenRevocationRequest = z.infer; +export type OAuthProtectedResourceMetadata = z.infer; +//# sourceMappingURL=auth.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/auth.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/auth.d.ts.map new file mode 100644 index 0000000000..3cfebb032a --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/auth.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/shared/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAiBjC,CAAC;AAEjB;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCA6BhB,CAAC;AAEjB;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;EAQpB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;EAKjC,CAAC;AAEL;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgB5B,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;EAK/B,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAgE,CAAC;AAE9G;;GAEG;AACH,eAAO,MAAM,kCAAkC;;;;;;;;;EAGrC,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,iCAAiC;;;;;;;;;EAGpC,CAAC;AAGX,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAClF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAC1F,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAC9F,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAC5F,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/auth.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/auth.js new file mode 100644 index 0000000000..a996010b6e --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/auth.js @@ -0,0 +1,127 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.OAuthTokenRevocationRequestSchema = exports.OAuthClientRegistrationErrorSchema = exports.OAuthClientInformationFullSchema = exports.OAuthClientInformationSchema = exports.OAuthClientMetadataSchema = exports.OAuthErrorResponseSchema = exports.OAuthTokensSchema = exports.OAuthMetadataSchema = exports.OAuthProtectedResourceMetadataSchema = void 0; +const zod_1 = require("zod"); +/** + * RFC 9728 OAuth Protected Resource Metadata + */ +exports.OAuthProtectedResourceMetadataSchema = zod_1.z + .object({ + resource: zod_1.z.string().url(), + authorization_servers: zod_1.z.array(zod_1.z.string().url()).optional(), + jwks_uri: zod_1.z.string().url().optional(), + scopes_supported: zod_1.z.array(zod_1.z.string()).optional(), + bearer_methods_supported: zod_1.z.array(zod_1.z.string()).optional(), + resource_signing_alg_values_supported: zod_1.z.array(zod_1.z.string()).optional(), + resource_name: zod_1.z.string().optional(), + resource_documentation: zod_1.z.string().optional(), + resource_policy_uri: zod_1.z.string().url().optional(), + resource_tos_uri: zod_1.z.string().url().optional(), + tls_client_certificate_bound_access_tokens: zod_1.z.boolean().optional(), + authorization_details_types_supported: zod_1.z.array(zod_1.z.string()).optional(), + dpop_signing_alg_values_supported: zod_1.z.array(zod_1.z.string()).optional(), + dpop_bound_access_tokens_required: zod_1.z.boolean().optional(), +}) + .passthrough(); +/** + * RFC 8414 OAuth 2.0 Authorization Server Metadata + */ +exports.OAuthMetadataSchema = zod_1.z + .object({ + issuer: zod_1.z.string(), + authorization_endpoint: zod_1.z.string(), + token_endpoint: zod_1.z.string(), + registration_endpoint: zod_1.z.string().optional(), + scopes_supported: zod_1.z.array(zod_1.z.string()).optional(), + response_types_supported: zod_1.z.array(zod_1.z.string()), + response_modes_supported: zod_1.z.array(zod_1.z.string()).optional(), + grant_types_supported: zod_1.z.array(zod_1.z.string()).optional(), + token_endpoint_auth_methods_supported: zod_1.z.array(zod_1.z.string()).optional(), + token_endpoint_auth_signing_alg_values_supported: zod_1.z + .array(zod_1.z.string()) + .optional(), + service_documentation: zod_1.z.string().optional(), + revocation_endpoint: zod_1.z.string().optional(), + revocation_endpoint_auth_methods_supported: zod_1.z.array(zod_1.z.string()).optional(), + revocation_endpoint_auth_signing_alg_values_supported: zod_1.z + .array(zod_1.z.string()) + .optional(), + introspection_endpoint: zod_1.z.string().optional(), + introspection_endpoint_auth_methods_supported: zod_1.z + .array(zod_1.z.string()) + .optional(), + introspection_endpoint_auth_signing_alg_values_supported: zod_1.z + .array(zod_1.z.string()) + .optional(), + code_challenge_methods_supported: zod_1.z.array(zod_1.z.string()).optional(), +}) + .passthrough(); +/** + * OAuth 2.1 token response + */ +exports.OAuthTokensSchema = zod_1.z + .object({ + access_token: zod_1.z.string(), + token_type: zod_1.z.string(), + expires_in: zod_1.z.number().optional(), + scope: zod_1.z.string().optional(), + refresh_token: zod_1.z.string().optional(), +}) + .strip(); +/** + * OAuth 2.1 error response + */ +exports.OAuthErrorResponseSchema = zod_1.z + .object({ + error: zod_1.z.string(), + error_description: zod_1.z.string().optional(), + error_uri: zod_1.z.string().optional(), +}); +/** + * RFC 7591 OAuth 2.0 Dynamic Client Registration metadata + */ +exports.OAuthClientMetadataSchema = zod_1.z.object({ + redirect_uris: zod_1.z.array(zod_1.z.string()).refine((uris) => uris.every((uri) => URL.canParse(uri)), { message: "redirect_uris must contain valid URLs" }), + token_endpoint_auth_method: zod_1.z.string().optional(), + grant_types: zod_1.z.array(zod_1.z.string()).optional(), + response_types: zod_1.z.array(zod_1.z.string()).optional(), + client_name: zod_1.z.string().optional(), + client_uri: zod_1.z.string().optional(), + logo_uri: zod_1.z.string().optional(), + scope: zod_1.z.string().optional(), + contacts: zod_1.z.array(zod_1.z.string()).optional(), + tos_uri: zod_1.z.string().optional(), + policy_uri: zod_1.z.string().optional(), + jwks_uri: zod_1.z.string().optional(), + jwks: zod_1.z.any().optional(), + software_id: zod_1.z.string().optional(), + software_version: zod_1.z.string().optional(), +}).strip(); +/** + * RFC 7591 OAuth 2.0 Dynamic Client Registration client information + */ +exports.OAuthClientInformationSchema = zod_1.z.object({ + client_id: zod_1.z.string(), + client_secret: zod_1.z.string().optional(), + client_id_issued_at: zod_1.z.number().optional(), + client_secret_expires_at: zod_1.z.number().optional(), +}).strip(); +/** + * RFC 7591 OAuth 2.0 Dynamic Client Registration full response (client information plus metadata) + */ +exports.OAuthClientInformationFullSchema = exports.OAuthClientMetadataSchema.merge(exports.OAuthClientInformationSchema); +/** + * RFC 7591 OAuth 2.0 Dynamic Client Registration error response + */ +exports.OAuthClientRegistrationErrorSchema = zod_1.z.object({ + error: zod_1.z.string(), + error_description: zod_1.z.string().optional(), +}).strip(); +/** + * RFC 7009 OAuth 2.0 Token Revocation request + */ +exports.OAuthTokenRevocationRequestSchema = zod_1.z.object({ + token: zod_1.z.string(), + token_type_hint: zod_1.z.string().optional(), +}).strip(); +//# sourceMappingURL=auth.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/auth.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/auth.js.map new file mode 100644 index 0000000000..703c9acafa --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/auth.js.map @@ -0,0 +1 @@ +{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/shared/auth.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB;;GAEG;AACU,QAAA,oCAAoC,GAAG,OAAC;KAClD,MAAM,CAAC;IACN,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IAC1B,qBAAqB,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC3D,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACrC,gBAAgB,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAChD,wBAAwB,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACxD,qCAAqC,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACrE,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,sBAAsB,EAAE,O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protocol.d.ts new file mode 100644 index 0000000000..7fadb219a6 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/protocol.d.ts @@ -0,0 +1,217 @@ +import { ZodLiteral, ZodObject, ZodType, z } from "zod"; +import { ClientCapabilities, Notification, Progress, Request, RequestId, Result, ServerCapabilities, RequestMeta } from "../types.js"; +import { Transport, TransportSendOptions } from "./transport.js"; +import { AuthInfo } from "../server/auth/types.js"; +/** + * Callback for progress notifications. + */ +export type ProgressCallback = (progress: Progress) => void; +/** + * Additional initialization options. + */ +export type ProtocolOptions = { + /** + * Whether to restrict emitted requests to only those that the remote side has indicated that they can handle, through their advertised capabilities. + * + * Note that this DOES NOT affect checking of _local_ side capabilities, as it is considered a logic error to mis-specify those. + * + * Currently this defaults to false, for backwards compatibility with SDK versions that did not advertise capabilities correctly. In future, this will default to true. + */ + enforceStrictCapabilities?: boolean; +}; +/** + * The default request timeout, in miliseconds. + */ +export declare const DEFAULT_REQUEST_TIMEOUT_MSEC = 60000; +/** + * Options that can be given per request. + */ +export type RequestOptions = { + /** + * If set, requests progress notifications from the remote end (if supported). When progress notifications are received, this callback will be invoked. + */ + onprogress?: ProgressCallback; + /** + * Can be used to cancel an in-flight request. This will cause an AbortError to be raised from request(). + */ + signal?: AbortSignal; + /** + * A timeout (in milliseconds) for this request. If exceeded, an McpError with code `RequestTimeout` will be raised from request(). + * + * If not specified, `DEFAULT_REQUEST_TIMEOUT_MSEC` will be used as the timeout. + */ + timeout?: number; + /** + * If true, receiving a progress notification will reset the request timeout. + * This is useful for long-running operations that send periodic progress updates. + * Default: false + */ + resetTimeoutOnProgress?: boolean; + /** + * Maximum total time (in milliseconds) to wait for a response. + * If exceeded, an McpError with code `RequestTimeout` will be raised, regardless of progress notifications. + * If not specified, there is no maximum total timeout. + */ + maxTotalTimeout?: number; +} & TransportSendOptions; +/** + * Options that can be given per notification. + */ +export type NotificationOptions = { + /** + * May be used to indicate to the transport which incoming request to associate this outgoing notification with. + */ + relatedRequestId?: RequestId; +}; +/** + * Extra data given to request handlers. + */ +export type RequestHandlerExtra = { + /** + * An abort signal used to communicate if the request was cancelled from the sender's side. + */ + signal: AbortSignal; + /** + * Information about a validated access token, provided to request handlers. + */ + authInfo?: AuthInfo; + /** + * The session ID from the transport, if available. + */ + sessionId?: string; + /** + * Metadata from the original request. + */ + _meta?: RequestMeta; + /** + * The JSON-RPC ID of the request being handled. + * This can be useful for tracking or logging purposes. + */ + requestId: RequestId; + /** + * Sends a notification that relates to the current request being handled. + * + * This is used by certain transports to correctly associate related messages. + */ + sendNotification: (notification: SendNotificationT) => Promise; + /** + * Sends a request that relates to the current request being handled. + * + * This is used by certain transports to correctly associate related messages. + */ + sendRequest: >(request: SendRequestT, resultSchema: U, options?: RequestOptions) => Promise>; +}; +/** + * Implements MCP protocol framing on top of a pluggable transport, including + * features like request/response linking, notifications, and progress. + */ +export declare abstract class Protocol { + private _options?; + private _transport?; + private _requestMessageId; + private _requestHandlers; + private _requestHandlerAbortControllers; + private _notificationHandlers; + private _responseHandlers; + private _progressHandlers; + private _timeoutInfo; + /** + * Callback for when the connection is closed for any reason. + * + * This is invoked when close() is called as well. + */ + onclose?: () => void; + /** + * Callback for when an error occurs. + * + * Note that errors are not necessarily fatal; they are used for reporting any kind of exceptional condition out of band. + */ + onerror?: (error: Error) => void; + /** + * A handler to invoke for any request types that do not have their own handler installed. + */ + fallbackRequestHandler?: (request: Request) => Promise; + /** + * A handler to invoke for any notification types that do not have their own handler installed. + */ + fallbackNotificationHandler?: (notification: Notification) => Promise; + constructor(_options?: ProtocolOptions | undefined); + private _setupTimeout; + private _resetTimeout; + private _cleanupTimeout; + /** + * Attaches to the given transport, starts it, and starts listening for messages. + * + * The Protocol object assumes ownership of the Transport, replacing any callbacks that have already been set, and expects that it is the only user of the Transport instance going forward. + */ + connect(transport: Transport): Promise; + private _onclose; + private _onerror; + private _onnotification; + private _onrequest; + private _onprogress; + private _onresponse; + get transport(): Transport | undefined; + /** + * Closes the connection. + */ + close(): Promise; + /** + * A method to check if a capability is supported by the remote side, for the given method to be called. + * + * This should be implemented by subclasses. + */ + protected abstract assertCapabilityForMethod(method: SendRequestT["method"]): void; + /** + * A method to check if a notification is supported by the local side, for the given method to be sent. + * + * This should be implemented by subclasses. + */ + protected abstract assertNotificationCapability(method: SendNotificationT["method"]): void; + /** + * A method to check if a request handler is supported by the local side, for the given method to be handled. + * + * This should be implemented by subclasses. + */ + protected abstract assertRequestHandlerCapability(method: string): void; + /** + * Sends a request and wait for a response. + * + * Do not use this method to emit notifications! Use notification() instead. + */ + request>(request: SendRequestT, resultSchema: T, options?: RequestOptions): Promise>; + /** + * Emits a notification, which is a one-way message that does not expect a response. + */ + notification(notification: SendNotificationT, options?: NotificationOptions): Promise; + /** + * Registers a handler to invoke when this protocol object receives a request with the given method. + * + * Note that this will replace any previous request handler for the same method. + */ + setRequestHandler; + }>>(requestSchema: T, handler: (request: z.infer, extra: RequestHandlerExtra) => SendResultT | Promise): void; + /** + * Removes the request handler for the given method. + */ + removeRequestHandler(method: string): void; + /** + * Asserts that a request handler has not already been set for the given method, in preparation for a new one being automatically installed. + */ + assertCanSetRequestHandler(method: string): void; + /** + * Registers a handler to invoke when this protocol object receives a notification with the given method. + * + * Note that this will replace any previous notification handler for the same method. + */ + setNotificationHandler; + }>>(notificationSchema: T, handler: (notification: z.infer) => void | Promise): void; + /** + * Removes the notification handler for the given method. + */ + removeNotificationHandler(method: string): void; +} +export declare function mergeCapabilities(base: T, additional: T): T; +//# sourceMappingURL=protocol.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/protocol.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/protocol.d.ts.map new file mode 100644 index 0000000000..74819ec2ef --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/protocol.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../../src/shared/protocol.ts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C,EAChB,OAAO,EAAE,CACP,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EACnB,KAAK,EAAE,mBAAmB,CAAC,YAAY,EAAE,iBAAiB,CAAC,KACxD,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,GACtC,IAAI;IASP;;OAEG;IACH,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAI1C;;OAEG;IACH,0BAA0B,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAQhD;;;;OAIG;IACH,sBAAsB,CACpB,CAAC,SAAS,SAAS,CAAC;QAClB,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;KAC5B,CAAC,EAEF,kBAAkB,EAAE,CAAC,EACrB,OAAO,EAAE,CAAC,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAC1D,IAAI;IAQP;;OAEG;IACH,yBAAyB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;CAGhD;AAED,wBAAgB,iBAAiB,CAC/B,CAAC,SAAS,kBAAkB,GAAG,kBAAkB,EACjD,IAAI,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,GAAG,CAAC,CAY3B"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/protocol.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/protocol.js new file mode 100644 index 0000000000..50adddf3cb --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/protocol.js @@ -0,0 +1,374 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Protocol = exports.DEFAULT_REQUEST_TIMEOUT_MSEC = void 0; +exports.mergeCapabilities = mergeCapabilities; +const types_js_1 = require("../types.js"); +/** + * The default request timeout, in miliseconds. + */ +exports.DEFAULT_REQUEST_TIMEOUT_MSEC = 60000; +/** + * Implements MCP protocol framing on top of a pluggable transport, including + * features like request/response linking, notifications, and progress. + */ +class Protocol { + constructor(_options) { + this._options = _options; + this._requestMessageId = 0; + this._requestHandlers = new Map(); + this._requestHandlerAbortControllers = new Map(); + this._notificationHandlers = new Map(); + this._responseHandlers = new Map(); + this._progressHandlers = new Map(); + this._timeoutInfo = new Map(); + this.setNotificationHandler(types_js_1.CancelledNotificationSchema, (notification) => { + const controller = this._requestHandlerAbortControllers.get(notification.params.requestId); + controller === null || controller === void 0 ? void 0 : controller.abort(notification.params.reason); + }); + this.setNotificationHandler(types_js_1.ProgressNotificationSchema, (notification) => { + this._onprogress(notification); + }); + this.setRequestHandler(types_js_1.PingRequestSchema, + // Automatic pong by default. + (_request) => ({})); + } + _setupTimeout(messageId, timeout, maxTotalTimeout, onTimeout, resetTimeoutOnProgress = false) { + this._timeoutInfo.set(messageId, { + timeoutId: setTimeout(onTimeout, timeout), + startTime: Date.now(), + timeout, + maxTotalTimeout, + resetTimeoutOnProgress, + onTimeout + }); + } + _resetTimeout(messageId) { + const info = this._timeoutInfo.get(messageId); + if (!info) + return false; + const totalElapsed = Date.now() - info.startTime; + if (info.maxTotalTimeout && totalElapsed >= info.maxTotalTimeout) { + this._timeoutInfo.delete(messageId); + throw new types_js_1.McpError(types_js_1.ErrorCode.RequestTimeout, "Maximum total timeout exceeded", { maxTotalTimeout: info.maxTotalTimeout, totalElapsed }); + } + clearTimeout(info.timeoutId); + info.timeoutId = setTimeout(info.onTimeout, info.timeout); + return true; + } + _cleanupTimeout(messageId) { + const info = this._timeoutInfo.get(messageId); + if (info) { + clearTimeout(info.timeoutId); + this._timeoutInfo.delete(messageId); + } + } + /** + * Attaches to the given transport, starts it, and starts listening for messages. + * + * The Protocol object assumes ownership of the Transport, replacing any callbacks that have already been set, and expects that it is the only user of the Transport instance going forward. + */ + async connect(transport) { + this._transport = transport; + this._transport.onclose = () => { + this._onclose(); + }; + this._transport.onerror = (error) => { + this._onerror(error); + }; + this._transport.onmessage = (message, extra) => { + if ((0, types_js_1.isJSONRPCResponse)(message) || (0, types_js_1.isJSONRPCError)(message)) { + this._onresponse(message); + } + else if ((0, types_js_1.isJSONRPCRequest)(message)) { + this._onrequest(message, extra); + } + else if ((0, types_js_1.isJSONRPCNotification)(message)) { + this._onnotification(message); + } + else { + this._onerror(new Error(`Unknown message type: ${JSON.stringify(message)}`)); + } + }; + await this._transport.start(); + } + _onclose() { + var _a; + const responseHandlers = this._responseHandlers; + this._responseHandlers = new Map(); + this._progressHandlers.clear(); + this._transport = undefined; + (_a = this.onclose) === null || _a === void 0 ? void 0 : _a.call(this); + const error = new types_js_1.McpError(types_js_1.ErrorCode.ConnectionClosed, "Connection closed"); + for (const handler of responseHandlers.values()) { + handler(error); + } + } + _onerror(error) { + var _a; + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + } + _onnotification(notification) { + var _a; + const handler = (_a = this._notificationHandlers.get(notification.method)) !== null && _a !== void 0 ? _a : this.fallbackNotificationHandler; + // Ignore notifications not being subscribed to. + if (handler === undefined) { + return; + } + // Starting with Promise.resolve() puts any synchronous errors into the monad as well. + Promise.resolve() + .then(() => handler(notification)) + .catch((error) => this._onerror(new Error(`Uncaught error in notification handler: ${error}`))); + } + _onrequest(request, extra) { + var _a, _b, _c, _d; + const handler = (_a = this._requestHandlers.get(request.method)) !== null && _a !== void 0 ? _a : this.fallbackRequestHandler; + if (handler === undefined) { + (_b = this._transport) === null || _b === void 0 ? void 0 : _b.send({ + jsonrpc: "2.0", + id: request.id, + error: { + code: types_js_1.ErrorCode.MethodNotFound, + message: "Method not found", + }, + }).catch((error) => this._onerror(new Error(`Failed to send an error response: ${error}`))); + return; + } + const abortController = new AbortController(); + this._requestHandlerAbortControllers.set(request.id, abortController); + const fullExtra = { + signal: abortController.signal, + sessionId: (_c = this._transport) === null || _c === void 0 ? void 0 : _c.sessionId, + _meta: (_d = request.params) === null || _d === void 0 ? void 0 : _d._meta, + sendNotification: (notification) => this.notification(notification, { relatedRequestId: request.id }), + sendRequest: (r, resultSchema, options) => this.request(r, resultSchema, { ...options, relatedRequestId: request.id }), + authInfo: extra === null || extra === void 0 ? void 0 : extra.authInfo, + requestId: request.id, + }; + // Starting with Promise.resolve() puts any synchronous errors into the monad as well. + Promise.resolve() + .then(() => handler(request, fullExtra)) + .then((result) => { + var _a; + if (abortController.signal.aborted) { + return; + } + return (_a = this._transport) === null || _a === void 0 ? void 0 : _a.send({ + result, + jsonrpc: "2.0", + id: request.id, + }); + }, (error) => { + var _a, _b; + if (abortController.signal.aborted) { + return; + } + return (_a = this._transport) === null || _a === void 0 ? void 0 : _a.send({ + jsonrpc: "2.0", + id: request.id, + error: { + code: Number.isSafeInteger(error["code"]) + ? error["code"] + : types_js_1.ErrorCode.InternalError, + message: (_b = error.message) !== null && _b !== void 0 ? _b : "Internal error", + }, + }); + }) + .catch((error) => this._onerror(new Error(`Failed to send response: ${error}`))) + .finally(() => { + this._requestHandlerAbortControllers.delete(request.id); + }); + } + _onprogress(notification) { + const { progressToken, ...params } = notification.params; + const messageId = Number(progressToken); + const handler = this._progressHandlers.get(messageId); + if (!handler) { + this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(notification)}`)); + return; + } + const responseHandler = this._responseHandlers.get(messageId); + const timeoutInfo = this._timeoutInfo.get(messageId); + if (timeoutInfo && responseHandler && timeoutInfo.resetTimeoutOnProgress) { + try { + this._resetTimeout(messageId); + } + catch (error) { + responseHandler(error); + return; + } + } + handler(params); + } + _onresponse(response) { + const messageId = Number(response.id); + const handler = this._responseHandlers.get(messageId); + if (handler === undefined) { + this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(response)}`)); + return; + } + this._responseHandlers.delete(messageId); + this._progressHandlers.delete(messageId); + this._cleanupTimeout(messageId); + if ((0, types_js_1.isJSONRPCResponse)(response)) { + handler(response); + } + else { + const error = new types_js_1.McpError(response.error.code, response.error.message, response.error.data); + handler(error); + } + } + get transport() { + return this._transport; + } + /** + * Closes the connection. + */ + async close() { + var _a; + await ((_a = this._transport) === null || _a === void 0 ? void 0 : _a.close()); + } + /** + * Sends a request and wait for a response. + * + * Do not use this method to emit notifications! Use notification() instead. + */ + request(request, resultSchema, options) { + const { relatedRequestId, resumptionToken, onresumptiontoken } = options !== null && options !== void 0 ? options : {}; + return new Promise((resolve, reject) => { + var _a, _b, _c, _d, _e, _f; + if (!this._transport) { + reject(new Error("Not connected")); + return; + } + if (((_a = this._options) === null || _a === void 0 ? void 0 : _a.enforceStrictCapabilities) === true) { + this.assertCapabilityForMethod(request.method); + } + (_b = options === null || options === void 0 ? void 0 : options.signal) === null || _b === void 0 ? void 0 : _b.throwIfAborted(); + const messageId = this._requestMessageId++; + const jsonrpcRequest = { + ...request, + jsonrpc: "2.0", + id: messageId, + }; + if (options === null || options === void 0 ? void 0 : options.onprogress) { + this._progressHandlers.set(messageId, options.onprogress); + jsonrpcRequest.params = { + ...request.params, + _meta: { + ...(((_c = request.params) === null || _c === void 0 ? void 0 : _c._meta) || {}), + progressToken: messageId + }, + }; + } + const cancel = (reason) => { + var _a; + this._responseHandlers.delete(messageId); + this._progressHandlers.delete(messageId); + this._cleanupTimeout(messageId); + (_a = this._transport) === null || _a === void 0 ? void 0 : _a.send({ + jsonrpc: "2.0", + method: "notifications/cancelled", + params: { + requestId: messageId, + reason: String(reason), + }, + }, { relatedRequestId, resumptionToken, onresumptiontoken }).catch((error) => this._onerror(new Error(`Failed to send cancellation: ${error}`))); + reject(reason); + }; + this._responseHandlers.set(messageId, (response) => { + var _a; + if ((_a = options === null || options === void 0 ? void 0 : options.signal) === null || _a === void 0 ? void 0 : _a.aborted) { + return; + } + if (response instanceof Error) { + return reject(response); + } + try { + const result = resultSchema.parse(response.result); + resolve(result); + } + catch (error) { + reject(error); + } + }); + (_d = options === null || options === void 0 ? void 0 : options.signal) === null || _d === void 0 ? void 0 : _d.addEventListener("abort", () => { + var _a; + cancel((_a = options === null || options === void 0 ? void 0 : options.signal) === null || _a === void 0 ? void 0 : _a.reason); + }); + const timeout = (_e = options === null || options === void 0 ? void 0 : options.timeout) !== null && _e !== void 0 ? _e : exports.DEFAULT_REQUEST_TIMEOUT_MSEC; + const timeoutHandler = () => cancel(new types_js_1.McpError(types_js_1.ErrorCode.RequestTimeout, "Request timed out", { timeout })); + this._setupTimeout(messageId, timeout, options === null || options === void 0 ? void 0 : options.maxTotalTimeout, timeoutHandler, (_f = options === null || options === void 0 ? void 0 : options.resetTimeoutOnProgress) !== null && _f !== void 0 ? _f : false); + this._transport.send(jsonrpcRequest, { relatedRequestId, resumptionToken, onresumptiontoken }).catch((error) => { + this._cleanupTimeout(messageId); + reject(error); + }); + }); + } + /** + * Emits a notification, which is a one-way message that does not expect a response. + */ + async notification(notification, options) { + if (!this._transport) { + throw new Error("Not connected"); + } + this.assertNotificationCapability(notification.method); + const jsonrpcNotification = { + ...notification, + jsonrpc: "2.0", + }; + await this._transport.send(jsonrpcNotification, options); + } + /** + * Registers a handler to invoke when this protocol object receives a request with the given method. + * + * Note that this will replace any previous request handler for the same method. + */ + setRequestHandler(requestSchema, handler) { + const method = requestSchema.shape.method.value; + this.assertRequestHandlerCapability(method); + this._requestHandlers.set(method, (request, extra) => { + return Promise.resolve(handler(requestSchema.parse(request), extra)); + }); + } + /** + * Removes the request handler for the given method. + */ + removeRequestHandler(method) { + this._requestHandlers.delete(method); + } + /** + * Asserts that a request handler has not already been set for the given method, in preparation for a new one being automatically installed. + */ + assertCanSetRequestHandler(method) { + if (this._requestHandlers.has(method)) { + throw new Error(`A request handler for ${method} already exists, which would be overridden`); + } + } + /** + * Registers a handler to invoke when this protocol object receives a notification with the given method. + * + * Note that this will replace any previous notification handler for the same method. + */ + setNotificationHandler(notificationSchema, handler) { + this._notificationHandlers.set(notificationSchema.shape.method.value, (notification) => Promise.resolve(handler(notificationSchema.parse(notification)))); + } + /** + * Removes the notification handler for the given method. + */ + removeNotificationHandler(method) { + this._notificationHandlers.delete(method); + } +} +exports.Protocol = Protocol; +function mergeCapabilities(base, additional) { + return Object.entries(additional).reduce((acc, [key, value]) => { + if (value && typeof value === "object") { + acc[key] = acc[key] ? { ...acc[key], ...value } : value; + } + else { + acc[key] = value; + } + return acc; + }, { ...base }); +} +//# sourceMappingURL=protocol.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/protocol.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/protocol.js.map new file mode 100644 index 0000000000..a0747b53e7 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/protocol.js.map @@ -0,0 +1 @@ +{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../../src/shared/protocol.ts"],"names":[],"mappings":";;;AAwrBA,8CAcC;AArsBD,0CAuBqB;AAuBrB;;GAEG;AACU,QAAA,4BAA4B,GAAG,KAAK,CAAC;AA0GlD;;;GAGG;AACH,MAAsB,QAAQ;IAmD5B,YAAoB,QAA0B;QAA1B,aAAQ,GAAR,QAAQ,CAAkB;QA7CtC,sBAAiB,GAAG,CAAC,CAAC;QACtB,qBAAgB,GAMpB,IAAI,GAAG,EAAE,CAAC;QACN,oCAA+B,GACrC,IAAI,GAAG,EAAE,CAAC;QACJ,0BAAqB,GAGzB,IAAI,GAAG,EAAE,CAAC;QACN,sBAAiB,GAGrB,IAAI,GAAG,EAAE,CAAC;QACN,sBAAiB,GAAkC,IAAI,GAAG,EAAE,CAAC;QAC7D,iBAAY,GAA6B,IAAI,GAAG,EAAE,CAAC;QA2BzD,IAAI,CAAC,sBAAsB,CAAC,sCAA2B,EAAE,CAAC,YAAY,EAAE,EAAE;YACxE,MAAM,UAAU,GAAG,IAAI,CAAC,+BAA+B,CAAC,GAAG,CACzD,YAAY,CAAC,MAAM,CAAC,SAAS,CAC9B,CAAC;YACF,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,sBAAsB,CAAC,qCAA0B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ist/cjs/shared/stdio.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/stdio.d.ts new file mode 100644 index 0000000000..c997594734 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/stdio.d.ts @@ -0,0 +1,13 @@ +import { JSONRPCMessage } from "../types.js"; +/** + * Buffers a continuous stdio stream into discrete JSON-RPC messages. + */ +export declare class ReadBuffer { + private _buffer?; + append(chunk: Buffer): void; + readMessage(): JSONRPCMessage | null; + clear(): void; +} +export declare function deserializeMessage(line: string): JSONRPCMessage; +export declare function serializeMessage(message: JSONRPCMessage): string; +//# sourceMappingURL=stdio.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/stdio.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/stdio.d.ts.map new file mode 100644 index 0000000000..e730360d2f --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/stdio.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"stdio.d.ts","sourceRoot":"","sources":["../../../src/shared/stdio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,aAAa,CAAC;AAEnE;;GAEG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,OAAO,CAAC,CAAS;IAEzB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAI3B,WAAW,IAAI,cAAc,GAAG,IAAI;IAepC,KAAK,IAAI,IAAI;CAGd;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAE/D;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,CAEhE"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/stdio.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/stdio.js new file mode 100644 index 0000000000..661b1b175e --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/stdio.js @@ -0,0 +1,37 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ReadBuffer = void 0; +exports.deserializeMessage = deserializeMessage; +exports.serializeMessage = serializeMessage; +const types_js_1 = require("../types.js"); +/** + * Buffers a continuous stdio stream into discrete JSON-RPC messages. + */ +class ReadBuffer { + append(chunk) { + this._buffer = this._buffer ? Buffer.concat([this._buffer, chunk]) : chunk; + } + readMessage() { + if (!this._buffer) { + return null; + } + const index = this._buffer.indexOf("\n"); + if (index === -1) { + return null; + } + const line = this._buffer.toString("utf8", 0, index).replace(/\r$/, ''); + this._buffer = this._buffer.subarray(index + 1); + return deserializeMessage(line); + } + clear() { + this._buffer = undefined; + } +} +exports.ReadBuffer = ReadBuffer; +function deserializeMessage(line) { + return types_js_1.JSONRPCMessageSchema.parse(JSON.parse(line)); +} +function serializeMessage(message) { + return JSON.stringify(message) + "\n"; +} +//# sourceMappingURL=stdio.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/stdio.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/stdio.js.map new file mode 100644 index 0000000000..c77cfa29e6 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/stdio.js.map @@ -0,0 +1 @@ +{"version":3,"file":"stdio.js","sourceRoot":"","sources":["../../../src/shared/stdio.ts"],"names":[],"mappings":";;;AAgCA,gDAEC;AAED,4CAEC;AAtCD,0CAAmE;AAEnE;;GAEG;AACH,MAAa,UAAU;IAGrB,MAAM,CAAC,KAAa;QAClB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAC7E,CAAC;IAED,WAAW;QACT,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YAClB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;YACjB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACxE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QAChD,OAAO,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;IAED,KAAK;QACH,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC;IAC3B,CAAC;CACF;AAzBD,gCAyBC;AAED,SAAgB,kBAAkB,CAAC,IAAY;IAC7C,OAAO,+BAAoB,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;AACtD,CAAC;AAED,SAAgB,gBAAgB,CAAC,OAAuB;IACtD,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;AACxC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/transport.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/transport.d.ts new file mode 100644 index 0000000000..18700b203f --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/transport.d.ts @@ -0,0 +1,72 @@ +import { AuthInfo } from "../server/auth/types.js"; +import { JSONRPCMessage, RequestId } from "../types.js"; +/** + * Options for sending a JSON-RPC message. + */ +export type TransportSendOptions = { + /** + * If present, `relatedRequestId` is used to indicate to the transport which incoming request to associate this outgoing message with. + */ + relatedRequestId?: RequestId; + /** + * The resumption token used to continue long-running requests that were interrupted. + * + * This allows clients to reconnect and continue from where they left off, if supported by the transport. + */ + resumptionToken?: string; + /** + * A callback that is invoked when the resumption token changes, if supported by the transport. + * + * This allows clients to persist the latest token for potential reconnection. + */ + onresumptiontoken?: (token: string) => void; +}; +/** + * Describes the minimal contract for a MCP transport that a client or server can communicate over. + */ +export interface Transport { + /** + * Starts processing messages on the transport, including any connection steps that might need to be taken. + * + * This method should only be called after callbacks are installed, or else messages may be lost. + * + * NOTE: This method should not be called explicitly when using Client, Server, or Protocol classes, as they will implicitly call start(). + */ + start(): Promise; + /** + * Sends a JSON-RPC message (request or response). + * + * If present, `relatedRequestId` is used to indicate to the transport which incoming request to associate this outgoing message with. + */ + send(message: JSONRPCMessage, options?: TransportSendOptions): Promise; + /** + * Closes the connection. + */ + close(): Promise; + /** + * Callback for when the connection is closed for any reason. + * + * This should be invoked when close() is called as well. + */ + onclose?: () => void; + /** + * Callback for when an error occurs. + * + * Note that errors are not necessarily fatal; they are used for reporting any kind of exceptional condition out of band. + */ + onerror?: (error: Error) => void; + /** + * Callback for when a message (request or response) is received over the connection. + * + * Includes the authInfo if the transport is authenticated. + * + */ + onmessage?: (message: JSONRPCMessage, extra?: { + authInfo?: AuthInfo; + }) => void; + /** + * The session ID generated for this connection. + */ + sessionId?: string; +} +//# sourceMappingURL=transport.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/transport.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/transport.d.ts.map new file mode 100644 index 0000000000..e762585c2a --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/transport.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../../src/shared/transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExD;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC;;OAEG;IACH,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAE7B;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7C,CAAA;AACD;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;;;;;OAMG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB;;;;OAIG;IACH,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7E;;OAEG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAEjC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,QAAQ,CAAA;KAAE,KAAK,IAAI,CAAC;IAE/E;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/transport.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/transport.js new file mode 100644 index 0000000000..61dc71e280 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/transport.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=transport.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/transport.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/transport.js.map new file mode 100644 index 0000000000..b10f2929f2 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/transport.js.map @@ -0,0 +1 @@ +{"version":3,"file":"transport.js","sourceRoot":"","sources":["../../../src/shared/transport.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/uriTemplate.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/uriTemplate.d.ts new file mode 100644 index 0000000000..175e329b66 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/uriTemplate.d.ts @@ -0,0 +1,25 @@ +export type Variables = Record; +export declare class UriTemplate { + /** + * Returns true if the given string contains any URI template expressions. + * A template expression is a sequence of characters enclosed in curly braces, + * like {foo} or {?bar}. + */ + static isTemplate(str: string): boolean; + private static validateLength; + private readonly template; + private readonly parts; + get variableNames(): string[]; + constructor(template: string); + toString(): string; + private parse; + private getOperator; + private getNames; + private encodeValue; + private expandPart; + expand(variables: Variables): string; + private escapeRegExp; + private partToRegExp; + match(uri: string): Variables | null; +} +//# sourceMappingURL=uriTemplate.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/uriTemplate.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/uriTemplate.d.ts.map new file mode 100644 index 0000000000..c2d381fa35 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/uriTemplate.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"uriTemplate.d.ts","sourceRoot":"","sources":["../../../src/shared/uriTemplate.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;AAO1D,qBAAa,WAAW;IACtB;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAMvC,OAAO,CAAC,MAAM,CAAC,cAAc;IAW7B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAGpB;IAEF,IAAI,aAAa,IAAI,MAAM,EAAE,CAE5B;gBAEW,QAAQ,EAAE,MAAM;IAM5B,QAAQ,IAAI,MAAM;IAIlB,OAAO,CAAC,KAAK;IA4Db,OAAO,CAAC,WAAW;IAKnB,OAAO,CAAC,QAAQ;IAShB,OAAO,CAAC,WAAW;IAQnB,OAAO,CAAC,UAAU;IAwDlB,MAAM,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM;IA4BpC,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,YAAY;IAkDpB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI;CA2CrC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/uriTemplate.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/uriTemplate.js new file mode 100644 index 0000000000..fd2ac95715 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/uriTemplate.js @@ -0,0 +1,245 @@ +"use strict"; +// Claude-authored implementation of RFC 6570 URI Templates +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UriTemplate = void 0; +const MAX_TEMPLATE_LENGTH = 1000000; // 1MB +const MAX_VARIABLE_LENGTH = 1000000; // 1MB +const MAX_TEMPLATE_EXPRESSIONS = 10000; +const MAX_REGEX_LENGTH = 1000000; // 1MB +class UriTemplate { + /** + * Returns true if the given string contains any URI template expressions. + * A template expression is a sequence of characters enclosed in curly braces, + * like {foo} or {?bar}. + */ + static isTemplate(str) { + // Look for any sequence of characters between curly braces + // that isn't just whitespace + return /\{[^}\s]+\}/.test(str); + } + static validateLength(str, max, context) { + if (str.length > max) { + throw new Error(`${context} exceeds maximum length of ${max} characters (got ${str.length})`); + } + } + get variableNames() { + return this.parts.flatMap((part) => typeof part === 'string' ? [] : part.names); + } + constructor(template) { + UriTemplate.validateLength(template, MAX_TEMPLATE_LENGTH, "Template"); + this.template = template; + this.parts = this.parse(template); + } + toString() { + return this.template; + } + parse(template) { + const parts = []; + let currentText = ""; + let i = 0; + let expressionCount = 0; + while (i < template.length) { + if (template[i] === "{") { + if (currentText) { + parts.push(currentText); + currentText = ""; + } + const end = template.indexOf("}", i); + if (end === -1) + throw new Error("Unclosed template expression"); + expressionCount++; + if (expressionCount > MAX_TEMPLATE_EXPRESSIONS) { + throw new Error(`Template contains too many expressions (max ${MAX_TEMPLATE_EXPRESSIONS})`); + } + const expr = template.slice(i + 1, end); + const operator = this.getOperator(expr); + const exploded = expr.includes("*"); + const names = this.getNames(expr); + const name = names[0]; + // Validate variable name length + for (const name of names) { + UriTemplate.validateLength(name, MAX_VARIABLE_LENGTH, "Variable name"); + } + parts.push({ name, operator, names, exploded }); + i = end + 1; + } + else { + currentText += template[i]; + i++; + } + } + if (currentText) { + parts.push(currentText); + } + return parts; + } + getOperator(expr) { + const operators = ["+", "#", ".", "/", "?", "&"]; + return operators.find((op) => expr.startsWith(op)) || ""; + } + getNames(expr) { + const operator = this.getOperator(expr); + return expr + .slice(operator.length) + .split(",") + .map((name) => name.replace("*", "").trim()) + .filter((name) => name.length > 0); + } + encodeValue(value, operator) { + UriTemplate.validateLength(value, MAX_VARIABLE_LENGTH, "Variable value"); + if (operator === "+" || operator === "#") { + return encodeURI(value); + } + return encodeURIComponent(value); + } + expandPart(part, variables) { + if (part.operator === "?" || part.operator === "&") { + const pairs = part.names + .map((name) => { + const value = variables[name]; + if (value === undefined) + return ""; + const encoded = Array.isArray(value) + ? value.map((v) => this.encodeValue(v, part.operator)).join(",") + : this.encodeValue(value.toString(), part.operator); + return `${name}=${encoded}`; + }) + .filter((pair) => pair.length > 0); + if (pairs.length === 0) + return ""; + const separator = part.operator === "?" ? "?" : "&"; + return separator + pairs.join("&"); + } + if (part.names.length > 1) { + const values = part.names + .map((name) => variables[name]) + .filter((v) => v !== undefined); + if (values.length === 0) + return ""; + return values.map((v) => (Array.isArray(v) ? v[0] : v)).join(","); + } + const value = variables[part.name]; + if (value === undefined) + return ""; + const values = Array.isArray(value) ? value : [value]; + const encoded = values.map((v) => this.encodeValue(v, part.operator)); + switch (part.operator) { + case "": + return encoded.join(","); + case "+": + return encoded.join(","); + case "#": + return "#" + encoded.join(","); + case ".": + return "." + encoded.join("."); + case "/": + return "/" + encoded.join("/"); + default: + return encoded.join(","); + } + } + expand(variables) { + let result = ""; + let hasQueryParam = false; + for (const part of this.parts) { + if (typeof part === "string") { + result += part; + continue; + } + const expanded = this.expandPart(part, variables); + if (!expanded) + continue; + // Convert ? to & if we already have a query parameter + if ((part.operator === "?" || part.operator === "&") && hasQueryParam) { + result += expanded.replace("?", "&"); + } + else { + result += expanded; + } + if (part.operator === "?" || part.operator === "&") { + hasQueryParam = true; + } + } + return result; + } + escapeRegExp(str) { + return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); + } + partToRegExp(part) { + const patterns = []; + // Validate variable name length for matching + for (const name of part.names) { + UriTemplate.validateLength(name, MAX_VARIABLE_LENGTH, "Variable name"); + } + if (part.operator === "?" || part.operator === "&") { + for (let i = 0; i < part.names.length; i++) { + const name = part.names[i]; + const prefix = i === 0 ? "\\" + part.operator : "&"; + patterns.push({ + pattern: prefix + this.escapeRegExp(name) + "=([^&]+)", + name, + }); + } + return patterns; + } + let pattern; + const name = part.name; + switch (part.operator) { + case "": + pattern = part.exploded ? "([^/]+(?:,[^/]+)*)" : "([^/,]+)"; + break; + case "+": + case "#": + pattern = "(.+)"; + break; + case ".": + pattern = "\\.([^/,]+)"; + break; + case "/": + pattern = "/" + (part.exploded ? "([^/]+(?:,[^/]+)*)" : "([^/,]+)"); + break; + default: + pattern = "([^/]+)"; + } + patterns.push({ pattern, name }); + return patterns; + } + match(uri) { + UriTemplate.validateLength(uri, MAX_TEMPLATE_LENGTH, "URI"); + let pattern = "^"; + const names = []; + for (const part of this.parts) { + if (typeof part === "string") { + pattern += this.escapeRegExp(part); + } + else { + const patterns = this.partToRegExp(part); + for (const { pattern: partPattern, name } of patterns) { + pattern += partPattern; + names.push({ name, exploded: part.exploded }); + } + } + } + pattern += "$"; + UriTemplate.validateLength(pattern, MAX_REGEX_LENGTH, "Generated regex pattern"); + const regex = new RegExp(pattern); + const match = uri.match(regex); + if (!match) + return null; + const result = {}; + for (let i = 0; i < names.length; i++) { + const { name, exploded } = names[i]; + const value = match[i + 1]; + const cleanName = name.replace("*", ""); + if (exploded && value.includes(",")) { + result[cleanName] = value.split(","); + } + else { + result[cleanName] = value; + } + } + return result; + } +} +exports.UriTemplate = UriTemplate; +//# sourceMappingURL=uriTemplate.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/uriTemplate.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/uriTemplate.js.map new file mode 100644 index 0000000000..87db00c98f --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/shared/uriTemplate.js.map @@ -0,0 +1 @@ +{"version":3,"file":"uriTemplate.js","sourceRoot":"","sources":["../../../src/shared/uriTemplate.ts"],"names":[],"mappings":";AAAA,2DAA2D;;;AAI3D,MAAM,mBAAmB,GAAG,OAAO,CAAC,CAAC,MAAM;AAC3C,MAAM,mBAAmB,GAAG,OAAO,CAAC,CAAC,MAAM;AAC3C,MAAM,wBAAwB,GAAG,KAAK,CAAC;AACvC,MAAM,gBAAgB,GAAG,OAAO,CAAC,CAAC,MAAM;AAExC,MAAa,WAAW;IACtB;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,GAAW;QAC3B,2DAA2D;QAC3D,6BAA6B;QAC7B,OAAO,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC;IAEO,MAAM,CAAC,cAAc,CAC3B,GAAW,EACX,GAAW,EACX,OAAe;QAEf,IAAI,GAAG,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CACb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 No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/types.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/cjs/types.d.ts new file mode 100644 index 0000000000..3f5473bb1f --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/types.d.ts @@ -0,0 +1,31751 @@ +import { z, ZodTypeAny } from "zod"; +export declare const LATEST_PROTOCOL_VERSION = "2025-03-26"; +export declare const SUPPORTED_PROTOCOL_VERSIONS: string[]; +export declare const JSONRPC_VERSION = "2.0"; +/** + * A progress token, used to associate progress notifications with the original request. + */ +export declare const ProgressTokenSchema: z.ZodUnion<[z.ZodString, z.ZodNumber]>; +/** + * An opaque token used to represent a cursor for pagination. + */ +export declare const CursorSchema: z.ZodString; +declare const RequestMetaSchema: z.ZodObject<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; +}, z.ZodTypeAny, "passthrough">>; +export declare const RequestSchema: z.ZodObject<{ + method: z.ZodString; + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, "strip", z.ZodTypeAny, { + method: string; + params?: z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: string; + params?: z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +export declare const NotificationSchema: z.ZodObject<{ + method: z.ZodString; + params: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, "strip", z.ZodTypeAny, { + method: string; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: string; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +export declare const ResultSchema: z.ZodObject<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, z.ZodTypeAny, "passthrough">>; +/** + * A uniquely identifying ID for a request in JSON-RPC. + */ +export declare const RequestIdSchema: z.ZodUnion<[z.ZodString, z.ZodNumber]>; +/** + * A request that expects a response. + */ +export declare const JSONRPCRequestSchema: z.ZodObject; + id: z.ZodUnion<[z.ZodString, z.ZodNumber]>; +}, { + method: z.ZodString; + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}>, "strict", z.ZodTypeAny, { + method: string; + jsonrpc: "2.0"; + id: string | number; + params?: z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: string; + jsonrpc: "2.0"; + id: string | number; + params?: z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +export declare const isJSONRPCRequest: (value: unknown) => value is JSONRPCRequest; +/** + * A notification which does not expect a response. + */ +export declare const JSONRPCNotificationSchema: z.ZodObject; +}, { + method: z.ZodString; + params: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}>, "strict", z.ZodTypeAny, { + method: string; + jsonrpc: "2.0"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: string; + jsonrpc: "2.0"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +export declare const isJSONRPCNotification: (value: unknown) => value is JSONRPCNotification; +/** + * A successful (non-error) response to a request. + */ +export declare const JSONRPCResponseSchema: z.ZodObject<{ + jsonrpc: z.ZodLiteral<"2.0">; + id: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + result: z.ZodObject<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; +}, "strict", z.ZodTypeAny, { + jsonrpc: "2.0"; + id: string | number; + result: { + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; +}, { + jsonrpc: "2.0"; + id: string | number; + result: { + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; +}>; +export declare const isJSONRPCResponse: (value: unknown) => value is JSONRPCResponse; +/** + * Error codes defined by the JSON-RPC specification. + */ +export declare enum ErrorCode { + ConnectionClosed = -32000, + RequestTimeout = -32001, + ParseError = -32700, + InvalidRequest = -32600, + MethodNotFound = -32601, + InvalidParams = -32602, + InternalError = -32603 +} +/** + * A response to a request that indicates an error occurred. + */ +export declare const JSONRPCErrorSchema: z.ZodObject<{ + jsonrpc: z.ZodLiteral<"2.0">; + id: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + error: z.ZodObject<{ + /** + * The error type that occurred. + */ + code: z.ZodNumber; + /** + * A short description of the error. The message SHOULD be limited to a concise single sentence. + */ + message: z.ZodString; + /** + * Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.). + */ + data: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + code: number; + message: string; + data?: unknown; + }, { + code: number; + message: string; + data?: unknown; + }>; +}, "strict", z.ZodTypeAny, { + jsonrpc: "2.0"; + id: string | number; + error: { + code: number; + message: string; + data?: unknown; + }; +}, { + jsonrpc: "2.0"; + id: string | number; + error: { + code: number; + message: string; + data?: unknown; + }; +}>; +export declare const isJSONRPCError: (value: unknown) => value is JSONRPCError; +export declare const JSONRPCMessageSchema: z.ZodUnion<[z.ZodObject; + id: z.ZodUnion<[z.ZodString, z.ZodNumber]>; +}, { + method: z.ZodString; + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}>, "strict", z.ZodTypeAny, { + method: string; + jsonrpc: "2.0"; + id: string | number; + params?: z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: string; + jsonrpc: "2.0"; + id: string | number; + params?: z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject; +}, { + method: z.ZodString; + params: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}>, "strict", z.ZodTypeAny, { + method: string; + jsonrpc: "2.0"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: string; + jsonrpc: "2.0"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject<{ + jsonrpc: z.ZodLiteral<"2.0">; + id: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + result: z.ZodObject<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; +}, "strict", z.ZodTypeAny, { + jsonrpc: "2.0"; + id: string | number; + result: { + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; +}, { + jsonrpc: "2.0"; + id: string | number; + result: { + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; +}>, z.ZodObject<{ + jsonrpc: z.ZodLiteral<"2.0">; + id: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + error: z.ZodObject<{ + /** + * The error type that occurred. + */ + code: z.ZodNumber; + /** + * A short description of the error. The message SHOULD be limited to a concise single sentence. + */ + message: z.ZodString; + /** + * Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.). + */ + data: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + code: number; + message: string; + data?: unknown; + }, { + code: number; + message: string; + data?: unknown; + }>; +}, "strict", z.ZodTypeAny, { + jsonrpc: "2.0"; + id: string | number; + error: { + code: number; + message: string; + data?: unknown; + }; +}, { + jsonrpc: "2.0"; + id: string | number; + error: { + code: number; + message: string; + data?: unknown; + }; +}>]>; +/** + * A response that indicates success but carries no data. + */ +export declare const EmptyResultSchema: z.ZodObject<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, "strict", z.ZodTypeAny, { + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; +}, { + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * This notification can be sent by either side to indicate that it is cancelling a previously-issued request. + * + * The request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished. + * + * This notification indicates that the result will be unused, so any associated processing SHOULD cease. + * + * A client MUST NOT attempt to cancel its `initialize` request. + */ +export declare const CancelledNotificationSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/cancelled">; + params: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The ID of the request to cancel. + * + * This MUST correspond to the ID of a request previously issued in the same direction. + */ + requestId: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + /** + * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. + */ + reason: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The ID of the request to cancel. + * + * This MUST correspond to the ID of a request previously issued in the same direction. + */ + requestId: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + /** + * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. + */ + reason: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The ID of the request to cancel. + * + * This MUST correspond to the ID of a request previously issued in the same direction. + */ + requestId: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + /** + * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. + */ + reason: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + requestId: string | number; + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + reason?: string | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/cancelled"; +}, { + params: { + requestId: string | number; + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + reason?: string | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/cancelled"; +}>; +/** + * Describes the name and version of an MCP implementation. + */ +export declare const ImplementationSchema: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; +}, z.ZodTypeAny, "passthrough">>; +/** + * Capabilities a client may support. Known capabilities are defined here, in this schema, but this is not a closed set: any client can define its own, additional capabilities. + */ +export declare const ClientCapabilitiesSchema: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; +}, z.ZodTypeAny, "passthrough">>; +/** + * This request is sent from the client to the server when it first connects, asking it to begin initialization. + */ +export declare const InitializeRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"initialize">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + clientInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + clientInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + clientInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + protocolVersion: string; + capabilities: { + experimental?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + sampling?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + roots?: z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + clientInfo: { + name: string; + version: string; + } & { + [k: string]: unknown; + }; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "initialize"; +}, { + params: { + protocolVersion: string; + capabilities: { + experimental?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + sampling?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + roots?: z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + clientInfo: { + name: string; + version: string; + } & { + [k: string]: unknown; + }; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "initialize"; +}>; +export declare const isInitializeRequest: (value: unknown) => value is InitializeRequest; +/** + * Capabilities that a server may support. Known capabilities are defined here, in this schema, but this is not a closed set: any server can define its own, additional capabilities. + */ +export declare const ServerCapabilitiesSchema: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; +}, z.ZodTypeAny, "passthrough">>; +/** + * After receiving an initialize request from the client, the server sends this response. + */ +export declare const InitializeResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + serverInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + /** + * Instructions describing how to use the server and its features. + * + * This can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a "hint" to the model. For example, this information MAY be added to the system prompt. + */ + instructions: z.ZodOptional; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + serverInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + /** + * Instructions describing how to use the server and its features. + * + * This can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a "hint" to the model. For example, this information MAY be added to the system prompt. + */ + instructions: z.ZodOptional; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + serverInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + /** + * Instructions describing how to use the server and its features. + * + * This can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a "hint" to the model. For example, this information MAY be added to the system prompt. + */ + instructions: z.ZodOptional; +}>, z.ZodTypeAny, "passthrough">>; +/** + * This notification is sent from the client to the server after initialization has finished. + */ +export declare const InitializedNotificationSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/initialized">; +}>, "strip", z.ZodTypeAny, { + method: "notifications/initialized"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "notifications/initialized"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +export declare const isInitializedNotification: (value: unknown) => value is InitializedNotification; +/** + * A ping, issued by either the server or the client, to check that the other party is still alive. The receiver must promptly respond, or else may be disconnected. + */ +export declare const PingRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"ping">; +}>, "strip", z.ZodTypeAny, { + method: "ping"; + params?: z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "ping"; + params?: z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +export declare const ProgressSchema: z.ZodObject<{ + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + /** + * An optional message describing the current progress. + */ + message: z.ZodOptional; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + /** + * An optional message describing the current progress. + */ + message: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + /** + * An optional message describing the current progress. + */ + message: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">>; +/** + * An out-of-band notification used to inform the receiver of a progress update for a long-running request. + */ +export declare const ProgressNotificationSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/progress">; + params: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + /** + * An optional message describing the current progress. + */ + message: z.ZodOptional; + }>, { + /** + * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. + */ + progressToken: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + /** + * An optional message describing the current progress. + */ + message: z.ZodOptional; + }>, { + /** + * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. + */ + progressToken: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + /** + * An optional message describing the current progress. + */ + message: z.ZodOptional; + }>, { + /** + * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. + */ + progressToken: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + progressToken: string | number; + progress: number; + message?: string | undefined; + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + total?: number | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/progress"; +}, { + params: { + progressToken: string | number; + progress: number; + message?: string | undefined; + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + total?: number | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/progress"; +}>; +export declare const PaginatedRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>>; +}>, "strip", z.ZodTypeAny, { + method: string; + params?: z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: string; + params?: z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}>; +export declare const PaginatedResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, z.ZodTypeAny, "passthrough">>; +/** + * The contents of a specific resource or sub-resource. + */ +export declare const ResourceContentsSchema: z.ZodObject<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">>; +export declare const TextResourceContentsSchema: z.ZodObject; +}, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType; +}, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType; +}, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; +}>, z.ZodTypeAny, "passthrough">>; +export declare const BlobResourceContentsSchema: z.ZodObject; +}, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType; +}, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType; +}, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; +}>, z.ZodTypeAny, "passthrough">>; +/** + * A known resource that the server is capable of reading. + */ +export declare const ResourceSchema: z.ZodObject<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">>; +/** + * A template description for resources available on the server. + */ +export declare const ResourceTemplateSchema: z.ZodObject<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">>; +/** + * Sent from the client to request a list of resources the server has. + */ +export declare const ListResourcesRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>>; +}>, { + method: z.ZodLiteral<"resources/list">; +}>, "strip", z.ZodTypeAny, { + method: "resources/list"; + params?: z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "resources/list"; + params?: z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * The server's response to a resources/list request from the client. + */ +export declare const ListResourcesResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resources: z.ZodArray; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resources: z.ZodArray; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resources: z.ZodArray; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>; +/** + * Sent from the client to request a list of resource templates the server has. + */ +export declare const ListResourceTemplatesRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>>; +}>, { + method: z.ZodLiteral<"resources/templates/list">; +}>, "strip", z.ZodTypeAny, { + method: "resources/templates/list"; + params?: z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "resources/templates/list"; + params?: z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * The server's response to a resources/templates/list request from the client. + */ +export declare const ListResourceTemplatesResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resourceTemplates: z.ZodArray; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resourceTemplates: z.ZodArray; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resourceTemplates: z.ZodArray; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>; +/** + * Sent from the client to the server, to read a specific resource URI. + */ +export declare const ReadResourceRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"resources/read">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + uri: string; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/read"; +}, { + params: { + uri: string; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/read"; +}>; +/** + * The server's response to a resources/read request from the client. + */ +export declare const ReadResourceResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + contents: z.ZodArray; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + contents: z.ZodArray; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + contents: z.ZodArray; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>, "many">; +}>, z.ZodTypeAny, "passthrough">>; +/** + * An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This may be issued by servers without any previous subscription from the client. + */ +export declare const ResourceListChangedNotificationSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/resources/list_changed">; +}>, "strip", z.ZodTypeAny, { + method: "notifications/resources/list_changed"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "notifications/resources/list_changed"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * Sent from the client to request resources/updated notifications from the server whenever a particular resource changes. + */ +export declare const SubscribeRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"resources/subscribe">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + uri: string; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/subscribe"; +}, { + params: { + uri: string; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/subscribe"; +}>; +/** + * Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request. + */ +export declare const UnsubscribeRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"resources/unsubscribe">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to unsubscribe from. + */ + uri: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to unsubscribe from. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to unsubscribe from. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + uri: string; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/unsubscribe"; +}, { + params: { + uri: string; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/unsubscribe"; +}>; +/** + * A notification from the server to the client, informing it that a resource has changed and may need to be read again. This should only be sent if the client previously sent a resources/subscribe request. + */ +export declare const ResourceUpdatedNotificationSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/resources/updated">; + params: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to. + */ + uri: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + uri: string; + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/resources/updated"; +}, { + params: { + uri: string; + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/resources/updated"; +}>; +/** + * Describes an argument that a prompt can accept. + */ +export declare const PromptArgumentSchema: z.ZodObject<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">>; +/** + * A prompt or prompt template that the server offers. + */ +export declare const PromptSchema: z.ZodObject<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; +}, z.ZodTypeAny, "passthrough">>; +/** + * Sent from the client to request a list of prompts and prompt templates the server has. + */ +export declare const ListPromptsRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>>; +}>, { + method: z.ZodLiteral<"prompts/list">; +}>, "strip", z.ZodTypeAny, { + method: "prompts/list"; + params?: z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "prompts/list"; + params?: z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * The server's response to a prompts/list request from the client. + */ +export declare const ListPromptsResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + prompts: z.ZodArray; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + prompts: z.ZodArray; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + prompts: z.ZodArray; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>; +/** + * Used by the client to get a prompt provided by the server. + */ +export declare const GetPromptRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"prompts/get">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * Arguments to use for templating the prompt. + */ + arguments: z.ZodOptional>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * Arguments to use for templating the prompt. + */ + arguments: z.ZodOptional>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * Arguments to use for templating the prompt. + */ + arguments: z.ZodOptional>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + name: string; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + arguments?: Record | undefined; + } & { + [k: string]: unknown; + }; + method: "prompts/get"; +}, { + params: { + name: string; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + arguments?: Record | undefined; + } & { + [k: string]: unknown; + }; + method: "prompts/get"; +}>; +/** + * Text provided to or from an LLM. + */ +export declare const TextContentSchema: z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; +}, z.ZodTypeAny, "passthrough">>; +/** + * An image provided to or from an LLM. + */ +export declare const ImageContentSchema: z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; +}, z.ZodTypeAny, "passthrough">>; +/** + * An Audio provided to or from an LLM. + */ +export declare const AudioContentSchema: z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; +}, z.ZodTypeAny, "passthrough">>; +/** + * The contents of a resource, embedded into a prompt or tool call result. + */ +export declare const EmbeddedResourceSchema: z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; +}, z.ZodTypeAny, "passthrough">>; +/** + * Describes a message returned as part of a prompt. + */ +export declare const PromptMessageSchema: z.ZodObject<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; +}, z.ZodTypeAny, "passthrough">>; +/** + * The server's response to a prompts/get request from the client. + */ +export declare const GetPromptResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An optional description for the prompt. + */ + description: z.ZodOptional; + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An optional description for the prompt. + */ + description: z.ZodOptional; + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An optional description for the prompt. + */ + description: z.ZodOptional; + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>; +/** + * An optional notification from the server to the client, informing it that the list of prompts it offers has changed. This may be issued by servers without any previous subscription from the client. + */ +export declare const PromptListChangedNotificationSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/prompts/list_changed">; +}>, "strip", z.ZodTypeAny, { + method: "notifications/prompts/list_changed"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "notifications/prompts/list_changed"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * Additional properties describing a Tool to clients. + * + * NOTE: all properties in ToolAnnotations are **hints**. + * They are not guaranteed to provide a faithful description of + * tool behavior (including descriptive properties like `title`). + * + * Clients should never make tool use decisions based on ToolAnnotations + * received from untrusted servers. + */ +export declare const ToolAnnotationsSchema: z.ZodObject<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">>; +/** + * Definition for a tool the client can call. + */ +export declare const ToolSchema: z.ZodObject<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; +}, z.ZodTypeAny, "passthrough">>; +/** + * Sent from the client to request a list of tools the server has. + */ +export declare const ListToolsRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>>; +}>, { + method: z.ZodLiteral<"tools/list">; +}>, "strip", z.ZodTypeAny, { + method: "tools/list"; + params?: z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "tools/list"; + params?: z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * The server's response to a tools/list request from the client. + */ +export declare const ListToolsResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + tools: z.ZodArray; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + tools: z.ZodArray; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + tools: z.ZodArray; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>; +/** + * The server's response to a tool call. + */ +export declare const CallToolResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * A list of content objects that represent the result of the tool call. + * + * If the Tool does not define an outputSchema, this field MUST be present in the result. + * For backwards compatibility, this field is always present, but it may be empty. + */ + content: z.ZodDefault; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>, "many">>; + /** + * An object containing structured tool output. + * + * If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema. + */ + structuredContent: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Whether the tool call ended in an error. + * + * If not set, this is assumed to be false (the call was successful). + * + * Any errors that originate from the tool SHOULD be reported inside the result + * object, with `isError` set to true, _not_ as an MCP protocol-level error + * response. Otherwise, the LLM would not be able to see that an error occurred + * and self-correct. + * + * However, any errors in _finding_ the tool, an error indicating that the + * server does not support tool calls, or any other exceptional conditions, + * should be reported as an MCP error response. + */ + isError: z.ZodOptional; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * A list of content objects that represent the result of the tool call. + * + * If the Tool does not define an outputSchema, this field MUST be present in the result. + * For backwards compatibility, this field is always present, but it may be empty. + */ + content: z.ZodDefault; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>, "many">>; + /** + * An object containing structured tool output. + * + * If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema. + */ + structuredContent: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Whether the tool call ended in an error. + * + * If not set, this is assumed to be false (the call was successful). + * + * Any errors that originate from the tool SHOULD be reported inside the result + * object, with `isError` set to true, _not_ as an MCP protocol-level error + * response. Otherwise, the LLM would not be able to see that an error occurred + * and self-correct. + * + * However, any errors in _finding_ the tool, an error indicating that the + * server does not support tool calls, or any other exceptional conditions, + * should be reported as an MCP error response. + */ + isError: z.ZodOptional; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * A list of content objects that represent the result of the tool call. + * + * If the Tool does not define an outputSchema, this field MUST be present in the result. + * For backwards compatibility, this field is always present, but it may be empty. + */ + content: z.ZodDefault; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>, "many">>; + /** + * An object containing structured tool output. + * + * If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema. + */ + structuredContent: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Whether the tool call ended in an error. + * + * If not set, this is assumed to be false (the call was successful). + * + * Any errors that originate from the tool SHOULD be reported inside the result + * object, with `isError` set to true, _not_ as an MCP protocol-level error + * response. Otherwise, the LLM would not be able to see that an error occurred + * and self-correct. + * + * However, any errors in _finding_ the tool, an error indicating that the + * server does not support tool calls, or any other exceptional conditions, + * should be reported as an MCP error response. + */ + isError: z.ZodOptional; +}>, z.ZodTypeAny, "passthrough">>; +/** + * CallToolResultSchema extended with backwards compatibility to protocol version 2024-10-07. + */ +export declare const CompatibilityCallToolResultSchema: z.ZodUnion<[z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * A list of content objects that represent the result of the tool call. + * + * If the Tool does not define an outputSchema, this field MUST be present in the result. + * For backwards compatibility, this field is always present, but it may be empty. + */ + content: z.ZodDefault; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>, "many">>; + /** + * An object containing structured tool output. + * + * If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema. + */ + structuredContent: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Whether the tool call ended in an error. + * + * If not set, this is assumed to be false (the call was successful). + * + * Any errors that originate from the tool SHOULD be reported inside the result + * object, with `isError` set to true, _not_ as an MCP protocol-level error + * response. Otherwise, the LLM would not be able to see that an error occurred + * and self-correct. + * + * However, any errors in _finding_ the tool, an error indicating that the + * server does not support tool calls, or any other exceptional conditions, + * should be reported as an MCP error response. + */ + isError: z.ZodOptional; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * A list of content objects that represent the result of the tool call. + * + * If the Tool does not define an outputSchema, this field MUST be present in the result. + * For backwards compatibility, this field is always present, but it may be empty. + */ + content: z.ZodDefault; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>, "many">>; + /** + * An object containing structured tool output. + * + * If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema. + */ + structuredContent: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Whether the tool call ended in an error. + * + * If not set, this is assumed to be false (the call was successful). + * + * Any errors that originate from the tool SHOULD be reported inside the result + * object, with `isError` set to true, _not_ as an MCP protocol-level error + * response. Otherwise, the LLM would not be able to see that an error occurred + * and self-correct. + * + * However, any errors in _finding_ the tool, an error indicating that the + * server does not support tool calls, or any other exceptional conditions, + * should be reported as an MCP error response. + */ + isError: z.ZodOptional; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * A list of content objects that represent the result of the tool call. + * + * If the Tool does not define an outputSchema, this field MUST be present in the result. + * For backwards compatibility, this field is always present, but it may be empty. + */ + content: z.ZodDefault; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>, "many">>; + /** + * An object containing structured tool output. + * + * If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema. + */ + structuredContent: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Whether the tool call ended in an error. + * + * If not set, this is assumed to be false (the call was successful). + * + * Any errors that originate from the tool SHOULD be reported inside the result + * object, with `isError` set to true, _not_ as an MCP protocol-level error + * response. Otherwise, the LLM would not be able to see that an error occurred + * and self-correct. + * + * However, any errors in _finding_ the tool, an error indicating that the + * server does not support tool calls, or any other exceptional conditions, + * should be reported as an MCP error response. + */ + isError: z.ZodOptional; +}>, z.ZodTypeAny, "passthrough">>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + toolResult: z.ZodUnknown; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + toolResult: z.ZodUnknown; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + toolResult: z.ZodUnknown; +}>, z.ZodTypeAny, "passthrough">>]>; +/** + * Used by the client to invoke a tool provided by the server. + */ +export declare const CallToolRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"tools/call">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + name: z.ZodString; + arguments: z.ZodOptional>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + name: z.ZodString; + arguments: z.ZodOptional>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + name: z.ZodString; + arguments: z.ZodOptional>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + name: string; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + arguments?: Record | undefined; + } & { + [k: string]: unknown; + }; + method: "tools/call"; +}, { + params: { + name: string; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + arguments?: Record | undefined; + } & { + [k: string]: unknown; + }; + method: "tools/call"; +}>; +/** + * An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client. + */ +export declare const ToolListChangedNotificationSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/tools/list_changed">; +}>, "strip", z.ZodTypeAny, { + method: "notifications/tools/list_changed"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "notifications/tools/list_changed"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * The severity of a log message. + */ +export declare const LoggingLevelSchema: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; +/** + * A request from the client to the server, to enable or adjust logging. + */ +export declare const SetLevelRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"logging/setLevel">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + level: "error" | "debug" | "info" | "notice" | "warning" | "critical" | "alert" | "emergency"; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "logging/setLevel"; +}, { + params: { + level: "error" | "debug" | "info" | "notice" | "warning" | "critical" | "alert" | "emergency"; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "logging/setLevel"; +}>; +/** + * Notification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically. + */ +export declare const LoggingMessageNotificationSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/message">; + params: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The severity of this log message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + /** + * An optional name of the logger issuing this message. + */ + logger: z.ZodOptional; + /** + * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here. + */ + data: z.ZodUnknown; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The severity of this log message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + /** + * An optional name of the logger issuing this message. + */ + logger: z.ZodOptional; + /** + * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here. + */ + data: z.ZodUnknown; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The severity of this log message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + /** + * An optional name of the logger issuing this message. + */ + logger: z.ZodOptional; + /** + * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here. + */ + data: z.ZodUnknown; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + level: "error" | "debug" | "info" | "notice" | "warning" | "critical" | "alert" | "emergency"; + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + data?: unknown; + logger?: string | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/message"; +}, { + params: { + level: "error" | "debug" | "info" | "notice" | "warning" | "critical" | "alert" | "emergency"; + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + data?: unknown; + logger?: string | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/message"; +}>; +/** + * Hints to use for model selection. + */ +export declare const ModelHintSchema: z.ZodObject<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">>; +/** + * The server's preferences for model selection, requested of the client during sampling. + */ +export declare const ModelPreferencesSchema: z.ZodObject<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">>; +/** + * Describes a message issued to or received from an LLM API. + */ +export declare const SamplingMessageSchema: z.ZodObject<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; +}, z.ZodTypeAny, "passthrough">>; +/** + * A request from the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it. + */ +export declare const CreateMessageRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"sampling/createMessage">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; + /** + * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt. + */ + systemPrompt: z.ZodOptional; + /** + * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request. + */ + includeContext: z.ZodOptional>; + temperature: z.ZodOptional; + /** + * The maximum number of tokens to sample, as requested by the server. The client MAY choose to sample fewer tokens than requested. + */ + maxTokens: z.ZodNumber; + stopSequences: z.ZodOptional>; + /** + * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific. + */ + metadata: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * The server's preferences for which model to select. + */ + modelPreferences: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; + /** + * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt. + */ + systemPrompt: z.ZodOptional; + /** + * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request. + */ + includeContext: z.ZodOptional>; + temperature: z.ZodOptional; + /** + * The maximum number of tokens to sample, as requested by the server. The client MAY choose to sample fewer tokens than requested. + */ + maxTokens: z.ZodNumber; + stopSequences: z.ZodOptional>; + /** + * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific. + */ + metadata: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * The server's preferences for which model to select. + */ + modelPreferences: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; + /** + * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt. + */ + systemPrompt: z.ZodOptional; + /** + * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request. + */ + includeContext: z.ZodOptional>; + temperature: z.ZodOptional; + /** + * The maximum number of tokens to sample, as requested by the server. The client MAY choose to sample fewer tokens than requested. + */ + maxTokens: z.ZodNumber; + stopSequences: z.ZodOptional>; + /** + * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific. + */ + metadata: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * The server's preferences for which model to select. + */ + modelPreferences: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + messages: z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">[]; + maxTokens: number; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + systemPrompt?: string | undefined; + includeContext?: "none" | "thisServer" | "allServers" | undefined; + temperature?: number | undefined; + stopSequences?: string[] | undefined; + metadata?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + modelPreferences?: z.objectOutputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "sampling/createMessage"; +}, { + params: { + messages: z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">[]; + maxTokens: number; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + systemPrompt?: string | undefined; + includeContext?: "none" | "thisServer" | "allServers" | undefined; + temperature?: number | undefined; + stopSequences?: string[] | undefined; + metadata?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + modelPreferences?: z.objectInputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "sampling/createMessage"; +}>; +/** + * The client's response to a sampling/create_message request from the server. The client should inform the user before returning the sampled message, to allow them to inspect the response (human in the loop) and decide whether to allow the server to see it. + */ +export declare const CreateMessageResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The name of the model that generated the message. + */ + model: z.ZodString; + /** + * The reason why sampling stopped. + */ + stopReason: z.ZodOptional, z.ZodString]>>; + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The name of the model that generated the message. + */ + model: z.ZodString; + /** + * The reason why sampling stopped. + */ + stopReason: z.ZodOptional, z.ZodString]>>; + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The name of the model that generated the message. + */ + model: z.ZodString; + /** + * The reason why sampling stopped. + */ + stopReason: z.ZodOptional, z.ZodString]>>; + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; +}>, z.ZodTypeAny, "passthrough">>; +/** + * A reference to a resource or resource template definition. + */ +export declare const ResourceReferenceSchema: z.ZodObject<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; +}, z.ZodTypeAny, "passthrough">>; +/** + * Identifies a prompt. + */ +export declare const PromptReferenceSchema: z.ZodObject<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; +}, z.ZodTypeAny, "passthrough">>; +/** + * A request from the client to the server, to ask for completion options. + */ +export declare const CompleteRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"completion/complete">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + ref: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + /** + * The argument's information + */ + argument: z.ZodObject<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + ref: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + /** + * The argument's information + */ + argument: z.ZodObject<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + ref: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + /** + * The argument's information + */ + argument: z.ZodObject<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + ref: z.objectOutputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">; + argument: { + value: string; + name: string; + } & { + [k: string]: unknown; + }; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "completion/complete"; +}, { + params: { + ref: z.objectInputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough"> | z.objectInputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">; + argument: { + value: string; + name: string; + } & { + [k: string]: unknown; + }; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "completion/complete"; +}>; +/** + * The server's response to a completion/complete request + */ +export declare const CompleteResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + completion: z.ZodObject<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + completion: z.ZodObject<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + completion: z.ZodObject<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>; +}>, z.ZodTypeAny, "passthrough">>; +/** + * Represents a root directory or file that the server can operate on. + */ +export declare const RootSchema: z.ZodObject<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">>; +/** + * Sent from the server to request a list of root URIs from the client. + */ +export declare const ListRootsRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"roots/list">; +}>, "strip", z.ZodTypeAny, { + method: "roots/list"; + params?: z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "roots/list"; + params?: z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * The client's response to a roots/list request from the server. + */ +export declare const ListRootsResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + roots: z.ZodArray; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + roots: z.ZodArray; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + roots: z.ZodArray; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>; +/** + * A notification from the client to the server, informing it that the list of roots has changed. + */ +export declare const RootsListChangedNotificationSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/roots/list_changed">; +}>, "strip", z.ZodTypeAny, { + method: "notifications/roots/list_changed"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "notifications/roots/list_changed"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +export declare const ClientRequestSchema: z.ZodUnion<[z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"ping">; +}>, "strip", z.ZodTypeAny, { + method: "ping"; + params?: z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "ping"; + params?: z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"initialize">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + clientInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + clientInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + clientInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + protocolVersion: string; + capabilities: { + experimental?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + sampling?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + roots?: z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + clientInfo: { + name: string; + version: string; + } & { + [k: string]: unknown; + }; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "initialize"; +}, { + params: { + protocolVersion: string; + capabilities: { + experimental?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + sampling?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + roots?: z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + clientInfo: { + name: string; + version: string; + } & { + [k: string]: unknown; + }; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "initialize"; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"completion/complete">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + ref: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + /** + * The argument's information + */ + argument: z.ZodObject<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + ref: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + /** + * The argument's information + */ + argument: z.ZodObject<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + ref: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + /** + * The argument's information + */ + argument: z.ZodObject<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + ref: z.objectOutputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">; + argument: { + value: string; + name: string; + } & { + [k: string]: unknown; + }; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "completion/complete"; +}, { + params: { + ref: z.objectInputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough"> | z.objectInputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">; + argument: { + value: string; + name: string; + } & { + [k: string]: unknown; + }; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "completion/complete"; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"logging/setLevel">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + level: "error" | "debug" | "info" | "notice" | "warning" | "critical" | "alert" | "emergency"; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "logging/setLevel"; +}, { + params: { + level: "error" | "debug" | "info" | "notice" | "warning" | "critical" | "alert" | "emergency"; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "logging/setLevel"; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"prompts/get">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * Arguments to use for templating the prompt. + */ + arguments: z.ZodOptional>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * Arguments to use for templating the prompt. + */ + arguments: z.ZodOptional>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * Arguments to use for templating the prompt. + */ + arguments: z.ZodOptional>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + name: string; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + arguments?: Record | undefined; + } & { + [k: string]: unknown; + }; + method: "prompts/get"; +}, { + params: { + name: string; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + arguments?: Record | undefined; + } & { + [k: string]: unknown; + }; + method: "prompts/get"; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>>; +}>, { + method: z.ZodLiteral<"prompts/list">; +}>, "strip", z.ZodTypeAny, { + method: "prompts/list"; + params?: z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "prompts/list"; + params?: z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>>; +}>, { + method: z.ZodLiteral<"resources/list">; +}>, "strip", z.ZodTypeAny, { + method: "resources/list"; + params?: z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "resources/list"; + params?: z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>>; +}>, { + method: z.ZodLiteral<"resources/templates/list">; +}>, "strip", z.ZodTypeAny, { + method: "resources/templates/list"; + params?: z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "resources/templates/list"; + params?: z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"resources/read">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + uri: string; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/read"; +}, { + params: { + uri: string; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/read"; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"resources/subscribe">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + uri: string; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/subscribe"; +}, { + params: { + uri: string; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/subscribe"; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"resources/unsubscribe">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to unsubscribe from. + */ + uri: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to unsubscribe from. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to unsubscribe from. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + uri: string; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/unsubscribe"; +}, { + params: { + uri: string; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/unsubscribe"; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"tools/call">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + name: z.ZodString; + arguments: z.ZodOptional>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + name: z.ZodString; + arguments: z.ZodOptional>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + name: z.ZodString; + arguments: z.ZodOptional>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + name: string; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + arguments?: Record | undefined; + } & { + [k: string]: unknown; + }; + method: "tools/call"; +}, { + params: { + name: string; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + arguments?: Record | undefined; + } & { + [k: string]: unknown; + }; + method: "tools/call"; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>>; +}>, { + method: z.ZodLiteral<"tools/list">; +}>, "strip", z.ZodTypeAny, { + method: "tools/list"; + params?: z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "tools/list"; + params?: z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}>]>; +export declare const ClientNotificationSchema: z.ZodUnion<[z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/cancelled">; + params: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The ID of the request to cancel. + * + * This MUST correspond to the ID of a request previously issued in the same direction. + */ + requestId: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + /** + * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. + */ + reason: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The ID of the request to cancel. + * + * This MUST correspond to the ID of a request previously issued in the same direction. + */ + requestId: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + /** + * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. + */ + reason: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The ID of the request to cancel. + * + * This MUST correspond to the ID of a request previously issued in the same direction. + */ + requestId: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + /** + * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. + */ + reason: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + requestId: string | number; + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + reason?: string | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/cancelled"; +}, { + params: { + requestId: string | number; + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + reason?: string | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/cancelled"; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/progress">; + params: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + /** + * An optional message describing the current progress. + */ + message: z.ZodOptional; + }>, { + /** + * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. + */ + progressToken: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + /** + * An optional message describing the current progress. + */ + message: z.ZodOptional; + }>, { + /** + * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. + */ + progressToken: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + /** + * An optional message describing the current progress. + */ + message: z.ZodOptional; + }>, { + /** + * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. + */ + progressToken: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + progressToken: string | number; + progress: number; + message?: string | undefined; + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + total?: number | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/progress"; +}, { + params: { + progressToken: string | number; + progress: number; + message?: string | undefined; + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + total?: number | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/progress"; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/initialized">; +}>, "strip", z.ZodTypeAny, { + method: "notifications/initialized"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "notifications/initialized"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/roots/list_changed">; +}>, "strip", z.ZodTypeAny, { + method: "notifications/roots/list_changed"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "notifications/roots/list_changed"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>]>; +export declare const ClientResultSchema: z.ZodUnion<[z.ZodObject<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, "strict", z.ZodTypeAny, { + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; +}, { + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The name of the model that generated the message. + */ + model: z.ZodString; + /** + * The reason why sampling stopped. + */ + stopReason: z.ZodOptional, z.ZodString]>>; + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The name of the model that generated the message. + */ + model: z.ZodString; + /** + * The reason why sampling stopped. + */ + stopReason: z.ZodOptional, z.ZodString]>>; + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The name of the model that generated the message. + */ + model: z.ZodString; + /** + * The reason why sampling stopped. + */ + stopReason: z.ZodOptional, z.ZodString]>>; + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; +}>, z.ZodTypeAny, "passthrough">>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + roots: z.ZodArray; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + roots: z.ZodArray; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + roots: z.ZodArray; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>]>; +export declare const ServerRequestSchema: z.ZodUnion<[z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"ping">; +}>, "strip", z.ZodTypeAny, { + method: "ping"; + params?: z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "ping"; + params?: z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"sampling/createMessage">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; + /** + * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt. + */ + systemPrompt: z.ZodOptional; + /** + * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request. + */ + includeContext: z.ZodOptional>; + temperature: z.ZodOptional; + /** + * The maximum number of tokens to sample, as requested by the server. The client MAY choose to sample fewer tokens than requested. + */ + maxTokens: z.ZodNumber; + stopSequences: z.ZodOptional>; + /** + * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific. + */ + metadata: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * The server's preferences for which model to select. + */ + modelPreferences: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; + /** + * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt. + */ + systemPrompt: z.ZodOptional; + /** + * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request. + */ + includeContext: z.ZodOptional>; + temperature: z.ZodOptional; + /** + * The maximum number of tokens to sample, as requested by the server. The client MAY choose to sample fewer tokens than requested. + */ + maxTokens: z.ZodNumber; + stopSequences: z.ZodOptional>; + /** + * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific. + */ + metadata: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * The server's preferences for which model to select. + */ + modelPreferences: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; + /** + * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt. + */ + systemPrompt: z.ZodOptional; + /** + * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request. + */ + includeContext: z.ZodOptional>; + temperature: z.ZodOptional; + /** + * The maximum number of tokens to sample, as requested by the server. The client MAY choose to sample fewer tokens than requested. + */ + maxTokens: z.ZodNumber; + stopSequences: z.ZodOptional>; + /** + * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific. + */ + metadata: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * The server's preferences for which model to select. + */ + modelPreferences: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + messages: z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">[]; + maxTokens: number; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + systemPrompt?: string | undefined; + includeContext?: "none" | "thisServer" | "allServers" | undefined; + temperature?: number | undefined; + stopSequences?: string[] | undefined; + metadata?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + modelPreferences?: z.objectOutputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "sampling/createMessage"; +}, { + params: { + messages: z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">[]; + maxTokens: number; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + systemPrompt?: string | undefined; + includeContext?: "none" | "thisServer" | "allServers" | undefined; + temperature?: number | undefined; + stopSequences?: string[] | undefined; + metadata?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + modelPreferences?: z.objectInputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "sampling/createMessage"; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"roots/list">; +}>, "strip", z.ZodTypeAny, { + method: "roots/list"; + params?: z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "roots/list"; + params?: z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>]>; +export declare const ServerNotificationSchema: z.ZodUnion<[z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/cancelled">; + params: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The ID of the request to cancel. + * + * This MUST correspond to the ID of a request previously issued in the same direction. + */ + requestId: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + /** + * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. + */ + reason: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The ID of the request to cancel. + * + * This MUST correspond to the ID of a request previously issued in the same direction. + */ + requestId: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + /** + * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. + */ + reason: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The ID of the request to cancel. + * + * This MUST correspond to the ID of a request previously issued in the same direction. + */ + requestId: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + /** + * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. + */ + reason: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + requestId: string | number; + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + reason?: string | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/cancelled"; +}, { + params: { + requestId: string | number; + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + reason?: string | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/cancelled"; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/progress">; + params: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + /** + * An optional message describing the current progress. + */ + message: z.ZodOptional; + }>, { + /** + * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. + */ + progressToken: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + /** + * An optional message describing the current progress. + */ + message: z.ZodOptional; + }>, { + /** + * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. + */ + progressToken: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + /** + * An optional message describing the current progress. + */ + message: z.ZodOptional; + }>, { + /** + * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. + */ + progressToken: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + progressToken: string | number; + progress: number; + message?: string | undefined; + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + total?: number | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/progress"; +}, { + params: { + progressToken: string | number; + progress: number; + message?: string | undefined; + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + total?: number | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/progress"; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/message">; + params: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The severity of this log message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + /** + * An optional name of the logger issuing this message. + */ + logger: z.ZodOptional; + /** + * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here. + */ + data: z.ZodUnknown; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The severity of this log message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + /** + * An optional name of the logger issuing this message. + */ + logger: z.ZodOptional; + /** + * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here. + */ + data: z.ZodUnknown; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The severity of this log message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + /** + * An optional name of the logger issuing this message. + */ + logger: z.ZodOptional; + /** + * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here. + */ + data: z.ZodUnknown; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + level: "error" | "debug" | "info" | "notice" | "warning" | "critical" | "alert" | "emergency"; + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + data?: unknown; + logger?: string | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/message"; +}, { + params: { + level: "error" | "debug" | "info" | "notice" | "warning" | "critical" | "alert" | "emergency"; + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + data?: unknown; + logger?: string | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/message"; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/resources/updated">; + params: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to. + */ + uri: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + uri: string; + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/resources/updated"; +}, { + params: { + uri: string; + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/resources/updated"; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/resources/list_changed">; +}>, "strip", z.ZodTypeAny, { + method: "notifications/resources/list_changed"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "notifications/resources/list_changed"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/tools/list_changed">; +}>, "strip", z.ZodTypeAny, { + method: "notifications/tools/list_changed"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "notifications/tools/list_changed"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/prompts/list_changed">; +}>, "strip", z.ZodTypeAny, { + method: "notifications/prompts/list_changed"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "notifications/prompts/list_changed"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>]>; +export declare const ServerResultSchema: z.ZodUnion<[z.ZodObject<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, "strict", z.ZodTypeAny, { + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; +}, { + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + serverInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + /** + * Instructions describing how to use the server and its features. + * + * This can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a "hint" to the model. For example, this information MAY be added to the system prompt. + */ + instructions: z.ZodOptional; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + serverInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + /** + * Instructions describing how to use the server and its features. + * + * This can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a "hint" to the model. For example, this information MAY be added to the system prompt. + */ + instructions: z.ZodOptional; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + serverInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + /** + * Instructions describing how to use the server and its features. + * + * This can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a "hint" to the model. For example, this information MAY be added to the system prompt. + */ + instructions: z.ZodOptional; +}>, z.ZodTypeAny, "passthrough">>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + completion: z.ZodObject<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + completion: z.ZodObject<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + completion: z.ZodObject<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>; +}>, z.ZodTypeAny, "passthrough">>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An optional description for the prompt. + */ + description: z.ZodOptional; + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An optional description for the prompt. + */ + description: z.ZodOptional; + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An optional description for the prompt. + */ + description: z.ZodOptional; + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + prompts: z.ZodArray; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + prompts: z.ZodArray; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + prompts: z.ZodArray; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resources: z.ZodArray; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resources: z.ZodArray; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resources: z.ZodArray; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resourceTemplates: z.ZodArray; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resourceTemplates: z.ZodArray; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resourceTemplates: z.ZodArray; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + contents: z.ZodArray; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + contents: z.ZodArray; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + contents: z.ZodArray; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>, "many">; +}>, z.ZodTypeAny, "passthrough">>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * A list of content objects that represent the result of the tool call. + * + * If the Tool does not define an outputSchema, this field MUST be present in the result. + * For backwards compatibility, this field is always present, but it may be empty. + */ + content: z.ZodDefault; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>, "many">>; + /** + * An object containing structured tool output. + * + * If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema. + */ + structuredContent: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Whether the tool call ended in an error. + * + * If not set, this is assumed to be false (the call was successful). + * + * Any errors that originate from the tool SHOULD be reported inside the result + * object, with `isError` set to true, _not_ as an MCP protocol-level error + * response. Otherwise, the LLM would not be able to see that an error occurred + * and self-correct. + * + * However, any errors in _finding_ the tool, an error indicating that the + * server does not support tool calls, or any other exceptional conditions, + * should be reported as an MCP error response. + */ + isError: z.ZodOptional; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * A list of content objects that represent the result of the tool call. + * + * If the Tool does not define an outputSchema, this field MUST be present in the result. + * For backwards compatibility, this field is always present, but it may be empty. + */ + content: z.ZodDefault; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>, "many">>; + /** + * An object containing structured tool output. + * + * If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema. + */ + structuredContent: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Whether the tool call ended in an error. + * + * If not set, this is assumed to be false (the call was successful). + * + * Any errors that originate from the tool SHOULD be reported inside the result + * object, with `isError` set to true, _not_ as an MCP protocol-level error + * response. Otherwise, the LLM would not be able to see that an error occurred + * and self-correct. + * + * However, any errors in _finding_ the tool, an error indicating that the + * server does not support tool calls, or any other exceptional conditions, + * should be reported as an MCP error response. + */ + isError: z.ZodOptional; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * A list of content objects that represent the result of the tool call. + * + * If the Tool does not define an outputSchema, this field MUST be present in the result. + * For backwards compatibility, this field is always present, but it may be empty. + */ + content: z.ZodDefault; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>, "many">>; + /** + * An object containing structured tool output. + * + * If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema. + */ + structuredContent: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Whether the tool call ended in an error. + * + * If not set, this is assumed to be false (the call was successful). + * + * Any errors that originate from the tool SHOULD be reported inside the result + * object, with `isError` set to true, _not_ as an MCP protocol-level error + * response. Otherwise, the LLM would not be able to see that an error occurred + * and self-correct. + * + * However, any errors in _finding_ the tool, an error indicating that the + * server does not support tool calls, or any other exceptional conditions, + * should be reported as an MCP error response. + */ + isError: z.ZodOptional; +}>, z.ZodTypeAny, "passthrough">>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + tools: z.ZodArray; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + tools: z.ZodArray; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + tools: z.ZodArray; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>]>; +export declare class McpError extends Error { + readonly code: number; + readonly data?: unknown; + constructor(code: number, message: string, data?: unknown); +} +type Primitive = string | number | boolean | bigint | null | undefined; +type Flatten = T extends Primitive ? T : T extends Array ? Array> : T extends Set ? Set> : T extends Map ? Map, Flatten> : T extends object ? { + [K in keyof T]: Flatten; +} : T; +type Infer = Flatten>; +export type ProgressToken = Infer; +export type Cursor = Infer; +export type Request = Infer; +export type RequestMeta = Infer; +export type Notification = Infer; +export type Result = Infer; +export type RequestId = Infer; +export type JSONRPCRequest = Infer; +export type JSONRPCNotification = Infer; +export type JSONRPCResponse = Infer; +export type JSONRPCError = Infer; +export type JSONRPCMessage = Infer; +export type EmptyResult = Infer; +export type CancelledNotification = Infer; +export type Implementation = Infer; +export type ClientCapabilities = Infer; +export type InitializeRequest = Infer; +export type ServerCapabilities = Infer; +export type InitializeResult = Infer; +export type InitializedNotification = Infer; +export type PingRequest = Infer; +export type Progress = Infer; +export type ProgressNotification = Infer; +export type PaginatedRequest = Infer; +export type PaginatedResult = Infer; +export type ResourceContents = Infer; +export type TextResourceContents = Infer; +export type BlobResourceContents = Infer; +export type Resource = Infer; +export type ResourceTemplate = Infer; +export type ListResourcesRequest = Infer; +export type ListResourcesResult = Infer; +export type ListResourceTemplatesRequest = Infer; +export type ListResourceTemplatesResult = Infer; +export type ReadResourceRequest = Infer; +export type ReadResourceResult = Infer; +export type ResourceListChangedNotification = Infer; +export type SubscribeRequest = Infer; +export type UnsubscribeRequest = Infer; +export type ResourceUpdatedNotification = Infer; +export type PromptArgument = Infer; +export type Prompt = Infer; +export type ListPromptsRequest = Infer; +export type ListPromptsResult = Infer; +export type GetPromptRequest = Infer; +export type TextContent = Infer; +export type ImageContent = Infer; +export type AudioContent = Infer; +export type EmbeddedResource = Infer; +export type PromptMessage = Infer; +export type GetPromptResult = Infer; +export type PromptListChangedNotification = Infer; +export type ToolAnnotations = Infer; +export type Tool = Infer; +export type ListToolsRequest = Infer; +export type ListToolsResult = Infer; +export type CallToolResult = Infer; +export type CompatibilityCallToolResult = Infer; +export type CallToolRequest = Infer; +export type ToolListChangedNotification = Infer; +export type LoggingLevel = Infer; +export type SetLevelRequest = Infer; +export type LoggingMessageNotification = Infer; +export type SamplingMessage = Infer; +export type CreateMessageRequest = Infer; +export type CreateMessageResult = Infer; +export type ResourceReference = Infer; +export type PromptReference = Infer; +export type CompleteRequest = Infer; +export type CompleteResult = Infer; +export type Root = Infer; +export type ListRootsRequest = Infer; +export type ListRootsResult = Infer; +export type RootsListChangedNotification = Infer; +export type ClientRequest = Infer; +export type ClientNotification = Infer; +export type ClientResult = Infer; +export type ServerRequest = Infer; +export type ServerNotification = Infer; +export type ServerResult = Infer; +export {}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/types.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/types.d.ts.map new file mode 100644 index 0000000000..4abffb003c --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAEpC,eAAO,MAAM,uBAAuB,eAAe,CAAC;AACpD,eAAO,MAAM,2BAA2B,UAIvC,CAAC;AAGF,eAAO,MAAM,eAAe,QAAQ,CAAC;AAErC;;GAEG;AACH,eAAO,MAAM,mBAAmB,wCAA0C,CAAC;AAE3E;;GAEG;AACH,eAAO,MAAM,YAAY,aAAa,CAAC;AAEvC,QAAA,MAAM,iBAAiB;IAEnB;;OAEG;;;IAFH;;OAEG;;;IAFH;;OAEG;;gCAGS,CAAC;AAQjB,eAAO,MAAM,aAAa;;;;YAbtB;;eAEG;;;YAFH;;eAEG;;;YAFH;;eAEG;;;;;YAFH;;eAEG;;;YAFH;;eAEG;;;YAFH;;eAEG;;;;;YAFH;;eAEG;;;YAFH;;eAEG;;;YAFH;;eAEG;;;;;;;;YAFH;;eAEG;;;YAFH;;eAEG;;;YAFH;;eAEG;;;;;;;;YAFH;;eAEG;;;YAFH;;eAEG;;;YAFH;;eAEG;;;;EAcL,CAAC;AAWH,eAAO,MAAM,kBAAkB;;;QAP3B;;WAEG;;;QAFH;;WAEG;;;QAFH;;WAEG;;;;;;QAFH;;WAEG;;;;;;QAFH;;WAEG;;;EAQL,CAAC;AAEH,eAAO,MAAM,YAAY;IAErB;;OAEG;;;IAFH;;OAEG;;;IAFH;;OAEG;;gCAGS,CAAC;AAEjB;;GAEG;AACH,eAAO,MAAM,eAAe,wCAA0C,CAAC;AAEvE;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;YAjD7B;;eAEG;;;YAFH;;eAEG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CAAC;AAClE,MAAM,MAAM,4BAA4B,GAAG,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAG5F,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAC9D,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AACxE,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAG5D,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAC9D,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AACxE,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/types.js b/front_end/third_party/mcp-sdk/ajv/dist/cjs/types.js new file mode 100644 index 0000000000..a5fd212798 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/types.js @@ -0,0 +1,1146 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PromptArgumentSchema = exports.ResourceUpdatedNotificationSchema = exports.UnsubscribeRequestSchema = exports.SubscribeRequestSchema = exports.ResourceListChangedNotificationSchema = exports.ReadResourceResultSchema = exports.ReadResourceRequestSchema = exports.ListResourceTemplatesResultSchema = exports.ListResourceTemplatesRequestSchema = exports.ListResourcesResultSchema = exports.ListResourcesRequestSchema = exports.ResourceTemplateSchema = exports.ResourceSchema = exports.BlobResourceContentsSchema = exports.TextResourceContentsSchema = exports.ResourceContentsSchema = exports.PaginatedResultSchema = exports.PaginatedRequestSchema = exports.ProgressNotificationSchema = exports.ProgressSchema = exports.PingRequestSchema = exports.isInitializedNotification = exports.InitializedNotificationSchema = exports.InitializeResultSchema = exports.ServerCapabilitiesSchema = exports.isInitializeRequest = exports.InitializeRequestSchema = exports.ClientCapabilitiesSchema = exports.ImplementationSchema = exports.CancelledNotificationSchema = exports.EmptyResultSchema = exports.JSONRPCMessageSchema = exports.isJSONRPCError = exports.JSONRPCErrorSchema = exports.ErrorCode = exports.isJSONRPCResponse = exports.JSONRPCResponseSchema = exports.isJSONRPCNotification = exports.JSONRPCNotificationSchema = exports.isJSONRPCRequest = exports.JSONRPCRequestSchema = exports.RequestIdSchema = exports.ResultSchema = exports.NotificationSchema = exports.RequestSchema = exports.CursorSchema = exports.ProgressTokenSchema = exports.JSONRPC_VERSION = exports.SUPPORTED_PROTOCOL_VERSIONS = exports.LATEST_PROTOCOL_VERSION = void 0; +exports.McpError = exports.ServerResultSchema = exports.ServerNotificationSchema = exports.ServerRequestSchema = exports.ClientResultSchema = exports.ClientNotificationSchema = exports.ClientRequestSchema = exports.RootsListChangedNotificationSchema = exports.ListRootsResultSchema = exports.ListRootsRequestSchema = exports.RootSchema = exports.CompleteResultSchema = exports.CompleteRequestSchema = exports.PromptReferenceSchema = exports.ResourceReferenceSchema = exports.CreateMessageResultSchema = exports.CreateMessageRequestSchema = exports.SamplingMessageSchema = exports.ModelPreferencesSchema = exports.ModelHintSchema = exports.LoggingMessageNotificationSchema = exports.SetLevelRequestSchema = exports.LoggingLevelSchema = exports.ToolListChangedNotificationSchema = exports.CallToolRequestSchema = exports.CompatibilityCallToolResultSchema = exports.CallToolResultSchema = exports.ListToolsResultSchema = exports.ListToolsRequestSchema = exports.ToolSchema = exports.ToolAnnotationsSchema = exports.PromptListChangedNotificationSchema = exports.GetPromptResultSchema = exports.PromptMessageSchema = exports.EmbeddedResourceSchema = exports.AudioContentSchema = exports.ImageContentSchema = exports.TextContentSchema = exports.GetPromptRequestSchema = exports.ListPromptsResultSchema = exports.ListPromptsRequestSchema = exports.PromptSchema = void 0; +const zod_1 = require("zod"); +exports.LATEST_PROTOCOL_VERSION = "2025-03-26"; +exports.SUPPORTED_PROTOCOL_VERSIONS = [ + exports.LATEST_PROTOCOL_VERSION, + "2024-11-05", + "2024-10-07", +]; +/* JSON-RPC types */ +exports.JSONRPC_VERSION = "2.0"; +/** + * A progress token, used to associate progress notifications with the original request. + */ +exports.ProgressTokenSchema = zod_1.z.union([zod_1.z.string(), zod_1.z.number().int()]); +/** + * An opaque token used to represent a cursor for pagination. + */ +exports.CursorSchema = zod_1.z.string(); +const RequestMetaSchema = zod_1.z + .object({ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: zod_1.z.optional(exports.ProgressTokenSchema), +}) + .passthrough(); +const BaseRequestParamsSchema = zod_1.z + .object({ + _meta: zod_1.z.optional(RequestMetaSchema), +}) + .passthrough(); +exports.RequestSchema = zod_1.z.object({ + method: zod_1.z.string(), + params: zod_1.z.optional(BaseRequestParamsSchema), +}); +const BaseNotificationParamsSchema = zod_1.z + .object({ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: zod_1.z.optional(zod_1.z.object({}).passthrough()), +}) + .passthrough(); +exports.NotificationSchema = zod_1.z.object({ + method: zod_1.z.string(), + params: zod_1.z.optional(BaseNotificationParamsSchema), +}); +exports.ResultSchema = zod_1.z + .object({ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: zod_1.z.optional(zod_1.z.object({}).passthrough()), +}) + .passthrough(); +/** + * A uniquely identifying ID for a request in JSON-RPC. + */ +exports.RequestIdSchema = zod_1.z.union([zod_1.z.string(), zod_1.z.number().int()]); +/** + * A request that expects a response. + */ +exports.JSONRPCRequestSchema = zod_1.z + .object({ + jsonrpc: zod_1.z.literal(exports.JSONRPC_VERSION), + id: exports.RequestIdSchema, +}) + .merge(exports.RequestSchema) + .strict(); +const isJSONRPCRequest = (value) => exports.JSONRPCRequestSchema.safeParse(value).success; +exports.isJSONRPCRequest = isJSONRPCRequest; +/** + * A notification which does not expect a response. + */ +exports.JSONRPCNotificationSchema = zod_1.z + .object({ + jsonrpc: zod_1.z.literal(exports.JSONRPC_VERSION), +}) + .merge(exports.NotificationSchema) + .strict(); +const isJSONRPCNotification = (value) => exports.JSONRPCNotificationSchema.safeParse(value).success; +exports.isJSONRPCNotification = isJSONRPCNotification; +/** + * A successful (non-error) response to a request. + */ +exports.JSONRPCResponseSchema = zod_1.z + .object({ + jsonrpc: zod_1.z.literal(exports.JSONRPC_VERSION), + id: exports.RequestIdSchema, + result: exports.ResultSchema, +}) + .strict(); +const isJSONRPCResponse = (value) => exports.JSONRPCResponseSchema.safeParse(value).success; +exports.isJSONRPCResponse = isJSONRPCResponse; +/** + * Error codes defined by the JSON-RPC specification. + */ +var ErrorCode; +(function (ErrorCode) { + // SDK error codes + ErrorCode[ErrorCode["ConnectionClosed"] = -32000] = "ConnectionClosed"; + ErrorCode[ErrorCode["RequestTimeout"] = -32001] = "RequestTimeout"; + // Standard JSON-RPC error codes + ErrorCode[ErrorCode["ParseError"] = -32700] = "ParseError"; + ErrorCode[ErrorCode["InvalidRequest"] = -32600] = "InvalidRequest"; + ErrorCode[ErrorCode["MethodNotFound"] = -32601] = "MethodNotFound"; + ErrorCode[ErrorCode["InvalidParams"] = -32602] = "InvalidParams"; + ErrorCode[ErrorCode["InternalError"] = -32603] = "InternalError"; +})(ErrorCode || (exports.ErrorCode = ErrorCode = {})); +/** + * A response to a request that indicates an error occurred. + */ +exports.JSONRPCErrorSchema = zod_1.z + .object({ + jsonrpc: zod_1.z.literal(exports.JSONRPC_VERSION), + id: exports.RequestIdSchema, + error: zod_1.z.object({ + /** + * The error type that occurred. + */ + code: zod_1.z.number().int(), + /** + * A short description of the error. The message SHOULD be limited to a concise single sentence. + */ + message: zod_1.z.string(), + /** + * Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.). + */ + data: zod_1.z.optional(zod_1.z.unknown()), + }), +}) + .strict(); +const isJSONRPCError = (value) => exports.JSONRPCErrorSchema.safeParse(value).success; +exports.isJSONRPCError = isJSONRPCError; +exports.JSONRPCMessageSchema = zod_1.z.union([ + exports.JSONRPCRequestSchema, + exports.JSONRPCNotificationSchema, + exports.JSONRPCResponseSchema, + exports.JSONRPCErrorSchema, +]); +/* Empty result */ +/** + * A response that indicates success but carries no data. + */ +exports.EmptyResultSchema = exports.ResultSchema.strict(); +/* Cancellation */ +/** + * This notification can be sent by either side to indicate that it is cancelling a previously-issued request. + * + * The request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished. + * + * This notification indicates that the result will be unused, so any associated processing SHOULD cease. + * + * A client MUST NOT attempt to cancel its `initialize` request. + */ +exports.CancelledNotificationSchema = exports.NotificationSchema.extend({ + method: zod_1.z.literal("notifications/cancelled"), + params: BaseNotificationParamsSchema.extend({ + /** + * The ID of the request to cancel. + * + * This MUST correspond to the ID of a request previously issued in the same direction. + */ + requestId: exports.RequestIdSchema, + /** + * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. + */ + reason: zod_1.z.string().optional(), + }), +}); +/* Initialization */ +/** + * Describes the name and version of an MCP implementation. + */ +exports.ImplementationSchema = zod_1.z + .object({ + name: zod_1.z.string(), + version: zod_1.z.string(), +}) + .passthrough(); +/** + * Capabilities a client may support. Known capabilities are defined here, in this schema, but this is not a closed set: any client can define its own, additional capabilities. + */ +exports.ClientCapabilitiesSchema = zod_1.z + .object({ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: zod_1.z.optional(zod_1.z.object({}).passthrough()), + /** + * Present if the client supports sampling from an LLM. + */ + sampling: zod_1.z.optional(zod_1.z.object({}).passthrough()), + /** + * Present if the client supports listing roots. + */ + roots: zod_1.z.optional(zod_1.z + .object({ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: zod_1.z.optional(zod_1.z.boolean()), + }) + .passthrough()), +}) + .passthrough(); +/** + * This request is sent from the client to the server when it first connects, asking it to begin initialization. + */ +exports.InitializeRequestSchema = exports.RequestSchema.extend({ + method: zod_1.z.literal("initialize"), + params: BaseRequestParamsSchema.extend({ + /** + * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well. + */ + protocolVersion: zod_1.z.string(), + capabilities: exports.ClientCapabilitiesSchema, + clientInfo: exports.ImplementationSchema, + }), +}); +const isInitializeRequest = (value) => exports.InitializeRequestSchema.safeParse(value).success; +exports.isInitializeRequest = isInitializeRequest; +/** + * Capabilities that a server may support. Known capabilities are defined here, in this schema, but this is not a closed set: any server can define its own, additional capabilities. + */ +exports.ServerCapabilitiesSchema = zod_1.z + .object({ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: zod_1.z.optional(zod_1.z.object({}).passthrough()), + /** + * Present if the server supports sending log messages to the client. + */ + logging: zod_1.z.optional(zod_1.z.object({}).passthrough()), + /** + * Present if the server supports sending completions to the client. + */ + completions: zod_1.z.optional(zod_1.z.object({}).passthrough()), + /** + * Present if the server offers any prompt templates. + */ + prompts: zod_1.z.optional(zod_1.z + .object({ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: zod_1.z.optional(zod_1.z.boolean()), + }) + .passthrough()), + /** + * Present if the server offers any resources to read. + */ + resources: zod_1.z.optional(zod_1.z + .object({ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: zod_1.z.optional(zod_1.z.boolean()), + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: zod_1.z.optional(zod_1.z.boolean()), + }) + .passthrough()), + /** + * Present if the server offers any tools to call. + */ + tools: zod_1.z.optional(zod_1.z + .object({ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: zod_1.z.optional(zod_1.z.boolean()), + }) + .passthrough()), +}) + .passthrough(); +/** + * After receiving an initialize request from the client, the server sends this response. + */ +exports.InitializeResultSchema = exports.ResultSchema.extend({ + /** + * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect. + */ + protocolVersion: zod_1.z.string(), + capabilities: exports.ServerCapabilitiesSchema, + serverInfo: exports.ImplementationSchema, + /** + * Instructions describing how to use the server and its features. + * + * This can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a "hint" to the model. For example, this information MAY be added to the system prompt. + */ + instructions: zod_1.z.optional(zod_1.z.string()), +}); +/** + * This notification is sent from the client to the server after initialization has finished. + */ +exports.InitializedNotificationSchema = exports.NotificationSchema.extend({ + method: zod_1.z.literal("notifications/initialized"), +}); +const isInitializedNotification = (value) => exports.InitializedNotificationSchema.safeParse(value).success; +exports.isInitializedNotification = isInitializedNotification; +/* Ping */ +/** + * A ping, issued by either the server or the client, to check that the other party is still alive. The receiver must promptly respond, or else may be disconnected. + */ +exports.PingRequestSchema = exports.RequestSchema.extend({ + method: zod_1.z.literal("ping"), +}); +/* Progress notifications */ +exports.ProgressSchema = zod_1.z + .object({ + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: zod_1.z.number(), + /** + * Total number of items to process (or total progress required), if known. + */ + total: zod_1.z.optional(zod_1.z.number()), + /** + * An optional message describing the current progress. + */ + message: zod_1.z.optional(zod_1.z.string()), +}) + .passthrough(); +/** + * An out-of-band notification used to inform the receiver of a progress update for a long-running request. + */ +exports.ProgressNotificationSchema = exports.NotificationSchema.extend({ + method: zod_1.z.literal("notifications/progress"), + params: BaseNotificationParamsSchema.merge(exports.ProgressSchema).extend({ + /** + * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. + */ + progressToken: exports.ProgressTokenSchema, + }), +}); +/* Pagination */ +exports.PaginatedRequestSchema = exports.RequestSchema.extend({ + params: BaseRequestParamsSchema.extend({ + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: zod_1.z.optional(exports.CursorSchema), + }).optional(), +}); +exports.PaginatedResultSchema = exports.ResultSchema.extend({ + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: zod_1.z.optional(exports.CursorSchema), +}); +/* Resources */ +/** + * The contents of a specific resource or sub-resource. + */ +exports.ResourceContentsSchema = zod_1.z + .object({ + /** + * The URI of this resource. + */ + uri: zod_1.z.string(), + /** + * The MIME type of this resource, if known. + */ + mimeType: zod_1.z.optional(zod_1.z.string()), +}) + .passthrough(); +exports.TextResourceContentsSchema = exports.ResourceContentsSchema.extend({ + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: zod_1.z.string(), +}); +exports.BlobResourceContentsSchema = exports.ResourceContentsSchema.extend({ + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: zod_1.z.string().base64(), +}); +/** + * A known resource that the server is capable of reading. + */ +exports.ResourceSchema = zod_1.z + .object({ + /** + * The URI of this resource. + */ + uri: zod_1.z.string(), + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: zod_1.z.string(), + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: zod_1.z.optional(zod_1.z.string()), + /** + * The MIME type of this resource, if known. + */ + mimeType: zod_1.z.optional(zod_1.z.string()), +}) + .passthrough(); +/** + * A template description for resources available on the server. + */ +exports.ResourceTemplateSchema = zod_1.z + .object({ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: zod_1.z.string(), + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: zod_1.z.string(), + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: zod_1.z.optional(zod_1.z.string()), + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: zod_1.z.optional(zod_1.z.string()), +}) + .passthrough(); +/** + * Sent from the client to request a list of resources the server has. + */ +exports.ListResourcesRequestSchema = exports.PaginatedRequestSchema.extend({ + method: zod_1.z.literal("resources/list"), +}); +/** + * The server's response to a resources/list request from the client. + */ +exports.ListResourcesResultSchema = exports.PaginatedResultSchema.extend({ + resources: zod_1.z.array(exports.ResourceSchema), +}); +/** + * Sent from the client to request a list of resource templates the server has. + */ +exports.ListResourceTemplatesRequestSchema = exports.PaginatedRequestSchema.extend({ + method: zod_1.z.literal("resources/templates/list"), +}); +/** + * The server's response to a resources/templates/list request from the client. + */ +exports.ListResourceTemplatesResultSchema = exports.PaginatedResultSchema.extend({ + resourceTemplates: zod_1.z.array(exports.ResourceTemplateSchema), +}); +/** + * Sent from the client to the server, to read a specific resource URI. + */ +exports.ReadResourceRequestSchema = exports.RequestSchema.extend({ + method: zod_1.z.literal("resources/read"), + params: BaseRequestParamsSchema.extend({ + /** + * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: zod_1.z.string(), + }), +}); +/** + * The server's response to a resources/read request from the client. + */ +exports.ReadResourceResultSchema = exports.ResultSchema.extend({ + contents: zod_1.z.array(zod_1.z.union([exports.TextResourceContentsSchema, exports.BlobResourceContentsSchema])), +}); +/** + * An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This may be issued by servers without any previous subscription from the client. + */ +exports.ResourceListChangedNotificationSchema = exports.NotificationSchema.extend({ + method: zod_1.z.literal("notifications/resources/list_changed"), +}); +/** + * Sent from the client to request resources/updated notifications from the server whenever a particular resource changes. + */ +exports.SubscribeRequestSchema = exports.RequestSchema.extend({ + method: zod_1.z.literal("resources/subscribe"), + params: BaseRequestParamsSchema.extend({ + /** + * The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: zod_1.z.string(), + }), +}); +/** + * Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request. + */ +exports.UnsubscribeRequestSchema = exports.RequestSchema.extend({ + method: zod_1.z.literal("resources/unsubscribe"), + params: BaseRequestParamsSchema.extend({ + /** + * The URI of the resource to unsubscribe from. + */ + uri: zod_1.z.string(), + }), +}); +/** + * A notification from the server to the client, informing it that a resource has changed and may need to be read again. This should only be sent if the client previously sent a resources/subscribe request. + */ +exports.ResourceUpdatedNotificationSchema = exports.NotificationSchema.extend({ + method: zod_1.z.literal("notifications/resources/updated"), + params: BaseNotificationParamsSchema.extend({ + /** + * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to. + */ + uri: zod_1.z.string(), + }), +}); +/* Prompts */ +/** + * Describes an argument that a prompt can accept. + */ +exports.PromptArgumentSchema = zod_1.z + .object({ + /** + * The name of the argument. + */ + name: zod_1.z.string(), + /** + * A human-readable description of the argument. + */ + description: zod_1.z.optional(zod_1.z.string()), + /** + * Whether this argument must be provided. + */ + required: zod_1.z.optional(zod_1.z.boolean()), +}) + .passthrough(); +/** + * A prompt or prompt template that the server offers. + */ +exports.PromptSchema = zod_1.z + .object({ + /** + * The name of the prompt or prompt template. + */ + name: zod_1.z.string(), + /** + * An optional description of what this prompt provides + */ + description: zod_1.z.optional(zod_1.z.string()), + /** + * A list of arguments to use for templating the prompt. + */ + arguments: zod_1.z.optional(zod_1.z.array(exports.PromptArgumentSchema)), +}) + .passthrough(); +/** + * Sent from the client to request a list of prompts and prompt templates the server has. + */ +exports.ListPromptsRequestSchema = exports.PaginatedRequestSchema.extend({ + method: zod_1.z.literal("prompts/list"), +}); +/** + * The server's response to a prompts/list request from the client. + */ +exports.ListPromptsResultSchema = exports.PaginatedResultSchema.extend({ + prompts: zod_1.z.array(exports.PromptSchema), +}); +/** + * Used by the client to get a prompt provided by the server. + */ +exports.GetPromptRequestSchema = exports.RequestSchema.extend({ + method: zod_1.z.literal("prompts/get"), + params: BaseRequestParamsSchema.extend({ + /** + * The name of the prompt or prompt template. + */ + name: zod_1.z.string(), + /** + * Arguments to use for templating the prompt. + */ + arguments: zod_1.z.optional(zod_1.z.record(zod_1.z.string())), + }), +}); +/** + * Text provided to or from an LLM. + */ +exports.TextContentSchema = zod_1.z + .object({ + type: zod_1.z.literal("text"), + /** + * The text content of the message. + */ + text: zod_1.z.string(), +}) + .passthrough(); +/** + * An image provided to or from an LLM. + */ +exports.ImageContentSchema = zod_1.z + .object({ + type: zod_1.z.literal("image"), + /** + * The base64-encoded image data. + */ + data: zod_1.z.string().base64(), + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: zod_1.z.string(), +}) + .passthrough(); +/** + * An Audio provided to or from an LLM. + */ +exports.AudioContentSchema = zod_1.z + .object({ + type: zod_1.z.literal("audio"), + /** + * The base64-encoded audio data. + */ + data: zod_1.z.string().base64(), + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: zod_1.z.string(), +}) + .passthrough(); +/** + * The contents of a resource, embedded into a prompt or tool call result. + */ +exports.EmbeddedResourceSchema = zod_1.z + .object({ + type: zod_1.z.literal("resource"), + resource: zod_1.z.union([exports.TextResourceContentsSchema, exports.BlobResourceContentsSchema]), +}) + .passthrough(); +/** + * Describes a message returned as part of a prompt. + */ +exports.PromptMessageSchema = zod_1.z + .object({ + role: zod_1.z.enum(["user", "assistant"]), + content: zod_1.z.union([ + exports.TextContentSchema, + exports.ImageContentSchema, + exports.AudioContentSchema, + exports.EmbeddedResourceSchema, + ]), +}) + .passthrough(); +/** + * The server's response to a prompts/get request from the client. + */ +exports.GetPromptResultSchema = exports.ResultSchema.extend({ + /** + * An optional description for the prompt. + */ + description: zod_1.z.optional(zod_1.z.string()), + messages: zod_1.z.array(exports.PromptMessageSchema), +}); +/** + * An optional notification from the server to the client, informing it that the list of prompts it offers has changed. This may be issued by servers without any previous subscription from the client. + */ +exports.PromptListChangedNotificationSchema = exports.NotificationSchema.extend({ + method: zod_1.z.literal("notifications/prompts/list_changed"), +}); +/* Tools */ +/** + * Additional properties describing a Tool to clients. + * + * NOTE: all properties in ToolAnnotations are **hints**. + * They are not guaranteed to provide a faithful description of + * tool behavior (including descriptive properties like `title`). + * + * Clients should never make tool use decisions based on ToolAnnotations + * received from untrusted servers. + */ +exports.ToolAnnotationsSchema = zod_1.z + .object({ + /** + * A human-readable title for the tool. + */ + title: zod_1.z.optional(zod_1.z.string()), + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: zod_1.z.optional(zod_1.z.boolean()), + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: zod_1.z.optional(zod_1.z.boolean()), + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: zod_1.z.optional(zod_1.z.boolean()), + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: zod_1.z.optional(zod_1.z.boolean()), +}) + .passthrough(); +/** + * Definition for a tool the client can call. + */ +exports.ToolSchema = zod_1.z + .object({ + /** + * The name of the tool. + */ + name: zod_1.z.string(), + /** + * A human-readable description of the tool. + */ + description: zod_1.z.optional(zod_1.z.string()), + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: zod_1.z + .object({ + type: zod_1.z.literal("object"), + properties: zod_1.z.optional(zod_1.z.object({}).passthrough()), + required: zod_1.z.optional(zod_1.z.array(zod_1.z.string())), + }) + .passthrough(), + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: zod_1.z.optional(zod_1.z.object({ + type: zod_1.z.literal("object"), + properties: zod_1.z.optional(zod_1.z.object({}).passthrough()), + required: zod_1.z.optional(zod_1.z.array(zod_1.z.string())), + }) + .passthrough()), + /** + * Optional additional tool information. + */ + annotations: zod_1.z.optional(exports.ToolAnnotationsSchema), +}) + .passthrough(); +/** + * Sent from the client to request a list of tools the server has. + */ +exports.ListToolsRequestSchema = exports.PaginatedRequestSchema.extend({ + method: zod_1.z.literal("tools/list"), +}); +/** + * The server's response to a tools/list request from the client. + */ +exports.ListToolsResultSchema = exports.PaginatedResultSchema.extend({ + tools: zod_1.z.array(exports.ToolSchema), +}); +/** + * The server's response to a tool call. + */ +exports.CallToolResultSchema = exports.ResultSchema.extend({ + /** + * A list of content objects that represent the result of the tool call. + * + * If the Tool does not define an outputSchema, this field MUST be present in the result. + * For backwards compatibility, this field is always present, but it may be empty. + */ + content: zod_1.z.array(zod_1.z.union([ + exports.TextContentSchema, + exports.ImageContentSchema, + exports.AudioContentSchema, + exports.EmbeddedResourceSchema, + ])).default([]), + /** + * An object containing structured tool output. + * + * If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema. + */ + structuredContent: zod_1.z.object({}).passthrough().optional(), + /** + * Whether the tool call ended in an error. + * + * If not set, this is assumed to be false (the call was successful). + * + * Any errors that originate from the tool SHOULD be reported inside the result + * object, with `isError` set to true, _not_ as an MCP protocol-level error + * response. Otherwise, the LLM would not be able to see that an error occurred + * and self-correct. + * + * However, any errors in _finding_ the tool, an error indicating that the + * server does not support tool calls, or any other exceptional conditions, + * should be reported as an MCP error response. + */ + isError: zod_1.z.optional(zod_1.z.boolean()), +}); +/** + * CallToolResultSchema extended with backwards compatibility to protocol version 2024-10-07. + */ +exports.CompatibilityCallToolResultSchema = exports.CallToolResultSchema.or(exports.ResultSchema.extend({ + toolResult: zod_1.z.unknown(), +})); +/** + * Used by the client to invoke a tool provided by the server. + */ +exports.CallToolRequestSchema = exports.RequestSchema.extend({ + method: zod_1.z.literal("tools/call"), + params: BaseRequestParamsSchema.extend({ + name: zod_1.z.string(), + arguments: zod_1.z.optional(zod_1.z.record(zod_1.z.unknown())), + }), +}); +/** + * An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client. + */ +exports.ToolListChangedNotificationSchema = exports.NotificationSchema.extend({ + method: zod_1.z.literal("notifications/tools/list_changed"), +}); +/* Logging */ +/** + * The severity of a log message. + */ +exports.LoggingLevelSchema = zod_1.z.enum([ + "debug", + "info", + "notice", + "warning", + "error", + "critical", + "alert", + "emergency", +]); +/** + * A request from the client to the server, to enable or adjust logging. + */ +exports.SetLevelRequestSchema = exports.RequestSchema.extend({ + method: zod_1.z.literal("logging/setLevel"), + params: BaseRequestParamsSchema.extend({ + /** + * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message. + */ + level: exports.LoggingLevelSchema, + }), +}); +/** + * Notification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically. + */ +exports.LoggingMessageNotificationSchema = exports.NotificationSchema.extend({ + method: zod_1.z.literal("notifications/message"), + params: BaseNotificationParamsSchema.extend({ + /** + * The severity of this log message. + */ + level: exports.LoggingLevelSchema, + /** + * An optional name of the logger issuing this message. + */ + logger: zod_1.z.optional(zod_1.z.string()), + /** + * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here. + */ + data: zod_1.z.unknown(), + }), +}); +/* Sampling */ +/** + * Hints to use for model selection. + */ +exports.ModelHintSchema = zod_1.z + .object({ + /** + * A hint for a model name. + */ + name: zod_1.z.string().optional(), +}) + .passthrough(); +/** + * The server's preferences for model selection, requested of the client during sampling. + */ +exports.ModelPreferencesSchema = zod_1.z + .object({ + /** + * Optional hints to use for model selection. + */ + hints: zod_1.z.optional(zod_1.z.array(exports.ModelHintSchema)), + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: zod_1.z.optional(zod_1.z.number().min(0).max(1)), + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: zod_1.z.optional(zod_1.z.number().min(0).max(1)), + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: zod_1.z.optional(zod_1.z.number().min(0).max(1)), +}) + .passthrough(); +/** + * Describes a message issued to or received from an LLM API. + */ +exports.SamplingMessageSchema = zod_1.z + .object({ + role: zod_1.z.enum(["user", "assistant"]), + content: zod_1.z.union([exports.TextContentSchema, exports.ImageContentSchema, exports.AudioContentSchema]), +}) + .passthrough(); +/** + * A request from the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it. + */ +exports.CreateMessageRequestSchema = exports.RequestSchema.extend({ + method: zod_1.z.literal("sampling/createMessage"), + params: BaseRequestParamsSchema.extend({ + messages: zod_1.z.array(exports.SamplingMessageSchema), + /** + * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt. + */ + systemPrompt: zod_1.z.optional(zod_1.z.string()), + /** + * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request. + */ + includeContext: zod_1.z.optional(zod_1.z.enum(["none", "thisServer", "allServers"])), + temperature: zod_1.z.optional(zod_1.z.number()), + /** + * The maximum number of tokens to sample, as requested by the server. The client MAY choose to sample fewer tokens than requested. + */ + maxTokens: zod_1.z.number().int(), + stopSequences: zod_1.z.optional(zod_1.z.array(zod_1.z.string())), + /** + * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific. + */ + metadata: zod_1.z.optional(zod_1.z.object({}).passthrough()), + /** + * The server's preferences for which model to select. + */ + modelPreferences: zod_1.z.optional(exports.ModelPreferencesSchema), + }), +}); +/** + * The client's response to a sampling/create_message request from the server. The client should inform the user before returning the sampled message, to allow them to inspect the response (human in the loop) and decide whether to allow the server to see it. + */ +exports.CreateMessageResultSchema = exports.ResultSchema.extend({ + /** + * The name of the model that generated the message. + */ + model: zod_1.z.string(), + /** + * The reason why sampling stopped. + */ + stopReason: zod_1.z.optional(zod_1.z.enum(["endTurn", "stopSequence", "maxTokens"]).or(zod_1.z.string())), + role: zod_1.z.enum(["user", "assistant"]), + content: zod_1.z.discriminatedUnion("type", [ + exports.TextContentSchema, + exports.ImageContentSchema, + exports.AudioContentSchema + ]), +}); +/* Autocomplete */ +/** + * A reference to a resource or resource template definition. + */ +exports.ResourceReferenceSchema = zod_1.z + .object({ + type: zod_1.z.literal("ref/resource"), + /** + * The URI or URI template of the resource. + */ + uri: zod_1.z.string(), +}) + .passthrough(); +/** + * Identifies a prompt. + */ +exports.PromptReferenceSchema = zod_1.z + .object({ + type: zod_1.z.literal("ref/prompt"), + /** + * The name of the prompt or prompt template + */ + name: zod_1.z.string(), +}) + .passthrough(); +/** + * A request from the client to the server, to ask for completion options. + */ +exports.CompleteRequestSchema = exports.RequestSchema.extend({ + method: zod_1.z.literal("completion/complete"), + params: BaseRequestParamsSchema.extend({ + ref: zod_1.z.union([exports.PromptReferenceSchema, exports.ResourceReferenceSchema]), + /** + * The argument's information + */ + argument: zod_1.z + .object({ + /** + * The name of the argument + */ + name: zod_1.z.string(), + /** + * The value of the argument to use for completion matching. + */ + value: zod_1.z.string(), + }) + .passthrough(), + }), +}); +/** + * The server's response to a completion/complete request + */ +exports.CompleteResultSchema = exports.ResultSchema.extend({ + completion: zod_1.z + .object({ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: zod_1.z.array(zod_1.z.string()).max(100), + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: zod_1.z.optional(zod_1.z.number().int()), + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: zod_1.z.optional(zod_1.z.boolean()), + }) + .passthrough(), +}); +/* Roots */ +/** + * Represents a root directory or file that the server can operate on. + */ +exports.RootSchema = zod_1.z + .object({ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: zod_1.z.string().startsWith("file://"), + /** + * An optional name for the root. + */ + name: zod_1.z.optional(zod_1.z.string()), +}) + .passthrough(); +/** + * Sent from the server to request a list of root URIs from the client. + */ +exports.ListRootsRequestSchema = exports.RequestSchema.extend({ + method: zod_1.z.literal("roots/list"), +}); +/** + * The client's response to a roots/list request from the server. + */ +exports.ListRootsResultSchema = exports.ResultSchema.extend({ + roots: zod_1.z.array(exports.RootSchema), +}); +/** + * A notification from the client to the server, informing it that the list of roots has changed. + */ +exports.RootsListChangedNotificationSchema = exports.NotificationSchema.extend({ + method: zod_1.z.literal("notifications/roots/list_changed"), +}); +/* Client messages */ +exports.ClientRequestSchema = zod_1.z.union([ + exports.PingRequestSchema, + exports.InitializeRequestSchema, + exports.CompleteRequestSchema, + exports.SetLevelRequestSchema, + exports.GetPromptRequestSchema, + exports.ListPromptsRequestSchema, + exports.ListResourcesRequestSchema, + exports.ListResourceTemplatesRequestSchema, + exports.ReadResourceRequestSchema, + exports.SubscribeRequestSchema, + exports.UnsubscribeRequestSchema, + exports.CallToolRequestSchema, + exports.ListToolsRequestSchema, +]); +exports.ClientNotificationSchema = zod_1.z.union([ + exports.CancelledNotificationSchema, + exports.ProgressNotificationSchema, + exports.InitializedNotificationSchema, + exports.RootsListChangedNotificationSchema, +]); +exports.ClientResultSchema = zod_1.z.union([ + exports.EmptyResultSchema, + exports.CreateMessageResultSchema, + exports.ListRootsResultSchema, +]); +/* Server messages */ +exports.ServerRequestSchema = zod_1.z.union([ + exports.PingRequestSchema, + exports.CreateMessageRequestSchema, + exports.ListRootsRequestSchema, +]); +exports.ServerNotificationSchema = zod_1.z.union([ + exports.CancelledNotificationSchema, + exports.ProgressNotificationSchema, + exports.LoggingMessageNotificationSchema, + exports.ResourceUpdatedNotificationSchema, + exports.ResourceListChangedNotificationSchema, + exports.ToolListChangedNotificationSchema, + exports.PromptListChangedNotificationSchema, +]); +exports.ServerResultSchema = zod_1.z.union([ + exports.EmptyResultSchema, + exports.InitializeResultSchema, + exports.CompleteResultSchema, + exports.GetPromptResultSchema, + exports.ListPromptsResultSchema, + exports.ListResourcesResultSchema, + exports.ListResourceTemplatesResultSchema, + exports.ReadResourceResultSchema, + exports.CallToolResultSchema, + exports.ListToolsResultSchema, +]); +class McpError extends Error { + constructor(code, message, data) { + super(`MCP error ${code}: ${message}`); + this.code = code; + this.data = data; + this.name = "McpError"; + } +} +exports.McpError = McpError; +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/cjs/types.js.map b/front_end/third_party/mcp-sdk/ajv/dist/cjs/types.js.map new file mode 100644 index 0000000000..fa1e8219ee --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/cjs/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":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CAAiC;IACjC,gCAAwB;IACxB,4BAAoB;IACpB,6BAAqB;CACtB,CAAC,CAAC;AAEH,MAAa,QAAS,SAAQ,KAAK;IACjC,YACkB,IAAY,EAC5B,OAAe,EACC,IAAc;QAE9B,KAAK,CAAC,aAAa,IAAI,KAAK,OAAO,EAAE,CAAC,CAAC;QAJvB,SAAI,GAAJ,IAAI,CAAQ;QAEZ,SAAI,GAAJ,IAAI,CAAU;QAG9B,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;IACzB,CAAC;CACF;AATD,4BASC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/codegen/code.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/compile/codegen/code.d.ts new file mode 100644 index 0000000000..a0220ad764 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/codegen/code.d.ts @@ -0,0 +1,40 @@ +export declare abstract class _CodeOrName { + abstract readonly str: string; + abstract readonly names: UsedNames; + abstract toString(): string; + abstract emptyStr(): boolean; +} +export declare const IDENTIFIER: RegExp; +export declare class Name extends _CodeOrName { + readonly str: string; + constructor(s: string); + toString(): string; + emptyStr(): boolean; + get names(): UsedNames; +} +export declare class _Code extends _CodeOrName { + readonly _items: readonly CodeItem[]; + private _str?; + private _names?; + constructor(code: string | readonly CodeItem[]); + toString(): string; + emptyStr(): boolean; + get str(): string; + get names(): UsedNames; +} +export type CodeItem = Name | string | number | boolean | null; +export type UsedNames = Record; +export type Code = _Code | Name; +export type SafeExpr = Code | number | boolean | null; +export declare const nil: _Code; +type CodeArg = SafeExpr | string | undefined; +export declare function _(strs: TemplateStringsArray, ...args: CodeArg[]): _Code; +export declare function str(strs: TemplateStringsArray, ...args: (CodeArg | string[])[]): _Code; +export declare function addCodeArg(code: CodeItem[], arg: CodeArg | string[]): void; +export declare function strConcat(c1: Code, c2: Code): Code; +export declare function stringify(x: unknown): Code; +export declare function safeStringify(x: unknown): string; +export declare function getProperty(key: Code | string | number): Code; +export declare function getEsmExportName(key: Code | string | number): Code; +export declare function regexpCode(rx: RegExp): Code; +export {}; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/codegen/code.js b/front_end/third_party/mcp-sdk/ajv/dist/compile/codegen/code.js new file mode 100644 index 0000000000..f9ea5259a7 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/codegen/code.js @@ -0,0 +1,156 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.regexpCode = exports.getEsmExportName = exports.getProperty = exports.safeStringify = exports.stringify = exports.strConcat = exports.addCodeArg = exports.str = exports._ = exports.nil = exports._Code = exports.Name = exports.IDENTIFIER = exports._CodeOrName = void 0; +// eslint-disable-next-line @typescript-eslint/no-extraneous-class +class _CodeOrName { +} +exports._CodeOrName = _CodeOrName; +exports.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i; +class Name extends _CodeOrName { + constructor(s) { + super(); + if (!exports.IDENTIFIER.test(s)) + throw new Error("CodeGen: name must be a valid identifier"); + this.str = s; + } + toString() { + return this.str; + } + emptyStr() { + return false; + } + get names() { + return { [this.str]: 1 }; + } +} +exports.Name = Name; +class _Code extends _CodeOrName { + constructor(code) { + super(); + this._items = typeof code === "string" ? [code] : code; + } + toString() { + return this.str; + } + emptyStr() { + if (this._items.length > 1) + return false; + const item = this._items[0]; + return item === "" || item === '""'; + } + get str() { + var _a; + return ((_a = this._str) !== null && _a !== void 0 ? _a : (this._str = this._items.reduce((s, c) => `${s}${c}`, ""))); + } + get names() { + var _a; + return ((_a = this._names) !== null && _a !== void 0 ? _a : (this._names = this._items.reduce((names, c) => { + if (c instanceof Name) + names[c.str] = (names[c.str] || 0) + 1; + return names; + }, {}))); + } +} +exports._Code = _Code; +exports.nil = new _Code(""); +function _(strs, ...args) { + const code = [strs[0]]; + let i = 0; + while (i < args.length) { + addCodeArg(code, args[i]); + code.push(strs[++i]); + } + return new _Code(code); +} +exports._ = _; +const plus = new _Code("+"); +function str(strs, ...args) { + const expr = [safeStringify(strs[0])]; + let i = 0; + while (i < args.length) { + expr.push(plus); + addCodeArg(expr, args[i]); + expr.push(plus, safeStringify(strs[++i])); + } + optimize(expr); + return new _Code(expr); +} +exports.str = str; +function addCodeArg(code, arg) { + if (arg instanceof _Code) + code.push(...arg._items); + else if (arg instanceof Name) + code.push(arg); + else + code.push(interpolate(arg)); +} +exports.addCodeArg = addCodeArg; +function optimize(expr) { + let i = 1; + while (i < expr.length - 1) { + if (expr[i] === plus) { + const res = mergeExprItems(expr[i - 1], expr[i + 1]); + if (res !== undefined) { + expr.splice(i - 1, 3, res); + continue; + } + expr[i++] = "+"; + } + i++; + } +} +function mergeExprItems(a, b) { + if (b === '""') + return a; + if (a === '""') + return b; + if (typeof a == "string") { + if (b instanceof Name || a[a.length - 1] !== '"') + return; + if (typeof b != "string") + return `${a.slice(0, -1)}${b}"`; + if (b[0] === '"') + return a.slice(0, -1) + b.slice(1); + return; + } + if (typeof b == "string" && b[0] === '"' && !(a instanceof Name)) + return `"${a}${b.slice(1)}`; + return; +} +function strConcat(c1, c2) { + return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str `${c1}${c2}`; +} +exports.strConcat = strConcat; +// TODO do not allow arrays here +function interpolate(x) { + return typeof x == "number" || typeof x == "boolean" || x === null + ? x + : safeStringify(Array.isArray(x) ? x.join(",") : x); +} +function stringify(x) { + return new _Code(safeStringify(x)); +} +exports.stringify = stringify; +function safeStringify(x) { + return JSON.stringify(x) + .replace(/\u2028/g, "\\u2028") + .replace(/\u2029/g, "\\u2029"); +} +exports.safeStringify = safeStringify; +function getProperty(key) { + return typeof key == "string" && exports.IDENTIFIER.test(key) ? new _Code(`.${key}`) : _ `[${key}]`; +} +exports.getProperty = getProperty; +//Does best effort to format the name properly +function getEsmExportName(key) { + if (typeof key == "string" && exports.IDENTIFIER.test(key)) { + return new _Code(`${key}`); + } + throw new Error(`CodeGen: invalid export name: ${key}, use explicit $id name mapping`); +} +exports.getEsmExportName = getEsmExportName; +function regexpCode(rx) { + return new _Code(rx.toString()); +} +exports.regexpCode = regexpCode; +//# sourceMappingURL=code.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/codegen/code.js.map b/front_end/third_party/mcp-sdk/ajv/dist/compile/codegen/code.js.map new file mode 100644 index 0000000000..2fe66c15e1 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/codegen/code.js.map @@ -0,0 +1 @@ +{"version":3,"file":"code.js","sourceRoot":"","sources":["../../../lib/compile/codegen/code.ts"],"names":[],"mappings":";;;AAAA,kEAAkE;AAClE,MAAsB,WAAW;CAKhC;AALD,kCAKC;AAEY,QAAA,UAAU,GAAG,uBAAuB,CAAA;AAEjD,MAAa,IAAK,SAAQ,WAAW;IAEnC,YAAY,CAAS;QACnB,KAAK,EAAE,CAAA;QACP,IAAI,CAAC,kBAAU,CAAC,IAAI,CAAC,CAAC,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAA;QACpF,IAAI,CAAC,GAAG,GAAG,CAAC,CAAA;IACd,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,GAAG,CAAA;IACjB,CAAC;IAED,QAAQ;QACN,OAAO,KAAK,CAAA;IACd,CAAC;IAED,IAAI,KAAK;QACP,OAAO,EAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,EAAC,CAAA;IACxB,CAAC;CACF;AAnBD,oBAmBC;AAED,MAAa,KAAM,SAAQ,WAAW;IAKpC,YAAY,IAAkC;QAC5C,KAAK,EAAE,CAAA;QACP,IAAI,CAAC,MAAM,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IACxD,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,GAAG,CAAA;IACjB,CAAC;IAED,QAAQ;QACN,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;YA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,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACnD,OAAO,IAAI,KAAK,CAAC,GAAG,GAAG,EAAE,CAAC,CAAA;IAC5B,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,iCAAiC,GAAG,iCAAiC,CAAC,CAAA;AACxF,CAAC;AALD,4CAKC;AAED,SAAgB,UAAU,CAAC,EAAU;IACnC,OAAO,IAAI,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAA;AACjC,CAAC;AAFD,gCAEC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/codegen/index.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/compile/codegen/index.d.ts new file mode 100644 index 0000000000..d586a4b49f --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/codegen/index.d.ts @@ -0,0 +1,79 @@ +import type { ScopeValueSets, NameValue, ValueScope, ValueScopeName } from "./scope"; +import { _Code, Code, Name } from "./code"; +import { Scope } from "./scope"; +export { _, str, strConcat, nil, getProperty, stringify, regexpCode, Name, Code } from "./code"; +export { Scope, ScopeStore, ValueScope, ValueScopeName, ScopeValueSets, varKinds } from "./scope"; +export type SafeExpr = Code | number | boolean | null; +export type Block = Code | (() => void); +export declare const operators: { + GT: _Code; + GTE: _Code; + LT: _Code; + LTE: _Code; + EQ: _Code; + NEQ: _Code; + NOT: _Code; + OR: _Code; + AND: _Code; + ADD: _Code; +}; +export interface CodeGenOptions { + es5?: boolean; + lines?: boolean; + ownProperties?: boolean; +} +export declare class CodeGen { + readonly _scope: Scope; + readonly _extScope: ValueScope; + readonly _values: ScopeValueSets; + private readonly _nodes; + private readonly _blockStarts; + private readonly _constants; + private readonly opts; + constructor(extScope: ValueScope, opts?: CodeGenOptions); + toString(): string; + name(prefix: string): Name; + scopeName(prefix: string): ValueScopeName; + scopeValue(prefixOrName: ValueScopeName | string, value: NameValue): Name; + getScopeValue(prefix: string, keyOrRef: unknown): ValueScopeName | undefined; + scopeRefs(scopeName: Name): Code; + scopeCode(): Code; + private _def; + const(nameOrPrefix: Name | string, rhs: SafeExpr, _constant?: boolean): Name; + let(nameOrPrefix: Name | string, rhs?: SafeExpr, _constant?: boolean): Name; + var(nameOrPrefix: Name | string, rhs?: SafeExpr, _constant?: boolean): Name; + assign(lhs: Code, rhs: SafeExpr, sideEffects?: boolean): CodeGen; + add(lhs: Code, rhs: SafeExpr): CodeGen; + code(c: Block | SafeExpr): CodeGen; + object(...keyValues: [Name | string, SafeExpr | string][]): _Code; + if(condition: Code | boolean, thenBody?: Block, elseBody?: Block): CodeGen; + elseIf(condition: Code | boolean): CodeGen; + else(): CodeGen; + endIf(): CodeGen; + private _for; + for(iteration: Code, forBody?: Block): CodeGen; + forRange(nameOrPrefix: Name | string, from: SafeExpr, to: SafeExpr, forBody: (index: Name) => void, varKind?: Code): CodeGen; + forOf(nameOrPrefix: Name | string, iterable: Code, forBody: (item: Name) => void, varKind?: Code): CodeGen; + forIn(nameOrPrefix: Name | string, obj: Code, forBody: (item: Name) => void, varKind?: Code): CodeGen; + endFor(): CodeGen; + label(label: Name): CodeGen; + break(label?: Code): CodeGen; + return(value: Block | SafeExpr): CodeGen; + try(tryBody: Block, catchCode?: (e: Name) => void, finallyCode?: Block): CodeGen; + throw(error: Code): CodeGen; + block(body?: Block, nodeCount?: number): CodeGen; + endBlock(nodeCount?: number): CodeGen; + func(name: Name, args?: Code, async?: boolean, funcBody?: Block): CodeGen; + endFunc(): CodeGen; + optimize(n?: number): void; + private _leafNode; + private _blockNode; + private _endBlockNode; + private _elseNode; + private get _root(); + private get _currNode(); + private set _currNode(value); +} +export declare function not(x: T): T; +export declare function and(...args: Code[]): Code; +export declare function or(...args: Code[]): Code; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/codegen/index.js b/front_end/third_party/mcp-sdk/ajv/dist/compile/codegen/index.js new file mode 100644 index 0000000000..a6c805af14 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/codegen/index.js @@ -0,0 +1,697 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.or = exports.and = exports.not = exports.CodeGen = exports.operators = exports.varKinds = exports.ValueScopeName = exports.ValueScope = exports.Scope = exports.Name = exports.regexpCode = exports.stringify = exports.getProperty = exports.nil = exports.strConcat = exports.str = exports._ = void 0; +const code_1 = require("./code"); +const scope_1 = require("./scope"); +var code_2 = require("./code"); +Object.defineProperty(exports, "_", { enumerable: true, get: function () { return code_2._; } }); +Object.defineProperty(exports, "str", { enumerable: true, get: function () { return code_2.str; } }); +Object.defineProperty(exports, "strConcat", { enumerable: true, get: function () { return code_2.strConcat; } }); +Object.defineProperty(exports, "nil", { enumerable: true, get: function () { return code_2.nil; } }); +Object.defineProperty(exports, "getProperty", { enumerable: true, get: function () { return code_2.getProperty; } }); +Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return code_2.stringify; } }); +Object.defineProperty(exports, "regexpCode", { enumerable: true, get: function () { return code_2.regexpCode; } }); +Object.defineProperty(exports, "Name", { enumerable: true, get: function () { return code_2.Name; } }); +var scope_2 = require("./scope"); +Object.defineProperty(exports, "Scope", { enumerable: true, get: function () { return scope_2.Scope; } }); +Object.defineProperty(exports, "ValueScope", { enumerable: true, get: function () { return scope_2.ValueScope; } }); +Object.defineProperty(exports, "ValueScopeName", { enumerable: true, get: function () { return scope_2.ValueScopeName; } }); +Object.defineProperty(exports, "varKinds", { enumerable: true, get: function () { return scope_2.varKinds; } }); +exports.operators = { + GT: new code_1._Code(">"), + GTE: new code_1._Code(">="), + LT: new code_1._Code("<"), + LTE: new code_1._Code("<="), + EQ: new code_1._Code("==="), + NEQ: new code_1._Code("!=="), + NOT: new code_1._Code("!"), + OR: new code_1._Code("||"), + AND: new code_1._Code("&&"), + ADD: new code_1._Code("+"), +}; +class Node { + optimizeNodes() { + return this; + } + optimizeNames(_names, _constants) { + return this; + } +} +class Def extends Node { + constructor(varKind, name, rhs) { + super(); + this.varKind = varKind; + this.name = name; + this.rhs = rhs; + } + render({ es5, _n }) { + const varKind = es5 ? scope_1.varKinds.var : this.varKind; + const rhs = this.rhs === undefined ? "" : ` = ${this.rhs}`; + return `${varKind} ${this.name}${rhs};` + _n; + } + optimizeNames(names, constants) { + if (!names[this.name.str]) + return; + if (this.rhs) + this.rhs = optimizeExpr(this.rhs, names, constants); + return this; + } + get names() { + return this.rhs instanceof code_1._CodeOrName ? this.rhs.names : {}; + } +} +class Assign extends Node { + constructor(lhs, rhs, sideEffects) { + super(); + this.lhs = lhs; + this.rhs = rhs; + this.sideEffects = sideEffects; + } + render({ _n }) { + return `${this.lhs} = ${this.rhs};` + _n; + } + optimizeNames(names, constants) { + if (this.lhs instanceof code_1.Name && !names[this.lhs.str] && !this.sideEffects) + return; + this.rhs = optimizeExpr(this.rhs, names, constants); + return this; + } + get names() { + const names = this.lhs instanceof code_1.Name ? {} : { ...this.lhs.names }; + return addExprNames(names, this.rhs); + } +} +class AssignOp extends Assign { + constructor(lhs, op, rhs, sideEffects) { + super(lhs, rhs, sideEffects); + this.op = op; + } + render({ _n }) { + return `${this.lhs} ${this.op}= ${this.rhs};` + _n; + } +} +class Label extends Node { + constructor(label) { + super(); + this.label = label; + this.names = {}; + } + render({ _n }) { + return `${this.label}:` + _n; + } +} +class Break extends Node { + constructor(label) { + super(); + this.label = label; + this.names = {}; + } + render({ _n }) { + const label = this.label ? ` ${this.label}` : ""; + return `break${label};` + _n; + } +} +class Throw extends Node { + constructor(error) { + super(); + this.error = error; + } + render({ _n }) { + return `throw ${this.error};` + _n; + } + get names() { + return this.error.names; + } +} +class AnyCode extends Node { + constructor(code) { + super(); + this.code = code; + } + render({ _n }) { + return `${this.code};` + _n; + } + optimizeNodes() { + return `${this.code}` ? this : undefined; + } + optimizeNames(names, constants) { + this.code = optimizeExpr(this.code, names, constants); + return this; + } + get names() { + return this.code instanceof code_1._CodeOrName ? this.code.names : {}; + } +} +class ParentNode extends Node { + constructor(nodes = []) { + super(); + this.nodes = nodes; + } + render(opts) { + return this.nodes.reduce((code, n) => code + n.render(opts), ""); + } + optimizeNodes() { + const { nodes } = this; + let i = nodes.length; + while (i--) { + const n = nodes[i].optimizeNodes(); + if (Array.isArray(n)) + nodes.splice(i, 1, ...n); + else if (n) + nodes[i] = n; + else + nodes.splice(i, 1); + } + return nodes.length > 0 ? this : undefined; + } + optimizeNames(names, constants) { + const { nodes } = this; + let i = nodes.length; + while (i--) { + // iterating backwards improves 1-pass optimization + const n = nodes[i]; + if (n.optimizeNames(names, constants)) + continue; + subtractNames(names, n.names); + nodes.splice(i, 1); + } + return nodes.length > 0 ? this : undefined; + } + get names() { + return this.nodes.reduce((names, n) => addNames(names, n.names), {}); + } +} +class BlockNode extends ParentNode { + render(opts) { + return "{" + opts._n + super.render(opts) + "}" + opts._n; + } +} +class Root extends ParentNode { +} +class Else extends BlockNode { +} +Else.kind = "else"; +class If extends BlockNode { + constructor(condition, nodes) { + super(nodes); + this.condition = condition; + } + render(opts) { + let code = `if(${this.condition})` + super.render(opts); + if (this.else) + code += "else " + this.else.render(opts); + return code; + } + optimizeNodes() { + super.optimizeNodes(); + const cond = this.condition; + if (cond === true) + return this.nodes; // else is ignored here + let e = this.else; + if (e) { + const ns = e.optimizeNodes(); + e = this.else = Array.isArray(ns) ? new Else(ns) : ns; + } + if (e) { + if (cond === false) + return e instanceof If ? e : e.nodes; + if (this.nodes.length) + return this; + return new If(not(cond), e instanceof If ? [e] : e.nodes); + } + if (cond === false || !this.nodes.length) + return undefined; + return this; + } + optimizeNames(names, constants) { + var _a; + this.else = (_a = this.else) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants); + if (!(super.optimizeNames(names, constants) || this.else)) + return; + this.condition = optimizeExpr(this.condition, names, constants); + return this; + } + get names() { + const names = super.names; + addExprNames(names, this.condition); + if (this.else) + addNames(names, this.else.names); + return names; + } +} +If.kind = "if"; +class For extends BlockNode { +} +For.kind = "for"; +class ForLoop extends For { + constructor(iteration) { + super(); + this.iteration = iteration; + } + render(opts) { + return `for(${this.iteration})` + super.render(opts); + } + optimizeNames(names, constants) { + if (!super.optimizeNames(names, constants)) + return; + this.iteration = optimizeExpr(this.iteration, names, constants); + return this; + } + get names() { + return addNames(super.names, this.iteration.names); + } +} +class ForRange extends For { + constructor(varKind, name, from, to) { + super(); + this.varKind = varKind; + this.name = name; + this.from = from; + this.to = to; + } + render(opts) { + const varKind = opts.es5 ? scope_1.varKinds.var : this.varKind; + const { name, from, to } = this; + return `for(${varKind} ${name}=${from}; ${name}<${to}; ${name}++)` + super.render(opts); + } + get names() { + const names = addExprNames(super.names, this.from); + return addExprNames(names, this.to); + } +} +class ForIter extends For { + constructor(loop, varKind, name, iterable) { + super(); + this.loop = loop; + this.varKind = varKind; + this.name = name; + this.iterable = iterable; + } + render(opts) { + return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(opts); + } + optimizeNames(names, constants) { + if (!super.optimizeNames(names, constants)) + return; + this.iterable = optimizeExpr(this.iterable, names, constants); + return this; + } + get names() { + return addNames(super.names, this.iterable.names); + } +} +class Func extends BlockNode { + constructor(name, args, async) { + super(); + this.name = name; + this.args = args; + this.async = async; + } + render(opts) { + const _async = this.async ? "async " : ""; + return `${_async}function ${this.name}(${this.args})` + super.render(opts); + } +} +Func.kind = "func"; +class Return extends ParentNode { + render(opts) { + return "return " + super.render(opts); + } +} +Return.kind = "return"; +class Try extends BlockNode { + render(opts) { + let code = "try" + super.render(opts); + if (this.catch) + code += this.catch.render(opts); + if (this.finally) + code += this.finally.render(opts); + return code; + } + optimizeNodes() { + var _a, _b; + super.optimizeNodes(); + (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNodes(); + (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNodes(); + return this; + } + optimizeNames(names, constants) { + var _a, _b; + super.optimizeNames(names, constants); + (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants); + (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names, constants); + return this; + } + get names() { + const names = super.names; + if (this.catch) + addNames(names, this.catch.names); + if (this.finally) + addNames(names, this.finally.names); + return names; + } +} +class Catch extends BlockNode { + constructor(error) { + super(); + this.error = error; + } + render(opts) { + return `catch(${this.error})` + super.render(opts); + } +} +Catch.kind = "catch"; +class Finally extends BlockNode { + render(opts) { + return "finally" + super.render(opts); + } +} +Finally.kind = "finally"; +class CodeGen { + constructor(extScope, opts = {}) { + this._values = {}; + this._blockStarts = []; + this._constants = {}; + this.opts = { ...opts, _n: opts.lines ? "\n" : "" }; + this._extScope = extScope; + this._scope = new scope_1.Scope({ parent: extScope }); + this._nodes = [new Root()]; + } + toString() { + return this._root.render(this.opts); + } + // returns unique name in the internal scope + name(prefix) { + return this._scope.name(prefix); + } + // reserves unique name in the external scope + scopeName(prefix) { + return this._extScope.name(prefix); + } + // reserves unique name in the external scope and assigns value to it + scopeValue(prefixOrName, value) { + const name = this._extScope.value(prefixOrName, value); + const vs = this._values[name.prefix] || (this._values[name.prefix] = new Set()); + vs.add(name); + return name; + } + getScopeValue(prefix, keyOrRef) { + return this._extScope.getValue(prefix, keyOrRef); + } + // return code that assigns values in the external scope to the names that are used internally + // (same names that were returned by gen.scopeName or gen.scopeValue) + scopeRefs(scopeName) { + return this._extScope.scopeRefs(scopeName, this._values); + } + scopeCode() { + return this._extScope.scopeCode(this._values); + } + _def(varKind, nameOrPrefix, rhs, constant) { + const name = this._scope.toName(nameOrPrefix); + if (rhs !== undefined && constant) + this._constants[name.str] = rhs; + this._leafNode(new Def(varKind, name, rhs)); + return name; + } + // `const` declaration (`var` in es5 mode) + const(nameOrPrefix, rhs, _constant) { + return this._def(scope_1.varKinds.const, nameOrPrefix, rhs, _constant); + } + // `let` declaration with optional assignment (`var` in es5 mode) + let(nameOrPrefix, rhs, _constant) { + return this._def(scope_1.varKinds.let, nameOrPrefix, rhs, _constant); + } + // `var` declaration with optional assignment + var(nameOrPrefix, rhs, _constant) { + return this._def(scope_1.varKinds.var, nameOrPrefix, rhs, _constant); + } + // assignment code + assign(lhs, rhs, sideEffects) { + return this._leafNode(new Assign(lhs, rhs, sideEffects)); + } + // `+=` code + add(lhs, rhs) { + return this._leafNode(new AssignOp(lhs, exports.operators.ADD, rhs)); + } + // appends passed SafeExpr to code or executes Block + code(c) { + if (typeof c == "function") + c(); + else if (c !== code_1.nil) + this._leafNode(new AnyCode(c)); + return this; + } + // returns code for object literal for the passed argument list of key-value pairs + object(...keyValues) { + const code = ["{"]; + for (const [key, value] of keyValues) { + if (code.length > 1) + code.push(","); + code.push(key); + if (key !== value || this.opts.es5) { + code.push(":"); + (0, code_1.addCodeArg)(code, value); + } + } + code.push("}"); + return new code_1._Code(code); + } + // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed) + if(condition, thenBody, elseBody) { + this._blockNode(new If(condition)); + if (thenBody && elseBody) { + this.code(thenBody).else().code(elseBody).endIf(); + } + else if (thenBody) { + this.code(thenBody).endIf(); + } + else if (elseBody) { + throw new Error('CodeGen: "else" body without "then" body'); + } + return this; + } + // `else if` clause - invalid without `if` or after `else` clauses + elseIf(condition) { + return this._elseNode(new If(condition)); + } + // `else` clause - only valid after `if` or `else if` clauses + else() { + return this._elseNode(new Else()); + } + // end `if` statement (needed if gen.if was used only with condition) + endIf() { + return this._endBlockNode(If, Else); + } + _for(node, forBody) { + this._blockNode(node); + if (forBody) + this.code(forBody).endFor(); + return this; + } + // a generic `for` clause (or statement if `forBody` is passed) + for(iteration, forBody) { + return this._for(new ForLoop(iteration), forBody); + } + // `for` statement for a range of values + forRange(nameOrPrefix, from, to, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.let) { + const name = this._scope.toName(nameOrPrefix); + return this._for(new ForRange(varKind, name, from, to), () => forBody(name)); + } + // `for-of` statement (in es5 mode replace with a normal for loop) + forOf(nameOrPrefix, iterable, forBody, varKind = scope_1.varKinds.const) { + const name = this._scope.toName(nameOrPrefix); + if (this.opts.es5) { + const arr = iterable instanceof code_1.Name ? iterable : this.var("_arr", iterable); + return this.forRange("_i", 0, (0, code_1._) `${arr}.length`, (i) => { + this.var(name, (0, code_1._) `${arr}[${i}]`); + forBody(name); + }); + } + return this._for(new ForIter("of", varKind, name, iterable), () => forBody(name)); + } + // `for-in` statement. + // With option `ownProperties` replaced with a `for-of` loop for object keys + forIn(nameOrPrefix, obj, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.const) { + if (this.opts.ownProperties) { + return this.forOf(nameOrPrefix, (0, code_1._) `Object.keys(${obj})`, forBody); + } + const name = this._scope.toName(nameOrPrefix); + return this._for(new ForIter("in", varKind, name, obj), () => forBody(name)); + } + // end `for` loop + endFor() { + return this._endBlockNode(For); + } + // `label` statement + label(label) { + return this._leafNode(new Label(label)); + } + // `break` statement + break(label) { + return this._leafNode(new Break(label)); + } + // `return` statement + return(value) { + const node = new Return(); + this._blockNode(node); + this.code(value); + if (node.nodes.length !== 1) + throw new Error('CodeGen: "return" should have one node'); + return this._endBlockNode(Return); + } + // `try` statement + try(tryBody, catchCode, finallyCode) { + if (!catchCode && !finallyCode) + throw new Error('CodeGen: "try" without "catch" and "finally"'); + const node = new Try(); + this._blockNode(node); + this.code(tryBody); + if (catchCode) { + const error = this.name("e"); + this._currNode = node.catch = new Catch(error); + catchCode(error); + } + if (finallyCode) { + this._currNode = node.finally = new Finally(); + this.code(finallyCode); + } + return this._endBlockNode(Catch, Finally); + } + // `throw` statement + throw(error) { + return this._leafNode(new Throw(error)); + } + // start self-balancing block + block(body, nodeCount) { + this._blockStarts.push(this._nodes.length); + if (body) + this.code(body).endBlock(nodeCount); + return this; + } + // end the current self-balancing block + endBlock(nodeCount) { + const len = this._blockStarts.pop(); + if (len === undefined) + throw new Error("CodeGen: not in self-balancing block"); + const toClose = this._nodes.length - len; + if (toClose < 0 || (nodeCount !== undefined && toClose !== nodeCount)) { + throw new Error(`CodeGen: wrong number of nodes: ${toClose} vs ${nodeCount} expected`); + } + this._nodes.length = len; + return this; + } + // `function` heading (or definition if funcBody is passed) + func(name, args = code_1.nil, async, funcBody) { + this._blockNode(new Func(name, args, async)); + if (funcBody) + this.code(funcBody).endFunc(); + return this; + } + // end function definition + endFunc() { + return this._endBlockNode(Func); + } + optimize(n = 1) { + while (n-- > 0) { + this._root.optimizeNodes(); + this._root.optimizeNames(this._root.names, this._constants); + } + } + _leafNode(node) { + this._currNode.nodes.push(node); + return this; + } + _blockNode(node) { + this._currNode.nodes.push(node); + this._nodes.push(node); + } + _endBlockNode(N1, N2) { + const n = this._currNode; + if (n instanceof N1 || (N2 && n instanceof N2)) { + this._nodes.pop(); + return this; + } + throw new Error(`CodeGen: not in block "${N2 ? `${N1.kind}/${N2.kind}` : N1.kind}"`); + } + _elseNode(node) { + const n = this._currNode; + if (!(n instanceof If)) { + throw new Error('CodeGen: "else" without "if"'); + } + this._currNode = n.else = node; + return this; + } + get _root() { + return this._nodes[0]; + } + get _currNode() { + const ns = this._nodes; + return ns[ns.length - 1]; + } + set _currNode(node) { + const ns = this._nodes; + ns[ns.length - 1] = node; + } +} +exports.CodeGen = CodeGen; +function addNames(names, from) { + for (const n in from) + names[n] = (names[n] || 0) + (from[n] || 0); + return names; +} +function addExprNames(names, from) { + return from instanceof code_1._CodeOrName ? addNames(names, from.names) : names; +} +function optimizeExpr(expr, names, constants) { + if (expr instanceof code_1.Name) + return replaceName(expr); + if (!canOptimize(expr)) + return expr; + return new code_1._Code(expr._items.reduce((items, c) => { + if (c instanceof code_1.Name) + c = replaceName(c); + if (c instanceof code_1._Code) + items.push(...c._items); + else + items.push(c); + return items; + }, [])); + function replaceName(n) { + const c = constants[n.str]; + if (c === undefined || names[n.str] !== 1) + return n; + delete names[n.str]; + return c; + } + function canOptimize(e) { + return (e instanceof code_1._Code && + e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants[c.str] !== undefined)); + } +} +function subtractNames(names, from) { + for (const n in from) + names[n] = (names[n] || 0) - (from[n] || 0); +} +function not(x) { + return typeof x == "boolean" || typeof x == "number" || x === null ? !x : (0, code_1._) `!${par(x)}`; +} +exports.not = not; +const andCode = mappend(exports.operators.AND); +// boolean AND (&&) expression with the passed arguments +function and(...args) { + return args.reduce(andCode); +} +exports.and = and; +const orCode = mappend(exports.operators.OR); +// boolean OR (||) expression with the passed arguments +function or(...args) { + return args.reduce(orCode); +} +exports.or = or; +function mappend(op) { + return (x, y) => (x === code_1.nil ? y : y === code_1.nil ? x : (0, code_1._) `${par(x)} ${op} ${par(y)}`); +} +function par(x) { + return x instanceof code_1.Name ? x : (0, code_1._) `(${x})`; +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/codegen/index.js.map b/front_end/third_party/mcp-sdk/ajv/dist/compile/codegen/index.js.map new file mode 100644 index 0000000000..baef9cff56 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/codegen/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/compile/codegen/index.ts"],"names":[],"mappings":";;;AACA,iCAA8F;AAC9F,mCAAuC;AAEvC,+BAA6F;AAArF,yFAAA,CAAC,OAAA;AAAE,2FAAA,GAAG,OAAA;AAAE,iGAAA,SAAS,OAAA;AAAE,2FAAA,GAAG,OAAA;AAAE,mGAAA,WAAW,OAAA;AAAE,iGAAA,SAAS,OAAA;AAAE,kGAAA,UAAU,OAAA;AAAE,4FAAA,IAAI,OAAA;AACxE,iCAA+F;AAAvF,8FAAA,KAAK,OAAA;AAAc,mGAAA,UAAU,OAAA;AAAE,uGAAA,cAAc,OAAA;AAAkB,iGAAA,QAAQ,OAAA;AAQlE,QAAA,SAAS,GAAG;IACvB,EAAE,EAAE,IAAI,YAAK,CAAC,GAAG,CAAC;IAClB,GAAG,EAAE,IAAI,YAAK,CAAC,IAAI,CAAC;IACpB,EAAE,EAAE,IAAI,YAAK,CAAC,GAAG,CAAC;IAClB,GAAG,EAAE,IAAI,YAAK,CAAC,IAAI,CAAC;IACp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CAAC,CAAC,CAAC,CAAC,KAAK,UAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAA,QAAC,EAAA,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;AACjF,CAAC;AAED,SAAS,GAAG,CAAC,CAAO;IAClB,OAAO,CAAC,YAAY,WAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAA,QAAC,EAAA,IAAI,CAAC,GAAG,CAAA;AAC1C,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/codegen/scope.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/compile/codegen/scope.d.ts new file mode 100644 index 0000000000..3d95305387 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/codegen/scope.d.ts @@ -0,0 +1,79 @@ +import { Code, Name } from "./code"; +interface NameGroup { + prefix: string; + index: number; +} +export interface NameValue { + ref: ValueReference; + key?: unknown; + code?: Code; +} +export type ValueReference = unknown; +interface ScopeOptions { + prefixes?: Set; + parent?: Scope; +} +interface ValueScopeOptions extends ScopeOptions { + scope: ScopeStore; + es5?: boolean; + lines?: boolean; +} +export type ScopeStore = Record; +type ScopeValues = { + [Prefix in string]?: Map; +}; +export type ScopeValueSets = { + [Prefix in string]?: Set; +}; +export declare enum UsedValueState { + Started = 0, + Completed = 1 +} +export type UsedScopeValues = { + [Prefix in string]?: Map; +}; +export declare const varKinds: { + const: Name; + let: Name; + var: Name; +}; +export declare class Scope { + protected readonly _names: { + [Prefix in string]?: NameGroup; + }; + protected readonly _prefixes?: Set; + protected readonly _parent?: Scope; + constructor({ prefixes, parent }?: ScopeOptions); + toName(nameOrPrefix: Name | string): Name; + name(prefix: string): Name; + protected _newName(prefix: string): string; + private _nameGroup; +} +interface ScopePath { + property: string; + itemIndex: number; +} +export declare class ValueScopeName extends Name { + readonly prefix: string; + value?: NameValue; + scopePath?: Code; + constructor(prefix: string, nameStr: string); + setValue(value: NameValue, { property, itemIndex }: ScopePath): void; +} +interface VSOptions extends ValueScopeOptions { + _n: Code; +} +export declare class ValueScope extends Scope { + protected readonly _values: ScopeValues; + protected readonly _scope: ScopeStore; + readonly opts: VSOptions; + constructor(opts: ValueScopeOptions); + get(): ScopeStore; + name(prefix: string): ValueScopeName; + value(nameOrPrefix: ValueScopeName | string, value: NameValue): ValueScopeName; + getValue(prefix: string, keyOrRef: unknown): ValueScopeName | undefined; + scopeRefs(scopeName: Name, values?: ScopeValues | ScopeValueSets): Code; + scopeCode(values?: ScopeValues | ScopeValueSets, usedValues?: UsedScopeValues, getCode?: (n: ValueScopeName) => Code | undefined): Code; + private _reduceValues; +} +export {}; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/codegen/scope.js b/front_end/third_party/mcp-sdk/ajv/dist/compile/codegen/scope.js new file mode 100644 index 0000000000..4bc7794e32 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/codegen/scope.js @@ -0,0 +1,143 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ValueScope = exports.ValueScopeName = exports.Scope = exports.varKinds = exports.UsedValueState = void 0; +const code_1 = require("./code"); +class ValueError extends Error { + constructor(name) { + super(`CodeGen: "code" for ${name} not defined`); + this.value = name.value; + } +} +var UsedValueState; +(function (UsedValueState) { + UsedValueState[UsedValueState["Started"] = 0] = "Started"; + UsedValueState[UsedValueState["Completed"] = 1] = "Completed"; +})(UsedValueState || (exports.UsedValueState = UsedValueState = {})); +exports.varKinds = { + const: new code_1.Name("const"), + let: new code_1.Name("let"), + var: new code_1.Name("var"), +}; +class Scope { + constructor({ prefixes, parent } = {}) { + this._names = {}; + this._prefixes = prefixes; + this._parent = parent; + } + toName(nameOrPrefix) { + return nameOrPrefix instanceof code_1.Name ? nameOrPrefix : this.name(nameOrPrefix); + } + name(prefix) { + return new code_1.Name(this._newName(prefix)); + } + _newName(prefix) { + const ng = this._names[prefix] || this._nameGroup(prefix); + return `${prefix}${ng.index++}`; + } + _nameGroup(prefix) { + var _a, _b; + if (((_b = (_a = this._parent) === null || _a === void 0 ? void 0 : _a._prefixes) === null || _b === void 0 ? void 0 : _b.has(prefix)) || (this._prefixes && !this._prefixes.has(prefix))) { + throw new Error(`CodeGen: prefix "${prefix}" is not allowed in this scope`); + } + return (this._names[prefix] = { prefix, index: 0 }); + } +} +exports.Scope = Scope; +class ValueScopeName extends code_1.Name { + constructor(prefix, nameStr) { + super(nameStr); + this.prefix = prefix; + } + setValue(value, { property, itemIndex }) { + this.value = value; + this.scopePath = (0, code_1._) `.${new code_1.Name(property)}[${itemIndex}]`; + } +} +exports.ValueScopeName = ValueScopeName; +const line = (0, code_1._) `\n`; +class ValueScope extends Scope { + constructor(opts) { + super(opts); + this._values = {}; + this._scope = opts.scope; + this.opts = { ...opts, _n: opts.lines ? line : code_1.nil }; + } + get() { + return this._scope; + } + name(prefix) { + return new ValueScopeName(prefix, this._newName(prefix)); + } + value(nameOrPrefix, value) { + var _a; + if (value.ref === undefined) + throw new Error("CodeGen: ref must be passed in value"); + const name = this.toName(nameOrPrefix); + const { prefix } = name; + const valueKey = (_a = value.key) !== null && _a !== void 0 ? _a : value.ref; + let vs = this._values[prefix]; + if (vs) { + const _name = vs.get(valueKey); + if (_name) + return _name; + } + else { + vs = this._values[prefix] = new Map(); + } + vs.set(valueKey, name); + const s = this._scope[prefix] || (this._scope[prefix] = []); + const itemIndex = s.length; + s[itemIndex] = value.ref; + name.setValue(value, { property: prefix, itemIndex }); + return name; + } + getValue(prefix, keyOrRef) { + const vs = this._values[prefix]; + if (!vs) + return; + return vs.get(keyOrRef); + } + scopeRefs(scopeName, values = this._values) { + return this._reduceValues(values, (name) => { + if (name.scopePath === undefined) + throw new Error(`CodeGen: name "${name}" has no value`); + return (0, code_1._) `${scopeName}${name.scopePath}`; + }); + } + scopeCode(values = this._values, usedValues, getCode) { + return this._reduceValues(values, (name) => { + if (name.value === undefined) + throw new Error(`CodeGen: name "${name}" has no value`); + return name.value.code; + }, usedValues, getCode); + } + _reduceValues(values, valueCode, usedValues = {}, getCode) { + let code = code_1.nil; + for (const prefix in values) { + const vs = values[prefix]; + if (!vs) + continue; + const nameSet = (usedValues[prefix] = usedValues[prefix] || new Map()); + vs.forEach((name) => { + if (nameSet.has(name)) + return; + nameSet.set(name, UsedValueState.Started); + let c = valueCode(name); + if (c) { + const def = this.opts.es5 ? exports.varKinds.var : exports.varKinds.const; + code = (0, code_1._) `${code}${def} ${name} = ${c};${this.opts._n}`; + } + else if ((c = getCode === null || getCode === void 0 ? void 0 : getCode(name))) { + code = (0, code_1._) `${code}${c}${this.opts._n}`; + } + else { + throw new ValueError(name); + } + nameSet.set(name, UsedValueState.Completed); + }); + } + return code; + } +} +exports.ValueScope = ValueScope; +//# sourceMappingURL=scope.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/codegen/scope.js.map b/front_end/third_party/mcp-sdk/ajv/dist/compile/codegen/scope.js.map new file mode 100644 index 0000000000..911769f871 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/codegen/scope.js.map @@ -0,0 +1 @@ +{"version":3,"file":"scope.js","sourceRoot":"","sources":["../../../lib/compile/codegen/scope.ts"],"names":[],"mappings":";;;AAAA,iCAAyC;AAezC,MAAM,UAAW,SAAQ,KAAK;IAE5B,YAAY,IAAoB;QAC9B,KAAK,CAAC,uBAAuB,IAAI,cAAc,CAAC,CAAA;QAChD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;IACzB,CAAC;CACF;AAuBD,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,yDAAO,CAAA;IACP,6DAAS,CAAA;AACX,CAAC,EAHW,cAAc,8BAAd,cAAc,QAGzB;AAMY,QAAA,QAAQ,GAAG;IACtB,KAAK,EAAE,IAAI,WAAI,CAAC,OAAO,CAAC;IACxB,GAAG,EAAE,IAAI,WAAI,CAAC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C,CAAC,gBAAQ,CAAC,KAAK,CAAA;oBACzD,IAAI,GAAG,IAAA,QAAC,EAAA,GAAG,IAAI,GAAG,GAAG,IAAI,IAAI,MAAM,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAA;gBACxD,CAAC;qBAAM,IAAI,CAAC,CAAC,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,IAAI,CAAC,CAAC,EAAE,CAAC;oBACjC,IAAI,GAAG,IAAA,QAAC,EAAA,GAAG,IAAI,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAA;gBACtC,CAAC;qBAAM,CAAC;oBACN,MAAM,IAAI,UAAU,CAAC,IAAI,CAAC,CAAA;gBAC5B,CAAC;gBACD,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,cAAc,CAAC,SAAS,CAAC,CAAA;YAC7C,CAAC,CAAC,CAAA;QACJ,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AAjGD,gCAiGC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/errors.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/compile/errors.d.ts new file mode 100644 index 0000000000..74eef7e21f --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/errors.d.ts @@ -0,0 +1,13 @@ +import type { KeywordErrorCxt, KeywordErrorDefinition } from "../types"; +import { CodeGen, Code, Name } from "./codegen"; +export declare const keywordError: KeywordErrorDefinition; +export declare const keyword$DataError: KeywordErrorDefinition; +export interface ErrorPaths { + instancePath?: Code; + schemaPath?: string; + parentSchema?: boolean; +} +export declare function reportError(cxt: KeywordErrorCxt, error?: KeywordErrorDefinition, errorPaths?: ErrorPaths, overrideAllErrors?: boolean): void; +export declare function reportExtraError(cxt: KeywordErrorCxt, error?: KeywordErrorDefinition, errorPaths?: ErrorPaths): void; +export declare function resetErrorsCount(gen: CodeGen, errsCount: Name): void; +export declare function extendErrors({ gen, keyword, schemaValue, data, errsCount, it, }: KeywordErrorCxt): void; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/errors.js b/front_end/third_party/mcp-sdk/ajv/dist/compile/errors.js new file mode 100644 index 0000000000..24d721d80e --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/errors.js @@ -0,0 +1,123 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.extendErrors = exports.resetErrorsCount = exports.reportExtraError = exports.reportError = exports.keyword$DataError = exports.keywordError = void 0; +const codegen_1 = require("./codegen"); +const util_1 = require("./util"); +const names_1 = require("./names"); +exports.keywordError = { + message: ({ keyword }) => (0, codegen_1.str) `must pass "${keyword}" keyword validation`, +}; +exports.keyword$DataError = { + message: ({ keyword, schemaType }) => schemaType + ? (0, codegen_1.str) `"${keyword}" keyword must be ${schemaType} ($data)` + : (0, codegen_1.str) `"${keyword}" keyword is invalid ($data)`, +}; +function reportError(cxt, error = exports.keywordError, errorPaths, overrideAllErrors) { + const { it } = cxt; + const { gen, compositeRule, allErrors } = it; + const errObj = errorObjectCode(cxt, error, errorPaths); + if (overrideAllErrors !== null && overrideAllErrors !== void 0 ? overrideAllErrors : (compositeRule || allErrors)) { + addError(gen, errObj); + } + else { + returnErrors(it, (0, codegen_1._) `[${errObj}]`); + } +} +exports.reportError = reportError; +function reportExtraError(cxt, error = exports.keywordError, errorPaths) { + const { it } = cxt; + const { gen, compositeRule, allErrors } = it; + const errObj = errorObjectCode(cxt, error, errorPaths); + addError(gen, errObj); + if (!(compositeRule || allErrors)) { + returnErrors(it, names_1.default.vErrors); + } +} +exports.reportExtraError = reportExtraError; +function resetErrorsCount(gen, errsCount) { + gen.assign(names_1.default.errors, errsCount); + gen.if((0, codegen_1._) `${names_1.default.vErrors} !== null`, () => gen.if(errsCount, () => gen.assign((0, codegen_1._) `${names_1.default.vErrors}.length`, errsCount), () => gen.assign(names_1.default.vErrors, null))); +} +exports.resetErrorsCount = resetErrorsCount; +function extendErrors({ gen, keyword, schemaValue, data, errsCount, it, }) { + /* istanbul ignore if */ + if (errsCount === undefined) + throw new Error("ajv implementation error"); + const err = gen.name("err"); + gen.forRange("i", errsCount, names_1.default.errors, (i) => { + gen.const(err, (0, codegen_1._) `${names_1.default.vErrors}[${i}]`); + gen.if((0, codegen_1._) `${err}.instancePath === undefined`, () => gen.assign((0, codegen_1._) `${err}.instancePath`, (0, codegen_1.strConcat)(names_1.default.instancePath, it.errorPath))); + gen.assign((0, codegen_1._) `${err}.schemaPath`, (0, codegen_1.str) `${it.errSchemaPath}/${keyword}`); + if (it.opts.verbose) { + gen.assign((0, codegen_1._) `${err}.schema`, schemaValue); + gen.assign((0, codegen_1._) `${err}.data`, data); + } + }); +} +exports.extendErrors = extendErrors; +function addError(gen, errObj) { + const err = gen.const("err", errObj); + gen.if((0, codegen_1._) `${names_1.default.vErrors} === null`, () => gen.assign(names_1.default.vErrors, (0, codegen_1._) `[${err}]`), (0, codegen_1._) `${names_1.default.vErrors}.push(${err})`); + gen.code((0, codegen_1._) `${names_1.default.errors}++`); +} +function returnErrors(it, errs) { + const { gen, validateName, schemaEnv } = it; + if (schemaEnv.$async) { + gen.throw((0, codegen_1._) `new ${it.ValidationError}(${errs})`); + } + else { + gen.assign((0, codegen_1._) `${validateName}.errors`, errs); + gen.return(false); + } +} +const E = { + keyword: new codegen_1.Name("keyword"), + schemaPath: new codegen_1.Name("schemaPath"), // also used in JTD errors + params: new codegen_1.Name("params"), + propertyName: new codegen_1.Name("propertyName"), + message: new codegen_1.Name("message"), + schema: new codegen_1.Name("schema"), + parentSchema: new codegen_1.Name("parentSchema"), +}; +function errorObjectCode(cxt, error, errorPaths) { + const { createErrors } = cxt.it; + if (createErrors === false) + return (0, codegen_1._) `{}`; + return errorObject(cxt, error, errorPaths); +} +function errorObject(cxt, error, errorPaths = {}) { + const { gen, it } = cxt; + const keyValues = [ + errorInstancePath(it, errorPaths), + errorSchemaPath(cxt, errorPaths), + ]; + extraErrorProps(cxt, error, keyValues); + return gen.object(...keyValues); +} +function errorInstancePath({ errorPath }, { instancePath }) { + const instPath = instancePath + ? (0, codegen_1.str) `${errorPath}${(0, util_1.getErrorPath)(instancePath, util_1.Type.Str)}` + : errorPath; + return [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, instPath)]; +} +function errorSchemaPath({ keyword, it: { errSchemaPath } }, { schemaPath, parentSchema }) { + let schPath = parentSchema ? errSchemaPath : (0, codegen_1.str) `${errSchemaPath}/${keyword}`; + if (schemaPath) { + schPath = (0, codegen_1.str) `${schPath}${(0, util_1.getErrorPath)(schemaPath, util_1.Type.Str)}`; + } + return [E.schemaPath, schPath]; +} +function extraErrorProps(cxt, { params, message }, keyValues) { + const { keyword, data, schemaValue, it } = cxt; + const { opts, propertyName, topSchemaRef, schemaPath } = it; + keyValues.push([E.keyword, keyword], [E.params, typeof params == "function" ? params(cxt) : params || (0, codegen_1._) `{}`]); + if (opts.messages) { + keyValues.push([E.message, typeof message == "function" ? message(cxt) : message]); + } + if (opts.verbose) { + keyValues.push([E.schema, schemaValue], [E.parentSchema, (0, codegen_1._) `${topSchemaRef}${schemaPath}`], [names_1.default.data, data]); + } + if (propertyName) + keyValues.push([E.propertyName, propertyName]); +} +//# sourceMappingURL=errors.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/errors.js.map b/front_end/third_party/mcp-sdk/ajv/dist/compile/errors.js.map new file mode 100644 index 0000000000..ea08e4e311 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/errors.js.map @@ -0,0 +1 @@ +{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../lib/compile/errors.ts"],"names":[],"mappings":";;;AAEA,uCAAgE;AAEhE,iCAAyC;AACzC,mCAAuB;AAEV,QAAA,YAAY,GAA2B;IAClD,OAAO,EAAE,CAAC,EAAC,OAAO,EAAC,EAAE,EAAE,CAAC,IAAA,aAAG,EAAA,cAAc,OAAO,sBAAsB;CACvE,CAA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AU,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,IAAI,IAAA,WAAC,EAAA,IAAI,CAAC,CACxE,CAAA;IACD,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;QAClB,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,OAAO,OAAO,IAAI,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAA;IACpF,CAAC;IACD,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QACjB,SAAS,CAAC,IAAI,CACZ,CAAC,CAAC,CAAC,MAAM,EAAE,WAAW,CAAC,EACvB,CAAC,CAAC,CAAC,YAAY,EAAE,IAAA,WAAC,EAAA,GAAG,YAAY,GAAG,UAAU,EAAE,CAAC,EACjD,CAAC,eAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CACf,CAAA;IACH,CAAC;IACD,IAAI,YAAY;QAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC,CAAA;AAClE,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/index.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/compile/index.d.ts new file mode 100644 index 0000000000..2809353d73 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/index.d.ts @@ -0,0 +1,80 @@ +import type { AnySchema, AnySchemaObject, AnyValidateFunction, EvaluatedProperties, EvaluatedItems } from "../types"; +import type Ajv from "../core"; +import type { InstanceOptions } from "../core"; +import { CodeGen, Name, Code, ValueScopeName } from "./codegen"; +import { LocalRefs } from "./resolve"; +import { JSONType } from "./rules"; +export type SchemaRefs = { + [Ref in string]?: SchemaEnv | AnySchema; +}; +export interface SchemaCxt { + readonly gen: CodeGen; + readonly allErrors?: boolean; + readonly data: Name; + readonly parentData: Name; + readonly parentDataProperty: Code | number; + readonly dataNames: Name[]; + readonly dataPathArr: (Code | number)[]; + readonly dataLevel: number; + dataTypes: JSONType[]; + definedProperties: Set; + readonly topSchemaRef: Code; + readonly validateName: Name; + evaluated?: Name; + readonly ValidationError?: Name; + readonly schema: AnySchema; + readonly schemaEnv: SchemaEnv; + readonly rootId: string; + baseId: string; + readonly schemaPath: Code; + readonly errSchemaPath: string; + readonly errorPath: Code; + readonly propertyName?: Name; + readonly compositeRule?: boolean; + props?: EvaluatedProperties | Name; + items?: EvaluatedItems | Name; + jtdDiscriminator?: string; + jtdMetadata?: boolean; + readonly createErrors?: boolean; + readonly opts: InstanceOptions; + readonly self: Ajv; +} +export interface SchemaObjCxt extends SchemaCxt { + readonly schema: AnySchemaObject; +} +interface SchemaEnvArgs { + readonly schema: AnySchema; + readonly schemaId?: "$id" | "id"; + readonly root?: SchemaEnv; + readonly baseId?: string; + readonly schemaPath?: string; + readonly localRefs?: LocalRefs; + readonly meta?: boolean; +} +export declare class SchemaEnv implements SchemaEnvArgs { + readonly schema: AnySchema; + readonly schemaId?: "$id" | "id"; + readonly root: SchemaEnv; + baseId: string; + schemaPath?: string; + localRefs?: LocalRefs; + readonly meta?: boolean; + readonly $async?: boolean; + readonly refs: SchemaRefs; + readonly dynamicAnchors: { + [Ref in string]?: true; + }; + validate?: AnyValidateFunction; + validateName?: ValueScopeName; + serialize?: (data: unknown) => string; + serializeName?: ValueScopeName; + parse?: (data: string) => unknown; + parseName?: ValueScopeName; + constructor(env: SchemaEnvArgs); +} +export declare function compileSchema(this: Ajv, sch: SchemaEnv): SchemaEnv; +export declare function resolveRef(this: Ajv, root: SchemaEnv, baseId: string, ref: string): AnySchema | SchemaEnv | undefined; +export declare function getCompilingSchema(this: Ajv, schEnv: SchemaEnv): SchemaEnv | void; +export declare function resolveSchema(this: Ajv, root: SchemaEnv, // root object with properties schema, refs TODO below SchemaEnv is assigned to it +ref: string): SchemaEnv | undefined; +export {}; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/index.js b/front_end/third_party/mcp-sdk/ajv/dist/compile/index.js new file mode 100644 index 0000000000..9e42a55880 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/index.js @@ -0,0 +1,242 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolveSchema = exports.getCompilingSchema = exports.resolveRef = exports.compileSchema = exports.SchemaEnv = void 0; +const codegen_1 = require("./codegen"); +const validation_error_1 = require("../runtime/validation_error"); +const names_1 = require("./names"); +const resolve_1 = require("./resolve"); +const util_1 = require("./util"); +const validate_1 = require("./validate"); +class SchemaEnv { + constructor(env) { + var _a; + this.refs = {}; + this.dynamicAnchors = {}; + let schema; + if (typeof env.schema == "object") + schema = env.schema; + this.schema = env.schema; + this.schemaId = env.schemaId; + this.root = env.root || this; + this.baseId = (_a = env.baseId) !== null && _a !== void 0 ? _a : (0, resolve_1.normalizeId)(schema === null || schema === void 0 ? void 0 : schema[env.schemaId || "$id"]); + this.schemaPath = env.schemaPath; + this.localRefs = env.localRefs; + this.meta = env.meta; + this.$async = schema === null || schema === void 0 ? void 0 : schema.$async; + this.refs = {}; + } +} +exports.SchemaEnv = SchemaEnv; +// let codeSize = 0 +// let nodeCount = 0 +// Compiles schema in SchemaEnv +function compileSchema(sch) { + // TODO refactor - remove compilations + const _sch = getCompilingSchema.call(this, sch); + if (_sch) + return _sch; + const rootId = (0, resolve_1.getFullPath)(this.opts.uriResolver, sch.root.baseId); // TODO if getFullPath removed 1 tests fails + const { es5, lines } = this.opts.code; + const { ownProperties } = this.opts; + const gen = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties }); + let _ValidationError; + if (sch.$async) { + _ValidationError = gen.scopeValue("Error", { + ref: validation_error_1.default, + code: (0, codegen_1._) `require("ajv/dist/runtime/validation_error").default`, + }); + } + const validateName = gen.scopeName("validate"); + sch.validateName = validateName; + const schemaCxt = { + gen, + allErrors: this.opts.allErrors, + data: names_1.default.data, + parentData: names_1.default.parentData, + parentDataProperty: names_1.default.parentDataProperty, + dataNames: [names_1.default.data], + dataPathArr: [codegen_1.nil], // TODO can its length be used as dataLevel if nil is removed? + dataLevel: 0, + dataTypes: [], + definedProperties: new Set(), + topSchemaRef: gen.scopeValue("schema", this.opts.code.source === true + ? { ref: sch.schema, code: (0, codegen_1.stringify)(sch.schema) } + : { ref: sch.schema }), + validateName, + ValidationError: _ValidationError, + schema: sch.schema, + schemaEnv: sch, + rootId, + baseId: sch.baseId || rootId, + schemaPath: codegen_1.nil, + errSchemaPath: sch.schemaPath || (this.opts.jtd ? "" : "#"), + errorPath: (0, codegen_1._) `""`, + opts: this.opts, + self: this, + }; + let sourceCode; + try { + this._compilations.add(sch); + (0, validate_1.validateFunctionCode)(schemaCxt); + gen.optimize(this.opts.code.optimize); + // gen.optimize(1) + const validateCode = gen.toString(); + sourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${validateCode}`; + // console.log((codeSize += sourceCode.length), (nodeCount += gen.nodeCount)) + if (this.opts.code.process) + sourceCode = this.opts.code.process(sourceCode, sch); + // console.log("\n\n\n *** \n", sourceCode) + const makeValidate = new Function(`${names_1.default.self}`, `${names_1.default.scope}`, sourceCode); + const validate = makeValidate(this, this.scope.get()); + this.scope.value(validateName, { ref: validate }); + validate.errors = null; + validate.schema = sch.schema; + validate.schemaEnv = sch; + if (sch.$async) + validate.$async = true; + if (this.opts.code.source === true) { + validate.source = { validateName, validateCode, scopeValues: gen._values }; + } + if (this.opts.unevaluated) { + const { props, items } = schemaCxt; + validate.evaluated = { + props: props instanceof codegen_1.Name ? undefined : props, + items: items instanceof codegen_1.Name ? undefined : items, + dynamicProps: props instanceof codegen_1.Name, + dynamicItems: items instanceof codegen_1.Name, + }; + if (validate.source) + validate.source.evaluated = (0, codegen_1.stringify)(validate.evaluated); + } + sch.validate = validate; + return sch; + } + catch (e) { + delete sch.validate; + delete sch.validateName; + if (sourceCode) + this.logger.error("Error compiling schema, function code:", sourceCode); + // console.log("\n\n\n *** \n", sourceCode, this.opts) + throw e; + } + finally { + this._compilations.delete(sch); + } +} +exports.compileSchema = compileSchema; +function resolveRef(root, baseId, ref) { + var _a; + ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, ref); + const schOrFunc = root.refs[ref]; + if (schOrFunc) + return schOrFunc; + let _sch = resolve.call(this, root, ref); + if (_sch === undefined) { + const schema = (_a = root.localRefs) === null || _a === void 0 ? void 0 : _a[ref]; // TODO maybe localRefs should hold SchemaEnv + const { schemaId } = this.opts; + if (schema) + _sch = new SchemaEnv({ schema, schemaId, root, baseId }); + } + if (_sch === undefined) + return; + return (root.refs[ref] = inlineOrCompile.call(this, _sch)); +} +exports.resolveRef = resolveRef; +function inlineOrCompile(sch) { + if ((0, resolve_1.inlineRef)(sch.schema, this.opts.inlineRefs)) + return sch.schema; + return sch.validate ? sch : compileSchema.call(this, sch); +} +// Index of schema compilation in the currently compiled list +function getCompilingSchema(schEnv) { + for (const sch of this._compilations) { + if (sameSchemaEnv(sch, schEnv)) + return sch; + } +} +exports.getCompilingSchema = getCompilingSchema; +function sameSchemaEnv(s1, s2) { + return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId; +} +// resolve and compile the references ($ref) +// TODO returns AnySchemaObject (if the schema can be inlined) or validation function +function resolve(root, // information about the root schema for the current schema +ref // reference to resolve +) { + let sch; + while (typeof (sch = this.refs[ref]) == "string") + ref = sch; + return sch || this.schemas[ref] || resolveSchema.call(this, root, ref); +} +// Resolve schema, its root and baseId +function resolveSchema(root, // root object with properties schema, refs TODO below SchemaEnv is assigned to it +ref // reference to resolve +) { + const p = this.opts.uriResolver.parse(ref); + const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver, p); + let baseId = (0, resolve_1.getFullPath)(this.opts.uriResolver, root.baseId, undefined); + // TODO `Object.keys(root.schema).length > 0` should not be needed - but removing breaks 2 tests + if (Object.keys(root.schema).length > 0 && refPath === baseId) { + return getJsonPointer.call(this, p, root); + } + const id = (0, resolve_1.normalizeId)(refPath); + const schOrRef = this.refs[id] || this.schemas[id]; + if (typeof schOrRef == "string") { + const sch = resolveSchema.call(this, root, schOrRef); + if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== "object") + return; + return getJsonPointer.call(this, p, sch); + } + if (typeof (schOrRef === null || schOrRef === void 0 ? void 0 : schOrRef.schema) !== "object") + return; + if (!schOrRef.validate) + compileSchema.call(this, schOrRef); + if (id === (0, resolve_1.normalizeId)(ref)) { + const { schema } = schOrRef; + const { schemaId } = this.opts; + const schId = schema[schemaId]; + if (schId) + baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId); + return new SchemaEnv({ schema, schemaId, root, baseId }); + } + return getJsonPointer.call(this, p, schOrRef); +} +exports.resolveSchema = resolveSchema; +const PREVENT_SCOPE_CHANGE = new Set([ + "properties", + "patternProperties", + "enum", + "dependencies", + "definitions", +]); +function getJsonPointer(parsedRef, { baseId, schema, root }) { + var _a; + if (((_a = parsedRef.fragment) === null || _a === void 0 ? void 0 : _a[0]) !== "/") + return; + for (const part of parsedRef.fragment.slice(1).split("/")) { + if (typeof schema === "boolean") + return; + const partSchema = schema[(0, util_1.unescapeFragment)(part)]; + if (partSchema === undefined) + return; + schema = partSchema; + // TODO PREVENT_SCOPE_CHANGE could be defined in keyword def? + const schId = typeof schema === "object" && schema[this.opts.schemaId]; + if (!PREVENT_SCOPE_CHANGE.has(part) && schId) { + baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId); + } + } + let env; + if (typeof schema != "boolean" && schema.$ref && !(0, util_1.schemaHasRulesButRef)(schema, this.RULES)) { + const $ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schema.$ref); + env = resolveSchema.call(this, root, $ref); + } + // even though resolution failed we need to return SchemaEnv to throw exception + // so that compileAsync loads missing schema. + const { schemaId } = this.opts; + env = env || new SchemaEnv({ schema, schemaId, root, baseId }); + if (env.schema !== env.root.schema) + return env; + return undefined; +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/index.js.map b/front_end/third_party/mcp-sdk/ajv/dist/compile/index.js.map new file mode 100644 index 0000000000..22dcc0bb61 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/compile/index.ts"],"names":[],"mappings":";;;AAUA,uCAAgF;AAChF,kEAAyD;AACzD,mCAAuB;AACvB,uCAAkG;AAClG,iCAA6D;AAC7D,yCAA+C;AA0D/C,MAAa,SAAS;IAkBpB,YAAY,GAAkB;;QATrB,SAAI,GAAe,EAAE,CAAA;QACrB,mBAAc,GAA6B,EAAE,CAAA;QASpD,IAAI,MAAmC,CAAA;QACvC,IAAI,OAAO,GAAG,CAAC,MAAM,IAAI,QAAQ;YAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAA;QACtD,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM,CAAA;QACxB,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAA;QAC5B,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,IAAI,IAAI,CAAA;QAC5B,IAAI,CAAC,MAAM,GAAG,MAAA,GAAG,CAAC,MAAM,mCAAI,IAAA,qBAAW,EAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAG,GAAG,CAAC,QAAQ,IAAI,KAAK,CAAC,CAAC,CAAA;QACxE,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC,UAAU,CAAA;QAChC,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC,SAAS,CAAA;QAC9B,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAA;QACpB,IAAI,CAAC,MAAM,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,CAAA;QAC5B,IAAI,CAAC,IAAI,GAAG,EAAE,CAAA;IAChB,CAAC;CACF;AA/BD,8BA+BC;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I,CAAC,MAAM;QAAE,OAAO,GAAG,CAAA;IAC9C,OAAO,SAAS,CAAA;AAClB,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/jtd/parse.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/compile/jtd/parse.d.ts new file mode 100644 index 0000000000..618c64aea0 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/jtd/parse.d.ts @@ -0,0 +1,4 @@ +import type Ajv from "../../core"; +import { SchemaObjectMap } from "./types"; +import { SchemaEnv } from ".."; +export default function compileParser(this: Ajv, sch: SchemaEnv, definitions: SchemaObjectMap): SchemaEnv; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/jtd/parse.js b/front_end/third_party/mcp-sdk/ajv/dist/compile/jtd/parse.js new file mode 100644 index 0000000000..8fc94fd0ea --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/jtd/parse.js @@ -0,0 +1,350 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const types_1 = require("./types"); +const __1 = require(".."); +const codegen_1 = require("../codegen"); +const ref_error_1 = require("../ref_error"); +const names_1 = require("../names"); +const code_1 = require("../../vocabularies/code"); +const ref_1 = require("../../vocabularies/jtd/ref"); +const type_1 = require("../../vocabularies/jtd/type"); +const parseJson_1 = require("../../runtime/parseJson"); +const util_1 = require("../util"); +const timestamp_1 = require("../../runtime/timestamp"); +const genParse = { + elements: parseElements, + values: parseValues, + discriminator: parseDiscriminator, + properties: parseProperties, + optionalProperties: parseProperties, + enum: parseEnum, + type: parseType, + ref: parseRef, +}; +function compileParser(sch, definitions) { + const _sch = __1.getCompilingSchema.call(this, sch); + if (_sch) + return _sch; + const { es5, lines } = this.opts.code; + const { ownProperties } = this.opts; + const gen = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties }); + const parseName = gen.scopeName("parse"); + const cxt = { + self: this, + gen, + schema: sch.schema, + schemaEnv: sch, + definitions, + data: names_1.default.data, + parseName, + char: gen.name("c"), + }; + let sourceCode; + try { + this._compilations.add(sch); + sch.parseName = parseName; + parserFunction(cxt); + gen.optimize(this.opts.code.optimize); + const parseFuncCode = gen.toString(); + sourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${parseFuncCode}`; + const makeParse = new Function(`${names_1.default.scope}`, sourceCode); + const parse = makeParse(this.scope.get()); + this.scope.value(parseName, { ref: parse }); + sch.parse = parse; + } + catch (e) { + if (sourceCode) + this.logger.error("Error compiling parser, function code:", sourceCode); + delete sch.parse; + delete sch.parseName; + throw e; + } + finally { + this._compilations.delete(sch); + } + return sch; +} +exports.default = compileParser; +const undef = (0, codegen_1._) `undefined`; +function parserFunction(cxt) { + const { gen, parseName, char } = cxt; + gen.func(parseName, (0, codegen_1._) `${names_1.default.json}, ${names_1.default.jsonPos}, ${names_1.default.jsonPart}`, false, () => { + gen.let(names_1.default.data); + gen.let(char); + gen.assign((0, codegen_1._) `${parseName}.message`, undef); + gen.assign((0, codegen_1._) `${parseName}.position`, undef); + gen.assign(names_1.default.jsonPos, (0, codegen_1._) `${names_1.default.jsonPos} || 0`); + gen.const(names_1.default.jsonLen, (0, codegen_1._) `${names_1.default.json}.length`); + parseCode(cxt); + skipWhitespace(cxt); + gen.if(names_1.default.jsonPart, () => { + gen.assign((0, codegen_1._) `${parseName}.position`, names_1.default.jsonPos); + gen.return(names_1.default.data); + }); + gen.if((0, codegen_1._) `${names_1.default.jsonPos} === ${names_1.default.jsonLen}`, () => gen.return(names_1.default.data)); + jsonSyntaxError(cxt); + }); +} +function parseCode(cxt) { + let form; + for (const key of types_1.jtdForms) { + if (key in cxt.schema) { + form = key; + break; + } + } + if (form) + parseNullable(cxt, genParse[form]); + else + parseEmpty(cxt); +} +const parseBoolean = parseBooleanToken(true, parseBooleanToken(false, jsonSyntaxError)); +function parseNullable(cxt, parseForm) { + const { gen, schema, data } = cxt; + if (!schema.nullable) + return parseForm(cxt); + tryParseToken(cxt, "null", parseForm, () => gen.assign(data, null)); +} +function parseElements(cxt) { + const { gen, schema, data } = cxt; + parseToken(cxt, "["); + const ix = gen.let("i", 0); + gen.assign(data, (0, codegen_1._) `[]`); + parseItems(cxt, "]", () => { + const el = gen.let("el"); + parseCode({ ...cxt, schema: schema.elements, data: el }); + gen.assign((0, codegen_1._) `${data}[${ix}++]`, el); + }); +} +function parseValues(cxt) { + const { gen, schema, data } = cxt; + parseToken(cxt, "{"); + gen.assign(data, (0, codegen_1._) `{}`); + parseItems(cxt, "}", () => parseKeyValue(cxt, schema.values)); +} +function parseItems(cxt, endToken, block) { + tryParseItems(cxt, endToken, block); + parseToken(cxt, endToken); +} +function tryParseItems(cxt, endToken, block) { + const { gen } = cxt; + gen.for((0, codegen_1._) `;${names_1.default.jsonPos}<${names_1.default.jsonLen} && ${jsonSlice(1)}!==${endToken};`, () => { + block(); + tryParseToken(cxt, ",", () => gen.break(), hasItem); + }); + function hasItem() { + tryParseToken(cxt, endToken, () => { }, jsonSyntaxError); + } +} +function parseKeyValue(cxt, schema) { + const { gen } = cxt; + const key = gen.let("key"); + parseString({ ...cxt, data: key }); + parseToken(cxt, ":"); + parsePropertyValue(cxt, key, schema); +} +function parseDiscriminator(cxt) { + const { gen, data, schema } = cxt; + const { discriminator, mapping } = schema; + parseToken(cxt, "{"); + gen.assign(data, (0, codegen_1._) `{}`); + const startPos = gen.const("pos", names_1.default.jsonPos); + const value = gen.let("value"); + const tag = gen.let("tag"); + tryParseItems(cxt, "}", () => { + const key = gen.let("key"); + parseString({ ...cxt, data: key }); + parseToken(cxt, ":"); + gen.if((0, codegen_1._) `${key} === ${discriminator}`, () => { + parseString({ ...cxt, data: tag }); + gen.assign((0, codegen_1._) `${data}[${key}]`, tag); + gen.break(); + }, () => parseEmpty({ ...cxt, data: value }) // can be discarded/skipped + ); + }); + gen.assign(names_1.default.jsonPos, startPos); + gen.if((0, codegen_1._) `${tag} === undefined`); + parsingError(cxt, (0, codegen_1.str) `discriminator tag not found`); + for (const tagValue in mapping) { + gen.elseIf((0, codegen_1._) `${tag} === ${tagValue}`); + parseSchemaProperties({ ...cxt, schema: mapping[tagValue] }, discriminator); + } + gen.else(); + parsingError(cxt, (0, codegen_1.str) `discriminator value not in schema`); + gen.endIf(); +} +function parseProperties(cxt) { + const { gen, data } = cxt; + parseToken(cxt, "{"); + gen.assign(data, (0, codegen_1._) `{}`); + parseSchemaProperties(cxt); +} +function parseSchemaProperties(cxt, discriminator) { + const { gen, schema, data } = cxt; + const { properties, optionalProperties, additionalProperties } = schema; + parseItems(cxt, "}", () => { + const key = gen.let("key"); + parseString({ ...cxt, data: key }); + parseToken(cxt, ":"); + gen.if(false); + parseDefinedProperty(cxt, key, properties); + parseDefinedProperty(cxt, key, optionalProperties); + if (discriminator) { + gen.elseIf((0, codegen_1._) `${key} === ${discriminator}`); + const tag = gen.let("tag"); + parseString({ ...cxt, data: tag }); // can be discarded, it is already assigned + } + gen.else(); + if (additionalProperties) { + parseEmpty({ ...cxt, data: (0, codegen_1._) `${data}[${key}]` }); + } + else { + parsingError(cxt, (0, codegen_1.str) `property ${key} not allowed`); + } + gen.endIf(); + }); + if (properties) { + const hasProp = (0, code_1.hasPropFunc)(gen); + const allProps = (0, codegen_1.and)(...Object.keys(properties).map((p) => (0, codegen_1._) `${hasProp}.call(${data}, ${p})`)); + gen.if((0, codegen_1.not)(allProps), () => parsingError(cxt, (0, codegen_1.str) `missing required properties`)); + } +} +function parseDefinedProperty(cxt, key, schemas = {}) { + const { gen } = cxt; + for (const prop in schemas) { + gen.elseIf((0, codegen_1._) `${key} === ${prop}`); + parsePropertyValue(cxt, key, schemas[prop]); + } +} +function parsePropertyValue(cxt, key, schema) { + parseCode({ ...cxt, schema, data: (0, codegen_1._) `${cxt.data}[${key}]` }); +} +function parseType(cxt) { + const { gen, schema, data, self } = cxt; + switch (schema.type) { + case "boolean": + parseBoolean(cxt); + break; + case "string": + parseString(cxt); + break; + case "timestamp": { + parseString(cxt); + const vts = (0, util_1.useFunc)(gen, timestamp_1.default); + const { allowDate, parseDate } = self.opts; + const notValid = allowDate ? (0, codegen_1._) `!${vts}(${data}, true)` : (0, codegen_1._) `!${vts}(${data})`; + const fail = parseDate + ? (0, codegen_1.or)(notValid, (0, codegen_1._) `(${data} = new Date(${data}), false)`, (0, codegen_1._) `isNaN(${data}.valueOf())`) + : notValid; + gen.if(fail, () => parsingError(cxt, (0, codegen_1.str) `invalid timestamp`)); + break; + } + case "float32": + case "float64": + parseNumber(cxt); + break; + default: { + const t = schema.type; + if (!self.opts.int32range && (t === "int32" || t === "uint32")) { + parseNumber(cxt, 16); // 2 ** 53 - max safe integer + if (t === "uint32") { + gen.if((0, codegen_1._) `${data} < 0`, () => parsingError(cxt, (0, codegen_1.str) `integer out of range`)); + } + } + else { + const [min, max, maxDigits] = type_1.intRange[t]; + parseNumber(cxt, maxDigits); + gen.if((0, codegen_1._) `${data} < ${min} || ${data} > ${max}`, () => parsingError(cxt, (0, codegen_1.str) `integer out of range`)); + } + } + } +} +function parseString(cxt) { + parseToken(cxt, '"'); + parseWith(cxt, parseJson_1.parseJsonString); +} +function parseEnum(cxt) { + const { gen, data, schema } = cxt; + const enumSch = schema.enum; + parseToken(cxt, '"'); + // TODO loopEnum + gen.if(false); + for (const value of enumSch) { + const valueStr = JSON.stringify(value).slice(1); // remove starting quote + gen.elseIf((0, codegen_1._) `${jsonSlice(valueStr.length)} === ${valueStr}`); + gen.assign(data, (0, codegen_1.str) `${value}`); + gen.add(names_1.default.jsonPos, valueStr.length); + } + gen.else(); + jsonSyntaxError(cxt); + gen.endIf(); +} +function parseNumber(cxt, maxDigits) { + const { gen } = cxt; + skipWhitespace(cxt); + gen.if((0, codegen_1._) `"-0123456789".indexOf(${jsonSlice(1)}) < 0`, () => jsonSyntaxError(cxt), () => parseWith(cxt, parseJson_1.parseJsonNumber, maxDigits)); +} +function parseBooleanToken(bool, fail) { + return (cxt) => { + const { gen, data } = cxt; + tryParseToken(cxt, `${bool}`, () => fail(cxt), () => gen.assign(data, bool)); + }; +} +function parseRef(cxt) { + const { gen, self, definitions, schema, schemaEnv } = cxt; + const { ref } = schema; + const refSchema = definitions[ref]; + if (!refSchema) + throw new ref_error_1.default(self.opts.uriResolver, "", ref, `No definition ${ref}`); + if (!(0, ref_1.hasRef)(refSchema)) + return parseCode({ ...cxt, schema: refSchema }); + const { root } = schemaEnv; + const sch = compileParser.call(self, new __1.SchemaEnv({ schema: refSchema, root }), definitions); + partialParse(cxt, getParser(gen, sch), true); +} +function getParser(gen, sch) { + return sch.parse + ? gen.scopeValue("parse", { ref: sch.parse }) + : (0, codegen_1._) `${gen.scopeValue("wrapper", { ref: sch })}.parse`; +} +function parseEmpty(cxt) { + parseWith(cxt, parseJson_1.parseJson); +} +function parseWith(cxt, parseFunc, args) { + partialParse(cxt, (0, util_1.useFunc)(cxt.gen, parseFunc), args); +} +function partialParse(cxt, parseFunc, args) { + const { gen, data } = cxt; + gen.assign(data, (0, codegen_1._) `${parseFunc}(${names_1.default.json}, ${names_1.default.jsonPos}${args ? (0, codegen_1._) `, ${args}` : codegen_1.nil})`); + gen.assign(names_1.default.jsonPos, (0, codegen_1._) `${parseFunc}.position`); + gen.if((0, codegen_1._) `${data} === undefined`, () => parsingError(cxt, (0, codegen_1._) `${parseFunc}.message`)); +} +function parseToken(cxt, tok) { + tryParseToken(cxt, tok, jsonSyntaxError); +} +function tryParseToken(cxt, tok, fail, success) { + const { gen } = cxt; + const n = tok.length; + skipWhitespace(cxt); + gen.if((0, codegen_1._) `${jsonSlice(n)} === ${tok}`, () => { + gen.add(names_1.default.jsonPos, n); + success === null || success === void 0 ? void 0 : success(cxt); + }, () => fail(cxt)); +} +function skipWhitespace({ gen, char: c }) { + gen.code((0, codegen_1._) `while((${c}=${names_1.default.json}[${names_1.default.jsonPos}],${c}===" "||${c}==="\\n"||${c}==="\\r"||${c}==="\\t"))${names_1.default.jsonPos}++;`); +} +function jsonSlice(len) { + return len === 1 + ? (0, codegen_1._) `${names_1.default.json}[${names_1.default.jsonPos}]` + : (0, codegen_1._) `${names_1.default.json}.slice(${names_1.default.jsonPos}, ${names_1.default.jsonPos}+${len})`; +} +function jsonSyntaxError(cxt) { + parsingError(cxt, (0, codegen_1._) `"unexpected token " + ${names_1.default.json}[${names_1.default.jsonPos}]`); +} +function parsingError({ gen, parseName }, msg) { + gen.assign((0, codegen_1._) `${parseName}.message`, msg); + gen.assign((0, codegen_1._) `${parseName}.position`, names_1.default.jsonPos); + gen.return(undef); +} +//# sourceMappingURL=parse.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/jtd/parse.js.map b/front_end/third_party/mcp-sdk/ajv/dist/compile/jtd/parse.js.map new file mode 100644 index 0000000000..87bd922aef --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/jtd/parse.js.map @@ -0,0 +1 @@ +{"version":3,"file":"parse.js","sourceRoot":"","sources":["../../../lib/compile/jtd/parse.ts"],"names":[],"mappings":";;AAEA,mCAA0D;AAC1D,0BAAgD;AAChD,wCAAmF;AACnF,4CAA0C;AAC1C,oCAAwB;AACxB,kDAAmD;AACnD,oDAAiD;AACjD,sDAA6D;AAC7D,uDAAmF;AACnF,kCAA+B;AAC/B,uDAAoD;AAIpD,MAAM,QAAQ,GAA+B;IAC3C,QAAQ,EAAE,aAAa;IACvB,MAAM,EAAE,WAAW;IACnB,aAAa,EAAE,kBAAkB;IACjC,UAAU,EAAE,eAAe;IAC3B,kBAAkB,EAAE,eAAe;IACnC,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,SAAS;IACf,GAAG,EAAE,QAAQ;CACd,CAAA;AAaD,SAAwB,aAAa,CAEnC,GAAc,EACd,WAA4B;IAE5B,MAAM,IAAI,GAAG,sBAAkB,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;IAC/C,IAAI,IAAI;QAAE,OAAO,IAAI,CAAA;IACrB,MAAM,EAAC,GAAG,EAAE,KAAK,EAAC,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAA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AAC,CAAC,IAAA,WAAC,EAAA,GAAG,eAAC,CAAC,IAAI,UAAU,eAAC,CAAC,OAAO,KAAK,eAAC,CAAC,OAAO,IAAI,GAAG,GAAG,CAAA;AAC3D,CAAC;AAED,SAAS,eAAe,CAAC,GAAa;IACpC,YAAY,CAAC,GAAG,EAAE,IAAA,WAAC,EAAA,yBAAyB,eAAC,CAAC,IAAI,IAAI,eAAC,CAAC,OAAO,GAAG,CAAC,CAAA;AACrE,CAAC;AAED,SAAS,YAAY,CAAC,EAAC,GAAG,EAAE,SAAS,EAAW,EAAE,GAAS;IACzD,GAAG,CAAC,MAAM,CAAC,IAAA,WAAC,EAAA,GAAG,SAAS,UAAU,EAAE,GAAG,CAAC,CAAA;IACxC,GAAG,CAAC,MAAM,CAAC,IAAA,WAAC,EAAA,GAAG,SAAS,WAAW,EAAE,eAAC,CAAC,OAAO,CAAC,CAAA;IAC/C,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AACnB,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/jtd/serialize.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/compile/jtd/serialize.d.ts new file mode 100644 index 0000000000..b0413d716d --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/jtd/serialize.d.ts @@ -0,0 +1,4 @@ +import type Ajv from "../../core"; +import { SchemaObjectMap } from "./types"; +import { SchemaEnv } from ".."; +export default function compileSerializer(this: Ajv, sch: SchemaEnv, definitions: SchemaObjectMap): SchemaEnv; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/jtd/serialize.js b/front_end/third_party/mcp-sdk/ajv/dist/compile/jtd/serialize.js new file mode 100644 index 0000000000..341c50078a --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/jtd/serialize.js @@ -0,0 +1,229 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const types_1 = require("./types"); +const __1 = require(".."); +const codegen_1 = require("../codegen"); +const ref_error_1 = require("../ref_error"); +const names_1 = require("../names"); +const code_1 = require("../../vocabularies/code"); +const ref_1 = require("../../vocabularies/jtd/ref"); +const util_1 = require("../util"); +const quote_1 = require("../../runtime/quote"); +const genSerialize = { + elements: serializeElements, + values: serializeValues, + discriminator: serializeDiscriminator, + properties: serializeProperties, + optionalProperties: serializeProperties, + enum: serializeString, + type: serializeType, + ref: serializeRef, +}; +function compileSerializer(sch, definitions) { + const _sch = __1.getCompilingSchema.call(this, sch); + if (_sch) + return _sch; + const { es5, lines } = this.opts.code; + const { ownProperties } = this.opts; + const gen = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties }); + const serializeName = gen.scopeName("serialize"); + const cxt = { + self: this, + gen, + schema: sch.schema, + schemaEnv: sch, + definitions, + data: names_1.default.data, + }; + let sourceCode; + try { + this._compilations.add(sch); + sch.serializeName = serializeName; + gen.func(serializeName, names_1.default.data, false, () => { + gen.let(names_1.default.json, (0, codegen_1.str) ``); + serializeCode(cxt); + gen.return(names_1.default.json); + }); + gen.optimize(this.opts.code.optimize); + const serializeFuncCode = gen.toString(); + sourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${serializeFuncCode}`; + const makeSerialize = new Function(`${names_1.default.scope}`, sourceCode); + const serialize = makeSerialize(this.scope.get()); + this.scope.value(serializeName, { ref: serialize }); + sch.serialize = serialize; + } + catch (e) { + if (sourceCode) + this.logger.error("Error compiling serializer, function code:", sourceCode); + delete sch.serialize; + delete sch.serializeName; + throw e; + } + finally { + this._compilations.delete(sch); + } + return sch; +} +exports.default = compileSerializer; +function serializeCode(cxt) { + let form; + for (const key of types_1.jtdForms) { + if (key in cxt.schema) { + form = key; + break; + } + } + serializeNullable(cxt, form ? genSerialize[form] : serializeEmpty); +} +function serializeNullable(cxt, serializeForm) { + const { gen, schema, data } = cxt; + if (!schema.nullable) + return serializeForm(cxt); + gen.if((0, codegen_1._) `${data} === undefined || ${data} === null`, () => gen.add(names_1.default.json, (0, codegen_1._) `"null"`), () => serializeForm(cxt)); +} +function serializeElements(cxt) { + const { gen, schema, data } = cxt; + gen.add(names_1.default.json, (0, codegen_1.str) `[`); + const first = gen.let("first", true); + gen.forOf("el", data, (el) => { + addComma(cxt, first); + serializeCode({ ...cxt, schema: schema.elements, data: el }); + }); + gen.add(names_1.default.json, (0, codegen_1.str) `]`); +} +function serializeValues(cxt) { + const { gen, schema, data } = cxt; + gen.add(names_1.default.json, (0, codegen_1.str) `{`); + const first = gen.let("first", true); + gen.forIn("key", data, (key) => serializeKeyValue(cxt, key, schema.values, first)); + gen.add(names_1.default.json, (0, codegen_1.str) `}`); +} +function serializeKeyValue(cxt, key, schema, first) { + const { gen, data } = cxt; + addComma(cxt, first); + serializeString({ ...cxt, data: key }); + gen.add(names_1.default.json, (0, codegen_1.str) `:`); + const value = gen.const("value", (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(key)}`); + serializeCode({ ...cxt, schema, data: value }); +} +function serializeDiscriminator(cxt) { + const { gen, schema, data } = cxt; + const { discriminator } = schema; + gen.add(names_1.default.json, (0, codegen_1.str) `{${JSON.stringify(discriminator)}:`); + const tag = gen.const("tag", (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(discriminator)}`); + serializeString({ ...cxt, data: tag }); + gen.if(false); + for (const tagValue in schema.mapping) { + gen.elseIf((0, codegen_1._) `${tag} === ${tagValue}`); + const sch = schema.mapping[tagValue]; + serializeSchemaProperties({ ...cxt, schema: sch }, discriminator); + } + gen.endIf(); + gen.add(names_1.default.json, (0, codegen_1.str) `}`); +} +function serializeProperties(cxt) { + const { gen } = cxt; + gen.add(names_1.default.json, (0, codegen_1.str) `{`); + serializeSchemaProperties(cxt); + gen.add(names_1.default.json, (0, codegen_1.str) `}`); +} +function serializeSchemaProperties(cxt, discriminator) { + const { gen, schema, data } = cxt; + const { properties, optionalProperties } = schema; + const props = keys(properties); + const optProps = keys(optionalProperties); + const allProps = allProperties(props.concat(optProps)); + let first = !discriminator; + let firstProp; + for (const key of props) { + if (first) + first = false; + else + gen.add(names_1.default.json, (0, codegen_1.str) `,`); + serializeProperty(key, properties[key], keyValue(key)); + } + if (first) + firstProp = gen.let("first", true); + for (const key of optProps) { + const value = keyValue(key); + gen.if((0, codegen_1.and)((0, codegen_1._) `${value} !== undefined`, (0, code_1.isOwnProperty)(gen, data, key)), () => { + addComma(cxt, firstProp); + serializeProperty(key, optionalProperties[key], value); + }); + } + if (schema.additionalProperties) { + gen.forIn("key", data, (key) => gen.if(isAdditional(key, allProps), () => serializeKeyValue(cxt, key, {}, firstProp))); + } + function keys(ps) { + return ps ? Object.keys(ps) : []; + } + function allProperties(ps) { + if (discriminator) + ps.push(discriminator); + if (new Set(ps).size !== ps.length) { + throw new Error("JTD: properties/optionalProperties/disciminator overlap"); + } + return ps; + } + function keyValue(key) { + return gen.const("value", (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(key)}`); + } + function serializeProperty(key, propSchema, value) { + gen.add(names_1.default.json, (0, codegen_1.str) `${JSON.stringify(key)}:`); + serializeCode({ ...cxt, schema: propSchema, data: value }); + } + function isAdditional(key, ps) { + return ps.length ? (0, codegen_1.and)(...ps.map((p) => (0, codegen_1._) `${key} !== ${p}`)) : true; + } +} +function serializeType(cxt) { + const { gen, schema, data } = cxt; + switch (schema.type) { + case "boolean": + gen.add(names_1.default.json, (0, codegen_1._) `${data} ? "true" : "false"`); + break; + case "string": + serializeString(cxt); + break; + case "timestamp": + gen.if((0, codegen_1._) `${data} instanceof Date`, () => gen.add(names_1.default.json, (0, codegen_1._) `'"' + ${data}.toISOString() + '"'`), () => serializeString(cxt)); + break; + default: + serializeNumber(cxt); + } +} +function serializeString({ gen, data }) { + gen.add(names_1.default.json, (0, codegen_1._) `${(0, util_1.useFunc)(gen, quote_1.default)}(${data})`); +} +function serializeNumber({ gen, data }) { + gen.add(names_1.default.json, (0, codegen_1._) `"" + ${data}`); +} +function serializeRef(cxt) { + const { gen, self, data, definitions, schema, schemaEnv } = cxt; + const { ref } = schema; + const refSchema = definitions[ref]; + if (!refSchema) + throw new ref_error_1.default(self.opts.uriResolver, "", ref, `No definition ${ref}`); + if (!(0, ref_1.hasRef)(refSchema)) + return serializeCode({ ...cxt, schema: refSchema }); + const { root } = schemaEnv; + const sch = compileSerializer.call(self, new __1.SchemaEnv({ schema: refSchema, root }), definitions); + gen.add(names_1.default.json, (0, codegen_1._) `${getSerialize(gen, sch)}(${data})`); +} +function getSerialize(gen, sch) { + return sch.serialize + ? gen.scopeValue("serialize", { ref: sch.serialize }) + : (0, codegen_1._) `${gen.scopeValue("wrapper", { ref: sch })}.serialize`; +} +function serializeEmpty({ gen, data }) { + gen.add(names_1.default.json, (0, codegen_1._) `JSON.stringify(${data})`); +} +function addComma({ gen }, first) { + if (first) { + gen.if(first, () => gen.assign(first, false), () => gen.add(names_1.default.json, (0, codegen_1.str) `,`)); + } + else { + gen.add(names_1.default.json, (0, codegen_1.str) `,`); + } +} +//# sourceMappingURL=serialize.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/jtd/serialize.js.map b/front_end/third_party/mcp-sdk/ajv/dist/compile/jtd/serialize.js.map new file mode 100644 index 0000000000..15c82c7147 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/jtd/serialize.js.map @@ -0,0 +1 @@ +{"version":3,"file":"serialize.js","sourceRoot":"","sources":["../../../lib/compile/jtd/serialize.ts"],"names":[],"mappings":";;AAEA,mCAA0D;AAC1D,0BAAgD;AAChD,wCAAwE;AACxE,4CAA0C;AAC1C,oCAAwB;AACxB,kDAAqD;AACrD,oDAAiD;AACjD,kCAA+B;AAC/B,+CAAuC;AAEvC,MAAM,YAAY,GAAkD;IAClE,QAAQ,EAAE,iBAAiB;IAC3B,MAAM,EAAE,eAAe;IACvB,aAAa,EAAE,sBAAsB;IACrC,UAAU,EAAE,mBAAmB;IAC/B,kBAAkB,EAAE,mBAAmB;IACvC,IAAI,EAAE,eAAe;IACrB,IAAI,EAAE,aAAa;IACnB,GAAG,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AAS,cAAc,CAAC,EAAC,GAAG,EAAE,IAAI,EAAe;IAC/C,GAAG,CAAC,GAAG,CAAC,eAAC,CAAC,IAAI,EAAE,IAAA,WAAC,EAAA,kBAAkB,IAAI,GAAG,CAAC,CAAA;AAC7C,CAAC;AAED,SAAS,QAAQ,CAAC,EAAC,GAAG,EAAe,EAAE,KAAY;IACjD,IAAI,KAAK,EAAE,CAAC;QACV,GAAG,CAAC,EAAE,CACJ,KAAK,EACL,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,EAC9B,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,eAAC,CAAC,IAAI,EAAE,IAAA,aAAG,EAAA,GAAG,CAAC,CAC9B,CAAA;IACH,CAAC;SAAM,CAAC;QACN,GAAG,CAAC,GAAG,CAAC,eAAC,CAAC,IAAI,EAAE,IAAA,aAAG,EAAA,GAAG,CAAC,CAAA;IACzB,CAAC;AACH,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/jtd/types.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/compile/jtd/types.d.ts new file mode 100644 index 0000000000..678986f1bd --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/jtd/types.d.ts @@ -0,0 +1,6 @@ +import type { SchemaObject } from "../../types"; +export type SchemaObjectMap = { + [Ref in string]?: SchemaObject; +}; +export declare const jtdForms: readonly ["elements", "values", "discriminator", "properties", "optionalProperties", "enum", "type", "ref"]; +export type JTDForm = (typeof jtdForms)[number]; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/jtd/types.js b/front_end/third_party/mcp-sdk/ajv/dist/compile/jtd/types.js new file mode 100644 index 0000000000..b9c60a90fd --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/jtd/types.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.jtdForms = void 0; +exports.jtdForms = [ + "elements", + "values", + "discriminator", + "properties", + "optionalProperties", + "enum", + "type", + "ref", +]; +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/jtd/types.js.map b/front_end/third_party/mcp-sdk/ajv/dist/compile/jtd/types.js.map new file mode 100644 index 0000000000..53439e002a --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/jtd/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../lib/compile/jtd/types.ts"],"names":[],"mappings":";;;AAIa,QAAA,QAAQ,GAAG;IACtB,UAAU;IACV,QAAQ;IACR,eAAe;IACf,YAAY;IACZ,oBAAoB;IACpB,MAAM;IACN,MAAM;IACN,KAAK;CACG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/names.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/compile/names.d.ts new file mode 100644 index 0000000000..5740e82c66 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/names.d.ts @@ -0,0 +1,20 @@ +import { Name } from "./codegen"; +declare const names: { + data: Name; + valCxt: Name; + instancePath: Name; + parentData: Name; + parentDataProperty: Name; + rootData: Name; + dynamicAnchors: Name; + vErrors: Name; + errors: Name; + this: Name; + self: Name; + scope: Name; + json: Name; + jsonPos: Name; + jsonLen: Name; + jsonPart: Name; +}; +export default names; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/names.js b/front_end/third_party/mcp-sdk/ajv/dist/compile/names.js new file mode 100644 index 0000000000..3bce5aaa9a --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/names.js @@ -0,0 +1,28 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("./codegen"); +const names = { + // validation function arguments + data: new codegen_1.Name("data"), // data passed to validation function + // args passed from referencing schema + valCxt: new codegen_1.Name("valCxt"), // validation/data context - should not be used directly, it is destructured to the names below + instancePath: new codegen_1.Name("instancePath"), + parentData: new codegen_1.Name("parentData"), + parentDataProperty: new codegen_1.Name("parentDataProperty"), + rootData: new codegen_1.Name("rootData"), // root data - same as the data passed to the first/top validation function + dynamicAnchors: new codegen_1.Name("dynamicAnchors"), // used to support recursiveRef and dynamicRef + // function scoped variables + vErrors: new codegen_1.Name("vErrors"), // null or array of validation errors + errors: new codegen_1.Name("errors"), // counter of validation errors + this: new codegen_1.Name("this"), + // "globals" + self: new codegen_1.Name("self"), + scope: new codegen_1.Name("scope"), + // JTD serialize/parse name for JSON string and position + json: new codegen_1.Name("json"), + jsonPos: new codegen_1.Name("jsonPos"), + jsonLen: new codegen_1.Name("jsonLen"), + jsonPart: new codegen_1.Name("jsonPart"), +}; +exports.default = names; +//# sourceMappingURL=names.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/names.js.map b/front_end/third_party/mcp-sdk/ajv/dist/compile/names.js.map new file mode 100644 index 0000000000..971fcbf70e --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/names.js.map @@ -0,0 +1 @@ +{"version":3,"file":"names.js","sourceRoot":"","sources":["../../lib/compile/names.ts"],"names":[],"mappings":";;AAAA,uCAA8B;AAE9B,MAAM,KAAK,GAAG;IACZ,gCAAgC;IAChC,IAAI,EAAE,IAAI,cAAI,CAAC,MAAM,CAAC,EAAE,qCAAqC;IAC7D,sCAAsC;IACtC,MAAM,EAAE,IAAI,cAAI,CAAC,QAAQ,CAAC,EAAE,+FAA+F;IAC3H,YAAY,EAAE,IAAI,cAAI,CAAC,cAAc,CAAC;IACtC,UAAU,EAAE,IAAI,cAAI,CAAC,YAAY,CAAC;IAClC,kBAAkB,EAAE,IAAI,cAAI,CAAC,oBAAoB,CAAC;IAClD,QAAQ,EAAE,IAAI,cAAI,CAAC,UAAU,CAAC,EAAE,2EAA2E;IAC3G,cAAc,EAAE,IAAI,cAAI,CAAC,gBAAgB,CAAC,EAAE,8CAA8C;IAC1F,4BAA4B;IAC5B,OAAO,EAAE,IAAI,cAAI,CAAC,SAAS,CAAC,EAAE,qCAAqC;IACnE,MAAM,EAAE,IAAI,cAAI,CAAC,QAAQ,CAAC,EAAE,+BAA+B;IAC3D,IAAI,EAAE,IAAI,cAAI,CAAC,MAAM,CAAC;IACtB,YAAY;IACZ,IAAI,EAAE,IAAI,cAAI,CAAC,MAAM,CAAC;IACtB,KAAK,EAAE,IAAI,cAAI,CAAC,OAAO,CAAC;IACxB,wDAAwD;IACxD,IAAI,EAAE,IAAI,cAAI,CAAC,MAAM,CAAC;IACtB,OAAO,EAAE,IAAI,cAAI,CAAC,SAAS,CAAC;IAC5B,OAAO,EAAE,IAAI,cAAI,CAAC,SAAS,CAAC;IAC5B,QAAQ,EAAE,IAAI,cAAI,CAAC,UAAU,CAAC;CAC/B,CAAA;AAED,kBAAe,KAAK,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/ref_error.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/compile/ref_error.d.ts new file mode 100644 index 0000000000..43374439e5 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/ref_error.d.ts @@ -0,0 +1,6 @@ +import type { UriResolver } from "../types"; +export default class MissingRefError extends Error { + readonly missingRef: string; + readonly missingSchema: string; + constructor(resolver: UriResolver, baseId: string, ref: string, msg?: string); +} diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/ref_error.js b/front_end/third_party/mcp-sdk/ajv/dist/compile/ref_error.js new file mode 100644 index 0000000000..3916dec8a3 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/ref_error.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const resolve_1 = require("./resolve"); +class MissingRefError extends Error { + constructor(resolver, baseId, ref, msg) { + super(msg || `can't resolve reference ${ref} from id ${baseId}`); + this.missingRef = (0, resolve_1.resolveUrl)(resolver, baseId, ref); + this.missingSchema = (0, resolve_1.normalizeId)((0, resolve_1.getFullPath)(resolver, this.missingRef)); + } +} +exports.default = MissingRefError; +//# sourceMappingURL=ref_error.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/ref_error.js.map b/front_end/third_party/mcp-sdk/ajv/dist/compile/ref_error.js.map new file mode 100644 index 0000000000..d13f5f2dd0 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/ref_error.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ref_error.js","sourceRoot":"","sources":["../../lib/compile/ref_error.ts"],"names":[],"mappings":";;AAAA,uCAA8D;AAG9D,MAAqB,eAAgB,SAAQ,KAAK;IAIhD,YAAY,QAAqB,EAAE,MAAc,EAAE,GAAW,EAAE,GAAY;QAC1E,KAAK,CAAC,GAAG,IAAI,2BAA2B,GAAG,YAAY,MAAM,EAAE,CAAC,CAAA;QAChE,IAAI,CAAC,UAAU,GAAG,IAAA,oBAAU,EAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,CAAC,CAAA;QACnD,IAAI,CAAC,aAAa,GAAG,IAAA,qBAAW,EAAC,IAAA,qBAAW,EAAC,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAA;IAC1E,CAAC;CACF;AATD,kCASC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/resolve.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/compile/resolve.d.ts new file mode 100644 index 0000000000..3c20fffcb7 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/resolve.d.ts @@ -0,0 +1,12 @@ +import type { AnySchema, AnySchemaObject, UriResolver } from "../types"; +import type Ajv from "../ajv"; +import type { URIComponent } from "fast-uri"; +export type LocalRefs = { + [Ref in string]?: AnySchemaObject; +}; +export declare function inlineRef(schema: AnySchema, limit?: boolean | number): boolean; +export declare function getFullPath(resolver: UriResolver, id?: string, normalize?: boolean): string; +export declare function _getFullPath(resolver: UriResolver, p: URIComponent): string; +export declare function normalizeId(id: string | undefined): string; +export declare function resolveUrl(resolver: UriResolver, baseId: string, id: string): string; +export declare function getSchemaRefs(this: Ajv, schema: AnySchema, baseId: string): LocalRefs; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/resolve.js b/front_end/third_party/mcp-sdk/ajv/dist/compile/resolve.js new file mode 100644 index 0000000000..f12f968dc0 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/resolve.js @@ -0,0 +1,155 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getSchemaRefs = exports.resolveUrl = exports.normalizeId = exports._getFullPath = exports.getFullPath = exports.inlineRef = void 0; +const util_1 = require("./util"); +const equal = require("fast-deep-equal"); +const traverse = require("json-schema-traverse"); +// TODO refactor to use keyword definitions +const SIMPLE_INLINED = new Set([ + "type", + "format", + "pattern", + "maxLength", + "minLength", + "maxProperties", + "minProperties", + "maxItems", + "minItems", + "maximum", + "minimum", + "uniqueItems", + "multipleOf", + "required", + "enum", + "const", +]); +function inlineRef(schema, limit = true) { + if (typeof schema == "boolean") + return true; + if (limit === true) + return !hasRef(schema); + if (!limit) + return false; + return countKeys(schema) <= limit; +} +exports.inlineRef = inlineRef; +const REF_KEYWORDS = new Set([ + "$ref", + "$recursiveRef", + "$recursiveAnchor", + "$dynamicRef", + "$dynamicAnchor", +]); +function hasRef(schema) { + for (const key in schema) { + if (REF_KEYWORDS.has(key)) + return true; + const sch = schema[key]; + if (Array.isArray(sch) && sch.some(hasRef)) + return true; + if (typeof sch == "object" && hasRef(sch)) + return true; + } + return false; +} +function countKeys(schema) { + let count = 0; + for (const key in schema) { + if (key === "$ref") + return Infinity; + count++; + if (SIMPLE_INLINED.has(key)) + continue; + if (typeof schema[key] == "object") { + (0, util_1.eachItem)(schema[key], (sch) => (count += countKeys(sch))); + } + if (count === Infinity) + return Infinity; + } + return count; +} +function getFullPath(resolver, id = "", normalize) { + if (normalize !== false) + id = normalizeId(id); + const p = resolver.parse(id); + return _getFullPath(resolver, p); +} +exports.getFullPath = getFullPath; +function _getFullPath(resolver, p) { + const serialized = resolver.serialize(p); + return serialized.split("#")[0] + "#"; +} +exports._getFullPath = _getFullPath; +const TRAILING_SLASH_HASH = /#\/?$/; +function normalizeId(id) { + return id ? id.replace(TRAILING_SLASH_HASH, "") : ""; +} +exports.normalizeId = normalizeId; +function resolveUrl(resolver, baseId, id) { + id = normalizeId(id); + return resolver.resolve(baseId, id); +} +exports.resolveUrl = resolveUrl; +const ANCHOR = /^[a-z_][-a-z0-9._]*$/i; +function getSchemaRefs(schema, baseId) { + if (typeof schema == "boolean") + return {}; + const { schemaId, uriResolver } = this.opts; + const schId = normalizeId(schema[schemaId] || baseId); + const baseIds = { "": schId }; + const pathPrefix = getFullPath(uriResolver, schId, false); + const localRefs = {}; + const schemaRefs = new Set(); + traverse(schema, { allKeys: true }, (sch, jsonPtr, _, parentJsonPtr) => { + if (parentJsonPtr === undefined) + return; + const fullPath = pathPrefix + jsonPtr; + let innerBaseId = baseIds[parentJsonPtr]; + if (typeof sch[schemaId] == "string") + innerBaseId = addRef.call(this, sch[schemaId]); + addAnchor.call(this, sch.$anchor); + addAnchor.call(this, sch.$dynamicAnchor); + baseIds[jsonPtr] = innerBaseId; + function addRef(ref) { + // eslint-disable-next-line @typescript-eslint/unbound-method + const _resolve = this.opts.uriResolver.resolve; + ref = normalizeId(innerBaseId ? _resolve(innerBaseId, ref) : ref); + if (schemaRefs.has(ref)) + throw ambiguos(ref); + schemaRefs.add(ref); + let schOrRef = this.refs[ref]; + if (typeof schOrRef == "string") + schOrRef = this.refs[schOrRef]; + if (typeof schOrRef == "object") { + checkAmbiguosRef(sch, schOrRef.schema, ref); + } + else if (ref !== normalizeId(fullPath)) { + if (ref[0] === "#") { + checkAmbiguosRef(sch, localRefs[ref], ref); + localRefs[ref] = sch; + } + else { + this.refs[ref] = fullPath; + } + } + return ref; + } + function addAnchor(anchor) { + if (typeof anchor == "string") { + if (!ANCHOR.test(anchor)) + throw new Error(`invalid anchor "${anchor}"`); + addRef.call(this, `#${anchor}`); + } + } + }); + return localRefs; + function checkAmbiguosRef(sch1, sch2, ref) { + if (sch2 !== undefined && !equal(sch1, sch2)) + throw ambiguos(ref); + } + function ambiguos(ref) { + return new Error(`reference "${ref}" resolves to more than one schema`); + } +} +exports.getSchemaRefs = getSchemaRefs; +//# sourceMappingURL=resolve.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/resolve.js.map b/front_end/third_party/mcp-sdk/ajv/dist/compile/resolve.js.map new file mode 100644 index 0000000000..f579194547 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/resolve.js.map @@ -0,0 +1 @@ +{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../lib/compile/resolve.ts"],"names":[],"mappings":";;;AAGA,iCAA+B;AAC/B,yCAAwC;AACxC,iDAAgD;AAKhD,2CAA2C;AAC3C,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC;IAC7B,MAAM;IACN,QAAQ;IACR,SAAS;IACT,WAAW;IACX,WAAW;IACX,eAAe;IACf,eAAe;IACf,UAAU;IACV,UAAU;IACV,SAAS;IACT,SAAS;IACT,aAAa;IACb,YAAY;IACZ,UAAU;IACV,MAAM;IACN,OAAO;CACR,CAAC,CAAA;AAEF,SAAgB,SAAS,CAAC,MAAiB,EAAE,QAA0B,IAAI;IACzE,IAAI,OAAO,MAAM,IAAI,SAAS;QAAE,OAAO,IAAI,CAAA;IAC3C,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IAC1C,IAAI,CAAC,KAAK;QAAE,OAAO,KAAK,CAAA;IACxB,OAAO,SAAS,CAAC,MAAM,CAAC,IAAI,KAAK,CAAA;AACnC,CAAC;AALD,8BAKC;AAED,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC;IAC3B,MAAM;IACN,eAAe;IACf,kBAAkB;IAClB,aAAa;IACb,gBAAgB;CAC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/mcp-sdk/ajv/dist/compile/rules.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/compile/rules.d.ts new file mode 100644 index 0000000000..51ec46ab34 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/rules.d.ts @@ -0,0 +1,28 @@ +import type { AddedKeywordDefinition } from "../types"; +declare const _jsonTypes: readonly ["string", "number", "integer", "boolean", "null", "object", "array"]; +export type JSONType = (typeof _jsonTypes)[number]; +export declare function isJSONType(x: unknown): x is JSONType; +type ValidationTypes = { + [K in JSONType]: boolean | RuleGroup | undefined; +}; +export interface ValidationRules { + rules: RuleGroup[]; + post: RuleGroup; + all: { + [Key in string]?: boolean | Rule; + }; + keywords: { + [Key in string]?: boolean; + }; + types: ValidationTypes; +} +export interface RuleGroup { + type?: JSONType; + rules: Rule[]; +} +export interface Rule { + keyword: string; + definition: AddedKeywordDefinition; +} +export declare function getRules(): ValidationRules; +export {}; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/rules.js b/front_end/third_party/mcp-sdk/ajv/dist/compile/rules.js new file mode 100644 index 0000000000..82a591ff4d --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/rules.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getRules = exports.isJSONType = void 0; +const _jsonTypes = ["string", "number", "integer", "boolean", "null", "object", "array"]; +const jsonTypes = new Set(_jsonTypes); +function isJSONType(x) { + return typeof x == "string" && jsonTypes.has(x); +} +exports.isJSONType = isJSONType; +function getRules() { + const groups = { + number: { type: "number", rules: [] }, + string: { type: "string", rules: [] }, + array: { type: "array", rules: [] }, + object: { type: "object", rules: [] }, + }; + return { + types: { ...groups, integer: true, boolean: true, null: true }, + rules: [{ rules: [] }, groups.number, groups.string, groups.array, groups.object], + post: { rules: [] }, + all: {}, + keywords: {}, + }; +} +exports.getRules = getRules; +//# sourceMappingURL=rules.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/rules.js.map b/front_end/third_party/mcp-sdk/ajv/dist/compile/rules.js.map new file mode 100644 index 0000000000..084c70f821 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/rules.js.map @@ -0,0 +1 @@ +{"version":3,"file":"rules.js","sourceRoot":"","sources":["../../lib/compile/rules.ts"],"names":[],"mappings":";;;AAEA,MAAM,UAAU,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAU,CAAA;AAIjG,MAAM,SAAS,GAAgB,IAAI,GAAG,CAAC,UAAU,CAAC,CAAA;AAElD,SAAgB,UAAU,CAAC,CAAU;IACnC,OAAO,OAAO,CAAC,IAAI,QAAQ,IAAI,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;AACjD,CAAC;AAFD,gCAEC;AAyBD,SAAgB,QAAQ;IACtB,MAAM,MAAM,GAAgE;QAC1E,MAAM,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAC;QACnC,MAAM,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAC;QACnC,KAAK,EAAE,EAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAC;QACjC,MAAM,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAC;KACpC,CAAA;IACD,OAAO;QACL,KAAK,EAAE,EAAC,GAAG,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC;QAC5D,KAAK,EAAE,CAAC,EAAC,KAAK,EAAE,EAAE,EAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC;QAC/E,IAAI,EAAE,EAAC,KAAK,EAAE,EAAE,EAAC;QACjB,GAAG,EAAE,EAAE;QACP,QAAQ,EAAE,EAAE;KACb,CAAA;AACH,CAAC;AAdD,4BAcC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/util.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/compile/util.d.ts new file mode 100644 index 0000000000..1ec282aee8 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/util.d.ts @@ -0,0 +1,40 @@ +import type { AnySchema, EvaluatedProperties, EvaluatedItems } from "../types"; +import type { SchemaCxt, SchemaObjCxt } from "."; +import { Code, Name, CodeGen } from "./codegen"; +import type { Rule, ValidationRules } from "./rules"; +export declare function toHash(arr: T[]): { + [K in T]?: true; +}; +export declare function alwaysValidSchema(it: SchemaCxt, schema: AnySchema): boolean | void; +export declare function checkUnknownRules(it: SchemaCxt, schema?: AnySchema): void; +export declare function schemaHasRules(schema: AnySchema, rules: { + [Key in string]?: boolean | Rule; +}): boolean; +export declare function schemaHasRulesButRef(schema: AnySchema, RULES: ValidationRules): boolean; +export declare function schemaRefOrVal({ topSchemaRef, schemaPath }: SchemaObjCxt, schema: unknown, keyword: string, $data?: string | false): Code | number | boolean; +export declare function unescapeFragment(str: string): string; +export declare function escapeFragment(str: string | number): string; +export declare function escapeJsonPointer(str: string | number): string; +export declare function unescapeJsonPointer(str: string): string; +export declare function eachItem(xs: T | T[], f: (x: T) => void): void; +type SomeEvaluated = EvaluatedProperties | EvaluatedItems; +type MergeEvaluatedFunc = (gen: CodeGen, from: Name | T, to: Name | Exclude | undefined, toName?: typeof Name) => Name | T; +interface MergeEvaluated { + props: MergeEvaluatedFunc; + items: MergeEvaluatedFunc; +} +export declare const mergeEvaluated: MergeEvaluated; +export declare function evaluatedPropsToName(gen: CodeGen, ps?: EvaluatedProperties): Name; +export declare function setEvaluated(gen: CodeGen, props: Name, ps: { + [K in string]?: true; +}): void; +export declare function useFunc(gen: CodeGen, f: { + code: string; +}): Name; +export declare enum Type { + Num = 0, + Str = 1 +} +export declare function getErrorPath(dataProp: Name | string | number, dataPropType?: Type, jsPropertySyntax?: boolean): Code | string; +export declare function checkStrictMode(it: SchemaCxt, msg: string, mode?: boolean | "log"): void; +export {}; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/util.js b/front_end/third_party/mcp-sdk/ajv/dist/compile/util.js new file mode 100644 index 0000000000..73c87c854d --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/util.js @@ -0,0 +1,178 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.checkStrictMode = exports.getErrorPath = exports.Type = exports.useFunc = exports.setEvaluated = exports.evaluatedPropsToName = exports.mergeEvaluated = exports.eachItem = exports.unescapeJsonPointer = exports.escapeJsonPointer = exports.escapeFragment = exports.unescapeFragment = exports.schemaRefOrVal = exports.schemaHasRulesButRef = exports.schemaHasRules = exports.checkUnknownRules = exports.alwaysValidSchema = exports.toHash = void 0; +const codegen_1 = require("./codegen"); +const code_1 = require("./codegen/code"); +// TODO refactor to use Set +function toHash(arr) { + const hash = {}; + for (const item of arr) + hash[item] = true; + return hash; +} +exports.toHash = toHash; +function alwaysValidSchema(it, schema) { + if (typeof schema == "boolean") + return schema; + if (Object.keys(schema).length === 0) + return true; + checkUnknownRules(it, schema); + return !schemaHasRules(schema, it.self.RULES.all); +} +exports.alwaysValidSchema = alwaysValidSchema; +function checkUnknownRules(it, schema = it.schema) { + const { opts, self } = it; + if (!opts.strictSchema) + return; + if (typeof schema === "boolean") + return; + const rules = self.RULES.keywords; + for (const key in schema) { + if (!rules[key]) + checkStrictMode(it, `unknown keyword: "${key}"`); + } +} +exports.checkUnknownRules = checkUnknownRules; +function schemaHasRules(schema, rules) { + if (typeof schema == "boolean") + return !schema; + for (const key in schema) + if (rules[key]) + return true; + return false; +} +exports.schemaHasRules = schemaHasRules; +function schemaHasRulesButRef(schema, RULES) { + if (typeof schema == "boolean") + return !schema; + for (const key in schema) + if (key !== "$ref" && RULES.all[key]) + return true; + return false; +} +exports.schemaHasRulesButRef = schemaHasRulesButRef; +function schemaRefOrVal({ topSchemaRef, schemaPath }, schema, keyword, $data) { + if (!$data) { + if (typeof schema == "number" || typeof schema == "boolean") + return schema; + if (typeof schema == "string") + return (0, codegen_1._) `${schema}`; + } + return (0, codegen_1._) `${topSchemaRef}${schemaPath}${(0, codegen_1.getProperty)(keyword)}`; +} +exports.schemaRefOrVal = schemaRefOrVal; +function unescapeFragment(str) { + return unescapeJsonPointer(decodeURIComponent(str)); +} +exports.unescapeFragment = unescapeFragment; +function escapeFragment(str) { + return encodeURIComponent(escapeJsonPointer(str)); +} +exports.escapeFragment = escapeFragment; +function escapeJsonPointer(str) { + if (typeof str == "number") + return `${str}`; + return str.replace(/~/g, "~0").replace(/\//g, "~1"); +} +exports.escapeJsonPointer = escapeJsonPointer; +function unescapeJsonPointer(str) { + return str.replace(/~1/g, "/").replace(/~0/g, "~"); +} +exports.unescapeJsonPointer = unescapeJsonPointer; +function eachItem(xs, f) { + if (Array.isArray(xs)) { + for (const x of xs) + f(x); + } + else { + f(xs); + } +} +exports.eachItem = eachItem; +function makeMergeEvaluated({ mergeNames, mergeToName, mergeValues, resultToName, }) { + return (gen, from, to, toName) => { + const res = to === undefined + ? from + : to instanceof codegen_1.Name + ? (from instanceof codegen_1.Name ? mergeNames(gen, from, to) : mergeToName(gen, from, to), to) + : from instanceof codegen_1.Name + ? (mergeToName(gen, to, from), from) + : mergeValues(from, to); + return toName === codegen_1.Name && !(res instanceof codegen_1.Name) ? resultToName(gen, res) : res; + }; +} +exports.mergeEvaluated = { + props: makeMergeEvaluated({ + mergeNames: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true && ${from} !== undefined`, () => { + gen.if((0, codegen_1._) `${from} === true`, () => gen.assign(to, true), () => gen.assign(to, (0, codegen_1._) `${to} || {}`).code((0, codegen_1._) `Object.assign(${to}, ${from})`)); + }), + mergeToName: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true`, () => { + if (from === true) { + gen.assign(to, true); + } + else { + gen.assign(to, (0, codegen_1._) `${to} || {}`); + setEvaluated(gen, to, from); + } + }), + mergeValues: (from, to) => (from === true ? true : { ...from, ...to }), + resultToName: evaluatedPropsToName, + }), + items: makeMergeEvaluated({ + mergeNames: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true && ${from} !== undefined`, () => gen.assign(to, (0, codegen_1._) `${from} === true ? true : ${to} > ${from} ? ${to} : ${from}`)), + mergeToName: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true`, () => gen.assign(to, from === true ? true : (0, codegen_1._) `${to} > ${from} ? ${to} : ${from}`)), + mergeValues: (from, to) => (from === true ? true : Math.max(from, to)), + resultToName: (gen, items) => gen.var("items", items), + }), +}; +function evaluatedPropsToName(gen, ps) { + if (ps === true) + return gen.var("props", true); + const props = gen.var("props", (0, codegen_1._) `{}`); + if (ps !== undefined) + setEvaluated(gen, props, ps); + return props; +} +exports.evaluatedPropsToName = evaluatedPropsToName; +function setEvaluated(gen, props, ps) { + Object.keys(ps).forEach((p) => gen.assign((0, codegen_1._) `${props}${(0, codegen_1.getProperty)(p)}`, true)); +} +exports.setEvaluated = setEvaluated; +const snippets = {}; +function useFunc(gen, f) { + return gen.scopeValue("func", { + ref: f, + code: snippets[f.code] || (snippets[f.code] = new code_1._Code(f.code)), + }); +} +exports.useFunc = useFunc; +var Type; +(function (Type) { + Type[Type["Num"] = 0] = "Num"; + Type[Type["Str"] = 1] = "Str"; +})(Type || (exports.Type = Type = {})); +function getErrorPath(dataProp, dataPropType, jsPropertySyntax) { + // let path + if (dataProp instanceof codegen_1.Name) { + const isNumber = dataPropType === Type.Num; + return jsPropertySyntax + ? isNumber + ? (0, codegen_1._) `"[" + ${dataProp} + "]"` + : (0, codegen_1._) `"['" + ${dataProp} + "']"` + : isNumber + ? (0, codegen_1._) `"/" + ${dataProp}` + : (0, codegen_1._) `"/" + ${dataProp}.replace(/~/g, "~0").replace(/\\//g, "~1")`; // TODO maybe use global escapePointer + } + return jsPropertySyntax ? (0, codegen_1.getProperty)(dataProp).toString() : "/" + escapeJsonPointer(dataProp); +} +exports.getErrorPath = getErrorPath; +function checkStrictMode(it, msg, mode = it.opts.strictSchema) { + if (!mode) + return; + msg = `strict mode: ${msg}`; + if (mode === true) + throw new Error(msg); + it.self.logger.warn(msg); +} +exports.checkStrictMode = checkStrictMode; +//# sourceMappingURL=util.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/util.js.map b/front_end/third_party/mcp-sdk/ajv/dist/compile/util.js.map new file mode 100644 index 0000000000..ee01008904 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/util.js.map @@ -0,0 +1 @@ +{"version":3,"file":"util.js","sourceRoot":"","sources":["../../lib/compile/util.ts"],"names":[],"mappings":";;;AAEA,uCAA6D;AAC7D,yCAAoC;AAGpC,2BAA2B;AAC3B,SAAgB,MAAM,CAA4B,GAAQ;IACxD,MAAM,IAAI,GAAsB,EAAE,CAAA;IAClC,KAAK,MAAM,IAAI,IAAI,GAAG;QAAE,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;IACzC,OAAO,IAAI,CAAA;AACb,CAAC;AAJD,wBAIC;AAED,SAAgB,iBAAiB,CAAC,EAAa,EAAE,MAAiB;IAChE,IAAI,OAAO,MAAM,IAAI,SAAS;QAAE,OAAO,MAAM,CAAA;IAC7C,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAA;IACjD,iBAAiB,CAAC,EAAE,EAAE,MAAM,CAAC,CAAA;IAC7B,OAAO,CAAC,cAAc,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;AACnD,CAAC;AALD,8CAKC;AAED,SAAgB,iBAAiB,CAAC,EAAa,EAAE,SAAoB,EAAE,CAAC,MAAM;IAC5E,MAAM,EAAC,IAAI,EAAE,IAAI,EAAC,GAA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I;QAAE,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CAAA;IACvC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC1B,CAAC;AATD,0CASC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/applicability.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/applicability.d.ts new file mode 100644 index 0000000000..165d375dca --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/applicability.d.ts @@ -0,0 +1,6 @@ +import type { AnySchemaObject } from "../../types"; +import type { SchemaObjCxt } from ".."; +import type { JSONType, RuleGroup, Rule } from "../rules"; +export declare function schemaHasRulesForType({ schema, self }: SchemaObjCxt, type: JSONType): boolean | undefined; +export declare function shouldUseGroup(schema: AnySchemaObject, group: RuleGroup): boolean; +export declare function shouldUseRule(schema: AnySchemaObject, rule: Rule): boolean | undefined; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/applicability.js b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/applicability.js new file mode 100644 index 0000000000..6187dbbeee --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/applicability.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.shouldUseRule = exports.shouldUseGroup = exports.schemaHasRulesForType = void 0; +function schemaHasRulesForType({ schema, self }, type) { + const group = self.RULES.types[type]; + return group && group !== true && shouldUseGroup(schema, group); +} +exports.schemaHasRulesForType = schemaHasRulesForType; +function shouldUseGroup(schema, group) { + return group.rules.some((rule) => shouldUseRule(schema, rule)); +} +exports.shouldUseGroup = shouldUseGroup; +function shouldUseRule(schema, rule) { + var _a; + return (schema[rule.keyword] !== undefined || + ((_a = rule.definition.implements) === null || _a === void 0 ? void 0 : _a.some((kwd) => schema[kwd] !== undefined))); +} +exports.shouldUseRule = shouldUseRule; +//# sourceMappingURL=applicability.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/applicability.js.map b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/applicability.js.map new file mode 100644 index 0000000000..450cfe75a3 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/applicability.js.map @@ -0,0 +1 @@ +{"version":3,"file":"applicability.js","sourceRoot":"","sources":["../../../lib/compile/validate/applicability.ts"],"names":[],"mappings":";;;AAIA,SAAgB,qBAAqB,CACnC,EAAC,MAAM,EAAE,IAAI,EAAe,EAC5B,IAAc;IAEd,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IACpC,OAAO,KAAK,IAAI,KAAK,KAAK,IAAI,IAAI,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;AACjE,CAAC;AAND,sDAMC;AAED,SAAgB,cAAc,CAAC,MAAuB,EAAE,KAAgB;IACtE,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAA;AAChE,CAAC;AAFD,wCAEC;AAED,SAAgB,aAAa,CAAC,MAAuB,EAAE,IAAU;;IAC/D,OAAO,CACL,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,SAAS;SAClC,MAAA,IAAI,CAAC,UAAU,CAAC,UAAU,0CAAE,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC,CAAA,CACrE,CAAA;AACH,CAAC;AALD,sCAKC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/boolSchema.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/boolSchema.d.ts new file mode 100644 index 0000000000..0ce795201e --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/boolSchema.d.ts @@ -0,0 +1,4 @@ +import type { SchemaCxt } from ".."; +import { Name } from "../codegen"; +export declare function topBoolOrEmptySchema(it: SchemaCxt): void; +export declare function boolOrEmptySchema(it: SchemaCxt, valid: Name): void; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/boolSchema.js b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/boolSchema.js new file mode 100644 index 0000000000..8eeb7b5eee --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/boolSchema.js @@ -0,0 +1,50 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.boolOrEmptySchema = exports.topBoolOrEmptySchema = void 0; +const errors_1 = require("../errors"); +const codegen_1 = require("../codegen"); +const names_1 = require("../names"); +const boolError = { + message: "boolean schema is false", +}; +function topBoolOrEmptySchema(it) { + const { gen, schema, validateName } = it; + if (schema === false) { + falseSchemaError(it, false); + } + else if (typeof schema == "object" && schema.$async === true) { + gen.return(names_1.default.data); + } + else { + gen.assign((0, codegen_1._) `${validateName}.errors`, null); + gen.return(true); + } +} +exports.topBoolOrEmptySchema = topBoolOrEmptySchema; +function boolOrEmptySchema(it, valid) { + const { gen, schema } = it; + if (schema === false) { + gen.var(valid, false); // TODO var + falseSchemaError(it); + } + else { + gen.var(valid, true); // TODO var + } +} +exports.boolOrEmptySchema = boolOrEmptySchema; +function falseSchemaError(it, overrideAllErrors) { + const { gen, data } = it; + // TODO maybe some other interface should be used for non-keyword validation errors... + const cxt = { + gen, + keyword: "false schema", + data, + schema: false, + schemaCode: false, + schemaValue: false, + params: {}, + it, + }; + (0, errors_1.reportError)(cxt, boolError, undefined, overrideAllErrors); +} +//# sourceMappingURL=boolSchema.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/boolSchema.js.map b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/boolSchema.js.map new file mode 100644 index 0000000000..b7444a20fc --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/boolSchema.js.map @@ -0,0 +1 @@ +{"version":3,"file":"boolSchema.js","sourceRoot":"","sources":["../../../lib/compile/validate/boolSchema.ts"],"names":[],"mappings":";;;AAEA,sCAAqC;AACrC,wCAAkC;AAClC,oCAAwB;AAExB,MAAM,SAAS,GAA2B;IACxC,OAAO,EAAE,yBAAyB;CACnC,CAAA;AAED,SAAgB,oBAAoB,CAAC,EAAa;IAChD,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,YAAY,EAAC,GAAG,EAAE,CAAA;IACtC,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;QACrB,gBAAgB,CAAC,EAAE,EAAE,KAAK,CAAC,CAAA;IAC7B,CAAC;SAAM,IAAI,OAAO,MAAM,IAAI,QAAQ,IAAI,MAAM,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;QAC/D,GAAG,CAAC,MAAM,CAAC,eAAC,CAAC,IAAI,CAAC,CAAA;IACpB,CAAC;SAAM,CAAC;QACN,GAAG,CAAC,MAAM,CAAC,IAAA,WAAC,EAAA,GAAG,YAAY,SAAS,EAAE,IAAI,CAAC,CAAA;QAC3C,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IAClB,CAAC;AACH,CAAC;AAVD,oDAUC;AAED,SAAgB,iBAAiB,CAAC,EAAa,EAAE,KAAW;IAC1D,MAAM,EAAC,GAAG,EAAE,MAAM,EAAC,GAAG,EAAE,CAAA;IACxB,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;QACrB,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA,CAAC,WAAW;QACjC,gBAAgB,CAAC,EAAE,CAAC,CAAA;IACtB,CAAC;SAAM,CAAC;QACN,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA,CAAC,WAAW;IAClC,CAAC;AACH,CAAC;AARD,8CAQC;AAED,SAAS,gBAAgB,CAAC,EAAa,EAAE,iBAA2B;IAClE,MAAM,EAAC,GAAG,EAAE,IAAI,EAAC,GAAG,EAAE,CAAA;IACtB,sFAAsF;IACtF,MAAM,GAAG,GAAoB;QAC3B,GAAG;QACH,OAAO,EAAE,cAAc;QACvB,IAAI;QACJ,MAAM,EAAE,KAAK;QACb,UAAU,EAAE,KAAK;QACjB,WAAW,EAAE,KAAK;QAClB,MAAM,EAAE,EAAE;QACV,EAAE;KACH,CAAA;IACD,IAAA,oBAAW,EAAC,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,iBAAiB,CAAC,CAAA;AAC3D,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/dataType.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/dataType.d.ts new file mode 100644 index 0000000000..91a6194aef --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/dataType.d.ts @@ -0,0 +1,17 @@ +import type { ErrorObject, AnySchemaObject } from "../../types"; +import type { SchemaObjCxt } from ".."; +import { JSONType } from "../rules"; +import { Code, Name } from "../codegen"; +export declare enum DataType { + Correct = 0, + Wrong = 1 +} +export declare function getSchemaTypes(schema: AnySchemaObject): JSONType[]; +export declare function getJSONTypes(ts: unknown | unknown[]): JSONType[]; +export declare function coerceAndCheckDataType(it: SchemaObjCxt, types: JSONType[]): boolean; +export declare function checkDataType(dataType: JSONType, data: Name, strictNums?: boolean | "log", correct?: DataType): Code; +export declare function checkDataTypes(dataTypes: JSONType[], data: Name, strictNums?: boolean | "log", correct?: DataType): Code; +export type TypeError = ErrorObject<"type", { + type: string; +}>; +export declare function reportTypeError(it: SchemaObjCxt): void; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/dataType.js b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/dataType.js new file mode 100644 index 0000000000..6d03e0dc0e --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/dataType.js @@ -0,0 +1,203 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.reportTypeError = exports.checkDataTypes = exports.checkDataType = exports.coerceAndCheckDataType = exports.getJSONTypes = exports.getSchemaTypes = exports.DataType = void 0; +const rules_1 = require("../rules"); +const applicability_1 = require("./applicability"); +const errors_1 = require("../errors"); +const codegen_1 = require("../codegen"); +const util_1 = require("../util"); +var DataType; +(function (DataType) { + DataType[DataType["Correct"] = 0] = "Correct"; + DataType[DataType["Wrong"] = 1] = "Wrong"; +})(DataType || (exports.DataType = DataType = {})); +function getSchemaTypes(schema) { + const types = getJSONTypes(schema.type); + const hasNull = types.includes("null"); + if (hasNull) { + if (schema.nullable === false) + throw new Error("type: null contradicts nullable: false"); + } + else { + if (!types.length && schema.nullable !== undefined) { + throw new Error('"nullable" cannot be used without "type"'); + } + if (schema.nullable === true) + types.push("null"); + } + return types; +} +exports.getSchemaTypes = getSchemaTypes; +// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents +function getJSONTypes(ts) { + const types = Array.isArray(ts) ? ts : ts ? [ts] : []; + if (types.every(rules_1.isJSONType)) + return types; + throw new Error("type must be JSONType or JSONType[]: " + types.join(",")); +} +exports.getJSONTypes = getJSONTypes; +function coerceAndCheckDataType(it, types) { + const { gen, data, opts } = it; + const coerceTo = coerceToTypes(types, opts.coerceTypes); + const checkTypes = types.length > 0 && + !(coerceTo.length === 0 && types.length === 1 && (0, applicability_1.schemaHasRulesForType)(it, types[0])); + if (checkTypes) { + const wrongType = checkDataTypes(types, data, opts.strictNumbers, DataType.Wrong); + gen.if(wrongType, () => { + if (coerceTo.length) + coerceData(it, types, coerceTo); + else + reportTypeError(it); + }); + } + return checkTypes; +} +exports.coerceAndCheckDataType = coerceAndCheckDataType; +const COERCIBLE = new Set(["string", "number", "integer", "boolean", "null"]); +function coerceToTypes(types, coerceTypes) { + return coerceTypes + ? types.filter((t) => COERCIBLE.has(t) || (coerceTypes === "array" && t === "array")) + : []; +} +function coerceData(it, types, coerceTo) { + const { gen, data, opts } = it; + const dataType = gen.let("dataType", (0, codegen_1._) `typeof ${data}`); + const coerced = gen.let("coerced", (0, codegen_1._) `undefined`); + if (opts.coerceTypes === "array") { + gen.if((0, codegen_1._) `${dataType} == 'object' && Array.isArray(${data}) && ${data}.length == 1`, () => gen + .assign(data, (0, codegen_1._) `${data}[0]`) + .assign(dataType, (0, codegen_1._) `typeof ${data}`) + .if(checkDataTypes(types, data, opts.strictNumbers), () => gen.assign(coerced, data))); + } + gen.if((0, codegen_1._) `${coerced} !== undefined`); + for (const t of coerceTo) { + if (COERCIBLE.has(t) || (t === "array" && opts.coerceTypes === "array")) { + coerceSpecificType(t); + } + } + gen.else(); + reportTypeError(it); + gen.endIf(); + gen.if((0, codegen_1._) `${coerced} !== undefined`, () => { + gen.assign(data, coerced); + assignParentData(it, coerced); + }); + function coerceSpecificType(t) { + switch (t) { + case "string": + gen + .elseIf((0, codegen_1._) `${dataType} == "number" || ${dataType} == "boolean"`) + .assign(coerced, (0, codegen_1._) `"" + ${data}`) + .elseIf((0, codegen_1._) `${data} === null`) + .assign(coerced, (0, codegen_1._) `""`); + return; + case "number": + gen + .elseIf((0, codegen_1._) `${dataType} == "boolean" || ${data} === null + || (${dataType} == "string" && ${data} && ${data} == +${data})`) + .assign(coerced, (0, codegen_1._) `+${data}`); + return; + case "integer": + gen + .elseIf((0, codegen_1._) `${dataType} === "boolean" || ${data} === null + || (${dataType} === "string" && ${data} && ${data} == +${data} && !(${data} % 1))`) + .assign(coerced, (0, codegen_1._) `+${data}`); + return; + case "boolean": + gen + .elseIf((0, codegen_1._) `${data} === "false" || ${data} === 0 || ${data} === null`) + .assign(coerced, false) + .elseIf((0, codegen_1._) `${data} === "true" || ${data} === 1`) + .assign(coerced, true); + return; + case "null": + gen.elseIf((0, codegen_1._) `${data} === "" || ${data} === 0 || ${data} === false`); + gen.assign(coerced, null); + return; + case "array": + gen + .elseIf((0, codegen_1._) `${dataType} === "string" || ${dataType} === "number" + || ${dataType} === "boolean" || ${data} === null`) + .assign(coerced, (0, codegen_1._) `[${data}]`); + } + } +} +function assignParentData({ gen, parentData, parentDataProperty }, expr) { + // TODO use gen.property + gen.if((0, codegen_1._) `${parentData} !== undefined`, () => gen.assign((0, codegen_1._) `${parentData}[${parentDataProperty}]`, expr)); +} +function checkDataType(dataType, data, strictNums, correct = DataType.Correct) { + const EQ = correct === DataType.Correct ? codegen_1.operators.EQ : codegen_1.operators.NEQ; + let cond; + switch (dataType) { + case "null": + return (0, codegen_1._) `${data} ${EQ} null`; + case "array": + cond = (0, codegen_1._) `Array.isArray(${data})`; + break; + case "object": + cond = (0, codegen_1._) `${data} && typeof ${data} == "object" && !Array.isArray(${data})`; + break; + case "integer": + cond = numCond((0, codegen_1._) `!(${data} % 1) && !isNaN(${data})`); + break; + case "number": + cond = numCond(); + break; + default: + return (0, codegen_1._) `typeof ${data} ${EQ} ${dataType}`; + } + return correct === DataType.Correct ? cond : (0, codegen_1.not)(cond); + function numCond(_cond = codegen_1.nil) { + return (0, codegen_1.and)((0, codegen_1._) `typeof ${data} == "number"`, _cond, strictNums ? (0, codegen_1._) `isFinite(${data})` : codegen_1.nil); + } +} +exports.checkDataType = checkDataType; +function checkDataTypes(dataTypes, data, strictNums, correct) { + if (dataTypes.length === 1) { + return checkDataType(dataTypes[0], data, strictNums, correct); + } + let cond; + const types = (0, util_1.toHash)(dataTypes); + if (types.array && types.object) { + const notObj = (0, codegen_1._) `typeof ${data} != "object"`; + cond = types.null ? notObj : (0, codegen_1._) `!${data} || ${notObj}`; + delete types.null; + delete types.array; + delete types.object; + } + else { + cond = codegen_1.nil; + } + if (types.number) + delete types.integer; + for (const t in types) + cond = (0, codegen_1.and)(cond, checkDataType(t, data, strictNums, correct)); + return cond; +} +exports.checkDataTypes = checkDataTypes; +const typeError = { + message: ({ schema }) => `must be ${schema}`, + params: ({ schema, schemaValue }) => typeof schema == "string" ? (0, codegen_1._) `{type: ${schema}}` : (0, codegen_1._) `{type: ${schemaValue}}`, +}; +function reportTypeError(it) { + const cxt = getTypeErrorContext(it); + (0, errors_1.reportError)(cxt, typeError); +} +exports.reportTypeError = reportTypeError; +function getTypeErrorContext(it) { + const { gen, data, schema } = it; + const schemaCode = (0, util_1.schemaRefOrVal)(it, schema, "type"); + return { + gen, + keyword: "type", + data, + schema: schema.type, + schemaCode, + schemaValue: schemaCode, + parentSchema: schema, + params: {}, + it, + }; +} +//# sourceMappingURL=dataType.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/dataType.js.map b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/dataType.js.map new file mode 100644 index 0000000000..c8fb1c6e84 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/dataType.js.map @@ -0,0 +1 @@ +{"version":3,"file":"dataType.js","sourceRoot":"","sources":["../../../lib/compile/validate/dataType.ts"],"names":[],"mappings":";;;AAOA,oCAA6C;AAC7C,mDAAqD;AACrD,sCAAqC;AACrC,wCAAkE;AAClE,kCAA8C;AAE9C,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,6CAAO,CAAA;IACP,yCAAK,CAAA;AACP,CAAC,EAHW,QAAQ,wBAAR,QAAQ,QAGnB;AAED,SAAgB,cAAc,CAAC,MAAuB;IACpD,MAAM,KAAK,GAAG,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IACvC,MAAM,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;IACtC,IAAI,OAAO,EAAE,CAAC;QACZ,IAAI,MAAM,CAAC,QAAQ,KAAK,KAAK;YAAE,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAA;IAC1F,CAAC;SAAM,CAAC;QACN,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;YACnD,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAA;QAC7D,CAAC;QACD,IAAI,MAAM,CAAC,QAAQ,KAAK,IAAI;YAAE,KAAK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AAO,CAAC,CAAC,CAAA;IAChG,OAAO,IAAI,CAAA;AACb,CAAC;AAvBD,wCAuBC;AAID,MAAM,SAAS,GAA2B;IACxC,OAAO,EAAE,CAAC,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,WAAW,MAAM,EAAE;IAC1C,MAAM,EAAE,CAAC,EAAC,MAAM,EAAE,WAAW,EAAC,EAAE,EAAE,CAChC,OAAO,MAAM,IAAI,QAAQ,CAAC,CAAC,CAAC,IAAA,WAAC,EAAA,UAAU,MAAM,GAAG,CAAC,CAAC,CAAC,IAAA,WAAC,EAAA,UAAU,WAAW,GAAG;CAC/E,CAAA;AAED,SAAgB,eAAe,CAAC,EAAgB;IAC9C,MAAM,GAAG,GAAG,mBAAmB,CAAC,EAAE,CAAC,CAAA;IACnC,IAAA,oBAAW,EAAC,GAAG,EAAE,SAAS,CAAC,CAAA;AAC7B,CAAC;AAHD,0CAGC;AAED,SAAS,mBAAmB,CAAC,EAAgB;IAC3C,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAC,GAAG,EAAE,CAAA;IAC9B,MAAM,UAAU,GAAG,IAAA,qBAAc,EAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;IACrD,OAAO;QACL,GAAG;QACH,OAAO,EAAE,MAAM;QACf,IAAI;QACJ,MAAM,EAAE,MAAM,CAAC,IAAI;QACnB,UAAU;QACV,WAAW,EAAE,UAAU;QACvB,YAAY,EAAE,MAAM;QACpB,MAAM,EAAE,EAAE;QACV,EAAE;KACH,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/defaults.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/defaults.d.ts new file mode 100644 index 0000000000..02ba453b23 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/defaults.d.ts @@ -0,0 +1,2 @@ +import type { SchemaObjCxt } from ".."; +export declare function assignDefaults(it: SchemaObjCxt, ty?: string): void; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/defaults.js b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/defaults.js new file mode 100644 index 0000000000..cd9c42d9aa --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/defaults.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.assignDefaults = void 0; +const codegen_1 = require("../codegen"); +const util_1 = require("../util"); +function assignDefaults(it, ty) { + const { properties, items } = it.schema; + if (ty === "object" && properties) { + for (const key in properties) { + assignDefault(it, key, properties[key].default); + } + } + else if (ty === "array" && Array.isArray(items)) { + items.forEach((sch, i) => assignDefault(it, i, sch.default)); + } +} +exports.assignDefaults = assignDefaults; +function assignDefault(it, prop, defaultValue) { + const { gen, compositeRule, data, opts } = it; + if (defaultValue === undefined) + return; + const childData = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(prop)}`; + if (compositeRule) { + (0, util_1.checkStrictMode)(it, `default is ignored for: ${childData}`); + return; + } + let condition = (0, codegen_1._) `${childData} === undefined`; + if (opts.useDefaults === "empty") { + condition = (0, codegen_1._) `${condition} || ${childData} === null || ${childData} === ""`; + } + // `${childData} === undefined` + + // (opts.useDefaults === "empty" ? ` || ${childData} === null || ${childData} === ""` : "") + gen.if(condition, (0, codegen_1._) `${childData} = ${(0, codegen_1.stringify)(defaultValue)}`); +} +//# sourceMappingURL=defaults.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/defaults.js.map b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/defaults.js.map new file mode 100644 index 0000000000..88d3672e9a --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/defaults.js.map @@ -0,0 +1 @@ +{"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../../lib/compile/validate/defaults.ts"],"names":[],"mappings":";;;AACA,wCAAoD;AACpD,kCAAuC;AAEvC,SAAgB,cA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jC,2FAA2F;IAC3F,GAAG,CAAC,EAAE,CAAC,SAAS,EAAE,IAAA,WAAC,EAAA,GAAG,SAAS,MAAM,IAAA,mBAAS,EAAC,YAAY,CAAC,EAAE,CAAC,CAAA;AACjE,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/index.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/index.d.ts new file mode 100644 index 0000000000..6c533ed72e --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/index.d.ts @@ -0,0 +1,42 @@ +import type { AddedKeywordDefinition, AnySchemaObject, KeywordErrorCxt, KeywordCxtParams } from "../../types"; +import type { SchemaCxt, SchemaObjCxt } from ".."; +import { SubschemaArgs } from "./subschema"; +import { Code, Name, CodeGen } from "../codegen"; +import type { JSONType } from "../rules"; +import { ErrorPaths } from "../errors"; +export declare function validateFunctionCode(it: SchemaCxt): void; +export declare class KeywordCxt implements KeywordErrorCxt { + readonly gen: CodeGen; + readonly allErrors?: boolean; + readonly keyword: string; + readonly data: Name; + readonly $data?: string | false; + schema: any; + readonly schemaValue: Code | number | boolean; + readonly schemaCode: Code | number | boolean; + readonly schemaType: JSONType[]; + readonly parentSchema: AnySchemaObject; + readonly errsCount?: Name; + params: KeywordCxtParams; + readonly it: SchemaObjCxt; + readonly def: AddedKeywordDefinition; + constructor(it: SchemaObjCxt, def: AddedKeywordDefinition, keyword: string); + result(condition: Code, successAction?: () => void, failAction?: () => void): void; + failResult(condition: Code, successAction?: () => void, failAction?: () => void): void; + pass(condition: Code, failAction?: () => void): void; + fail(condition?: Code): void; + fail$data(condition: Code): void; + error(append?: boolean, errorParams?: KeywordCxtParams, errorPaths?: ErrorPaths): void; + private _error; + $dataError(): void; + reset(): void; + ok(cond: Code | boolean): void; + setParams(obj: KeywordCxtParams, assign?: true): void; + block$data(valid: Name, codeBlock: () => void, $dataValid?: Code): void; + check$data(valid?: Name, $dataValid?: Code): void; + invalid$data(): Code; + subschema(appl: SubschemaArgs, valid: Name): SchemaCxt; + mergeEvaluated(schemaCxt: SchemaCxt, toName?: typeof Name): void; + mergeValidEvaluated(schemaCxt: SchemaCxt, valid: Name): boolean | void; +} +export declare function getData($data: string, { dataLevel, dataNames, dataPathArr }: SchemaCxt): Code | number; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/index.js b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/index.js new file mode 100644 index 0000000000..0d683322ab --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/index.js @@ -0,0 +1,520 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getData = exports.KeywordCxt = exports.validateFunctionCode = void 0; +const boolSchema_1 = require("./boolSchema"); +const dataType_1 = require("./dataType"); +const applicability_1 = require("./applicability"); +const dataType_2 = require("./dataType"); +const defaults_1 = require("./defaults"); +const keyword_1 = require("./keyword"); +const subschema_1 = require("./subschema"); +const codegen_1 = require("../codegen"); +const names_1 = require("../names"); +const resolve_1 = require("../resolve"); +const util_1 = require("../util"); +const errors_1 = require("../errors"); +// schema compilation - generates validation function, subschemaCode (below) is used for subschemas +function validateFunctionCode(it) { + if (isSchemaObj(it)) { + checkKeywords(it); + if (schemaCxtHasRules(it)) { + topSchemaObjCode(it); + return; + } + } + validateFunction(it, () => (0, boolSchema_1.topBoolOrEmptySchema)(it)); +} +exports.validateFunctionCode = validateFunctionCode; +function validateFunction({ gen, validateName, schema, schemaEnv, opts }, body) { + if (opts.code.es5) { + gen.func(validateName, (0, codegen_1._) `${names_1.default.data}, ${names_1.default.valCxt}`, schemaEnv.$async, () => { + gen.code((0, codegen_1._) `"use strict"; ${funcSourceUrl(schema, opts)}`); + destructureValCxtES5(gen, opts); + gen.code(body); + }); + } + else { + gen.func(validateName, (0, codegen_1._) `${names_1.default.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => gen.code(funcSourceUrl(schema, opts)).code(body)); + } +} +function destructureValCxt(opts) { + return (0, codegen_1._) `{${names_1.default.instancePath}="", ${names_1.default.parentData}, ${names_1.default.parentDataProperty}, ${names_1.default.rootData}=${names_1.default.data}${opts.dynamicRef ? (0, codegen_1._) `, ${names_1.default.dynamicAnchors}={}` : codegen_1.nil}}={}`; +} +function destructureValCxtES5(gen, opts) { + gen.if(names_1.default.valCxt, () => { + gen.var(names_1.default.instancePath, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.instancePath}`); + gen.var(names_1.default.parentData, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.parentData}`); + gen.var(names_1.default.parentDataProperty, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.parentDataProperty}`); + gen.var(names_1.default.rootData, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.rootData}`); + if (opts.dynamicRef) + gen.var(names_1.default.dynamicAnchors, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.dynamicAnchors}`); + }, () => { + gen.var(names_1.default.instancePath, (0, codegen_1._) `""`); + gen.var(names_1.default.parentData, (0, codegen_1._) `undefined`); + gen.var(names_1.default.parentDataProperty, (0, codegen_1._) `undefined`); + gen.var(names_1.default.rootData, names_1.default.data); + if (opts.dynamicRef) + gen.var(names_1.default.dynamicAnchors, (0, codegen_1._) `{}`); + }); +} +function topSchemaObjCode(it) { + const { schema, opts, gen } = it; + validateFunction(it, () => { + if (opts.$comment && schema.$comment) + commentKeyword(it); + checkNoDefault(it); + gen.let(names_1.default.vErrors, null); + gen.let(names_1.default.errors, 0); + if (opts.unevaluated) + resetEvaluated(it); + typeAndKeywords(it); + returnResults(it); + }); + return; +} +function resetEvaluated(it) { + // TODO maybe some hook to execute it in the end to check whether props/items are Name, as in assignEvaluated + const { gen, validateName } = it; + it.evaluated = gen.const("evaluated", (0, codegen_1._) `${validateName}.evaluated`); + gen.if((0, codegen_1._) `${it.evaluated}.dynamicProps`, () => gen.assign((0, codegen_1._) `${it.evaluated}.props`, (0, codegen_1._) `undefined`)); + gen.if((0, codegen_1._) `${it.evaluated}.dynamicItems`, () => gen.assign((0, codegen_1._) `${it.evaluated}.items`, (0, codegen_1._) `undefined`)); +} +function funcSourceUrl(schema, opts) { + const schId = typeof schema == "object" && schema[opts.schemaId]; + return schId && (opts.code.source || opts.code.process) ? (0, codegen_1._) `/*# sourceURL=${schId} */` : codegen_1.nil; +} +// schema compilation - this function is used recursively to generate code for sub-schemas +function subschemaCode(it, valid) { + if (isSchemaObj(it)) { + checkKeywords(it); + if (schemaCxtHasRules(it)) { + subSchemaObjCode(it, valid); + return; + } + } + (0, boolSchema_1.boolOrEmptySchema)(it, valid); +} +function schemaCxtHasRules({ schema, self }) { + if (typeof schema == "boolean") + return !schema; + for (const key in schema) + if (self.RULES.all[key]) + return true; + return false; +} +function isSchemaObj(it) { + return typeof it.schema != "boolean"; +} +function subSchemaObjCode(it, valid) { + const { schema, gen, opts } = it; + if (opts.$comment && schema.$comment) + commentKeyword(it); + updateContext(it); + checkAsyncSchema(it); + const errsCount = gen.const("_errs", names_1.default.errors); + typeAndKeywords(it, errsCount); + // TODO var + gen.var(valid, (0, codegen_1._) `${errsCount} === ${names_1.default.errors}`); +} +function checkKeywords(it) { + (0, util_1.checkUnknownRules)(it); + checkRefsAndKeywords(it); +} +function typeAndKeywords(it, errsCount) { + if (it.opts.jtd) + return schemaKeywords(it, [], false, errsCount); + const types = (0, dataType_1.getSchemaTypes)(it.schema); + const checkedTypes = (0, dataType_1.coerceAndCheckDataType)(it, types); + schemaKeywords(it, types, !checkedTypes, errsCount); +} +function checkRefsAndKeywords(it) { + const { schema, errSchemaPath, opts, self } = it; + if (schema.$ref && opts.ignoreKeywordsWithRef && (0, util_1.schemaHasRulesButRef)(schema, self.RULES)) { + self.logger.warn(`$ref: keywords ignored in schema at path "${errSchemaPath}"`); + } +} +function checkNoDefault(it) { + const { schema, opts } = it; + if (schema.default !== undefined && opts.useDefaults && opts.strictSchema) { + (0, util_1.checkStrictMode)(it, "default is ignored in the schema root"); + } +} +function updateContext(it) { + const schId = it.schema[it.opts.schemaId]; + if (schId) + it.baseId = (0, resolve_1.resolveUrl)(it.opts.uriResolver, it.baseId, schId); +} +function checkAsyncSchema(it) { + if (it.schema.$async && !it.schemaEnv.$async) + throw new Error("async schema in sync schema"); +} +function commentKeyword({ gen, schemaEnv, schema, errSchemaPath, opts }) { + const msg = schema.$comment; + if (opts.$comment === true) { + gen.code((0, codegen_1._) `${names_1.default.self}.logger.log(${msg})`); + } + else if (typeof opts.$comment == "function") { + const schemaPath = (0, codegen_1.str) `${errSchemaPath}/$comment`; + const rootName = gen.scopeValue("root", { ref: schemaEnv.root }); + gen.code((0, codegen_1._) `${names_1.default.self}.opts.$comment(${msg}, ${schemaPath}, ${rootName}.schema)`); + } +} +function returnResults(it) { + const { gen, schemaEnv, validateName, ValidationError, opts } = it; + if (schemaEnv.$async) { + // TODO assign unevaluated + gen.if((0, codegen_1._) `${names_1.default.errors} === 0`, () => gen.return(names_1.default.data), () => gen.throw((0, codegen_1._) `new ${ValidationError}(${names_1.default.vErrors})`)); + } + else { + gen.assign((0, codegen_1._) `${validateName}.errors`, names_1.default.vErrors); + if (opts.unevaluated) + assignEvaluated(it); + gen.return((0, codegen_1._) `${names_1.default.errors} === 0`); + } +} +function assignEvaluated({ gen, evaluated, props, items }) { + if (props instanceof codegen_1.Name) + gen.assign((0, codegen_1._) `${evaluated}.props`, props); + if (items instanceof codegen_1.Name) + gen.assign((0, codegen_1._) `${evaluated}.items`, items); +} +function schemaKeywords(it, types, typeErrors, errsCount) { + const { gen, schema, data, allErrors, opts, self } = it; + const { RULES } = self; + if (schema.$ref && (opts.ignoreKeywordsWithRef || !(0, util_1.schemaHasRulesButRef)(schema, RULES))) { + gen.block(() => keywordCode(it, "$ref", RULES.all.$ref.definition)); // TODO typecast + return; + } + if (!opts.jtd) + checkStrictTypes(it, types); + gen.block(() => { + for (const group of RULES.rules) + groupKeywords(group); + groupKeywords(RULES.post); + }); + function groupKeywords(group) { + if (!(0, applicability_1.shouldUseGroup)(schema, group)) + return; + if (group.type) { + gen.if((0, dataType_2.checkDataType)(group.type, data, opts.strictNumbers)); + iterateKeywords(it, group); + if (types.length === 1 && types[0] === group.type && typeErrors) { + gen.else(); + (0, dataType_2.reportTypeError)(it); + } + gen.endIf(); + } + else { + iterateKeywords(it, group); + } + // TODO make it "ok" call? + if (!allErrors) + gen.if((0, codegen_1._) `${names_1.default.errors} === ${errsCount || 0}`); + } +} +function iterateKeywords(it, group) { + const { gen, schema, opts: { useDefaults }, } = it; + if (useDefaults) + (0, defaults_1.assignDefaults)(it, group.type); + gen.block(() => { + for (const rule of group.rules) { + if ((0, applicability_1.shouldUseRule)(schema, rule)) { + keywordCode(it, rule.keyword, rule.definition, group.type); + } + } + }); +} +function checkStrictTypes(it, types) { + if (it.schemaEnv.meta || !it.opts.strictTypes) + return; + checkContextTypes(it, types); + if (!it.opts.allowUnionTypes) + checkMultipleTypes(it, types); + checkKeywordTypes(it, it.dataTypes); +} +function checkContextTypes(it, types) { + if (!types.length) + return; + if (!it.dataTypes.length) { + it.dataTypes = types; + return; + } + types.forEach((t) => { + if (!includesType(it.dataTypes, t)) { + strictTypesError(it, `type "${t}" not allowed by context "${it.dataTypes.join(",")}"`); + } + }); + narrowSchemaTypes(it, types); +} +function checkMultipleTypes(it, ts) { + if (ts.length > 1 && !(ts.length === 2 && ts.includes("null"))) { + strictTypesError(it, "use allowUnionTypes to allow union type keyword"); + } +} +function checkKeywordTypes(it, ts) { + const rules = it.self.RULES.all; + for (const keyword in rules) { + const rule = rules[keyword]; + if (typeof rule == "object" && (0, applicability_1.shouldUseRule)(it.schema, rule)) { + const { type } = rule.definition; + if (type.length && !type.some((t) => hasApplicableType(ts, t))) { + strictTypesError(it, `missing type "${type.join(",")}" for keyword "${keyword}"`); + } + } + } +} +function hasApplicableType(schTs, kwdT) { + return schTs.includes(kwdT) || (kwdT === "number" && schTs.includes("integer")); +} +function includesType(ts, t) { + return ts.includes(t) || (t === "integer" && ts.includes("number")); +} +function narrowSchemaTypes(it, withTypes) { + const ts = []; + for (const t of it.dataTypes) { + if (includesType(withTypes, t)) + ts.push(t); + else if (withTypes.includes("integer") && t === "number") + ts.push("integer"); + } + it.dataTypes = ts; +} +function strictTypesError(it, msg) { + const schemaPath = it.schemaEnv.baseId + it.errSchemaPath; + msg += ` at "${schemaPath}" (strictTypes)`; + (0, util_1.checkStrictMode)(it, msg, it.opts.strictTypes); +} +class KeywordCxt { + constructor(it, def, keyword) { + (0, keyword_1.validateKeywordUsage)(it, def, keyword); + this.gen = it.gen; + this.allErrors = it.allErrors; + this.keyword = keyword; + this.data = it.data; + this.schema = it.schema[keyword]; + this.$data = def.$data && it.opts.$data && this.schema && this.schema.$data; + this.schemaValue = (0, util_1.schemaRefOrVal)(it, this.schema, keyword, this.$data); + this.schemaType = def.schemaType; + this.parentSchema = it.schema; + this.params = {}; + this.it = it; + this.def = def; + if (this.$data) { + this.schemaCode = it.gen.const("vSchema", getData(this.$data, it)); + } + else { + this.schemaCode = this.schemaValue; + if (!(0, keyword_1.validSchemaType)(this.schema, def.schemaType, def.allowUndefined)) { + throw new Error(`${keyword} value must be ${JSON.stringify(def.schemaType)}`); + } + } + if ("code" in def ? def.trackErrors : def.errors !== false) { + this.errsCount = it.gen.const("_errs", names_1.default.errors); + } + } + result(condition, successAction, failAction) { + this.failResult((0, codegen_1.not)(condition), successAction, failAction); + } + failResult(condition, successAction, failAction) { + this.gen.if(condition); + if (failAction) + failAction(); + else + this.error(); + if (successAction) { + this.gen.else(); + successAction(); + if (this.allErrors) + this.gen.endIf(); + } + else { + if (this.allErrors) + this.gen.endIf(); + else + this.gen.else(); + } + } + pass(condition, failAction) { + this.failResult((0, codegen_1.not)(condition), undefined, failAction); + } + fail(condition) { + if (condition === undefined) { + this.error(); + if (!this.allErrors) + this.gen.if(false); // this branch will be removed by gen.optimize + return; + } + this.gen.if(condition); + this.error(); + if (this.allErrors) + this.gen.endIf(); + else + this.gen.else(); + } + fail$data(condition) { + if (!this.$data) + return this.fail(condition); + const { schemaCode } = this; + this.fail((0, codegen_1._) `${schemaCode} !== undefined && (${(0, codegen_1.or)(this.invalid$data(), condition)})`); + } + error(append, errorParams, errorPaths) { + if (errorParams) { + this.setParams(errorParams); + this._error(append, errorPaths); + this.setParams({}); + return; + } + this._error(append, errorPaths); + } + _error(append, errorPaths) { + ; + (append ? errors_1.reportExtraError : errors_1.reportError)(this, this.def.error, errorPaths); + } + $dataError() { + (0, errors_1.reportError)(this, this.def.$dataError || errors_1.keyword$DataError); + } + reset() { + if (this.errsCount === undefined) + throw new Error('add "trackErrors" to keyword definition'); + (0, errors_1.resetErrorsCount)(this.gen, this.errsCount); + } + ok(cond) { + if (!this.allErrors) + this.gen.if(cond); + } + setParams(obj, assign) { + if (assign) + Object.assign(this.params, obj); + else + this.params = obj; + } + block$data(valid, codeBlock, $dataValid = codegen_1.nil) { + this.gen.block(() => { + this.check$data(valid, $dataValid); + codeBlock(); + }); + } + check$data(valid = codegen_1.nil, $dataValid = codegen_1.nil) { + if (!this.$data) + return; + const { gen, schemaCode, schemaType, def } = this; + gen.if((0, codegen_1.or)((0, codegen_1._) `${schemaCode} === undefined`, $dataValid)); + if (valid !== codegen_1.nil) + gen.assign(valid, true); + if (schemaType.length || def.validateSchema) { + gen.elseIf(this.invalid$data()); + this.$dataError(); + if (valid !== codegen_1.nil) + gen.assign(valid, false); + } + gen.else(); + } + invalid$data() { + const { gen, schemaCode, schemaType, def, it } = this; + return (0, codegen_1.or)(wrong$DataType(), invalid$DataSchema()); + function wrong$DataType() { + if (schemaType.length) { + /* istanbul ignore if */ + if (!(schemaCode instanceof codegen_1.Name)) + throw new Error("ajv implementation error"); + const st = Array.isArray(schemaType) ? schemaType : [schemaType]; + return (0, codegen_1._) `${(0, dataType_2.checkDataTypes)(st, schemaCode, it.opts.strictNumbers, dataType_2.DataType.Wrong)}`; + } + return codegen_1.nil; + } + function invalid$DataSchema() { + if (def.validateSchema) { + const validateSchemaRef = gen.scopeValue("validate$data", { ref: def.validateSchema }); // TODO value.code for standalone + return (0, codegen_1._) `!${validateSchemaRef}(${schemaCode})`; + } + return codegen_1.nil; + } + } + subschema(appl, valid) { + const subschema = (0, subschema_1.getSubschema)(this.it, appl); + (0, subschema_1.extendSubschemaData)(subschema, this.it, appl); + (0, subschema_1.extendSubschemaMode)(subschema, appl); + const nextContext = { ...this.it, ...subschema, items: undefined, props: undefined }; + subschemaCode(nextContext, valid); + return nextContext; + } + mergeEvaluated(schemaCxt, toName) { + const { it, gen } = this; + if (!it.opts.unevaluated) + return; + if (it.props !== true && schemaCxt.props !== undefined) { + it.props = util_1.mergeEvaluated.props(gen, schemaCxt.props, it.props, toName); + } + if (it.items !== true && schemaCxt.items !== undefined) { + it.items = util_1.mergeEvaluated.items(gen, schemaCxt.items, it.items, toName); + } + } + mergeValidEvaluated(schemaCxt, valid) { + const { it, gen } = this; + if (it.opts.unevaluated && (it.props !== true || it.items !== true)) { + gen.if(valid, () => this.mergeEvaluated(schemaCxt, codegen_1.Name)); + return true; + } + } +} +exports.KeywordCxt = KeywordCxt; +function keywordCode(it, keyword, def, ruleType) { + const cxt = new KeywordCxt(it, def, keyword); + if ("code" in def) { + def.code(cxt, ruleType); + } + else if (cxt.$data && def.validate) { + (0, keyword_1.funcKeywordCode)(cxt, def); + } + else if ("macro" in def) { + (0, keyword_1.macroKeywordCode)(cxt, def); + } + else if (def.compile || def.validate) { + (0, keyword_1.funcKeywordCode)(cxt, def); + } +} +const JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/; +const RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/; +function getData($data, { dataLevel, dataNames, dataPathArr }) { + let jsonPointer; + let data; + if ($data === "") + return names_1.default.rootData; + if ($data[0] === "/") { + if (!JSON_POINTER.test($data)) + throw new Error(`Invalid JSON-pointer: ${$data}`); + jsonPointer = $data; + data = names_1.default.rootData; + } + else { + const matches = RELATIVE_JSON_POINTER.exec($data); + if (!matches) + throw new Error(`Invalid JSON-pointer: ${$data}`); + const up = +matches[1]; + jsonPointer = matches[2]; + if (jsonPointer === "#") { + if (up >= dataLevel) + throw new Error(errorMsg("property/index", up)); + return dataPathArr[dataLevel - up]; + } + if (up > dataLevel) + throw new Error(errorMsg("data", up)); + data = dataNames[dataLevel - up]; + if (!jsonPointer) + return data; + } + let expr = data; + const segments = jsonPointer.split("/"); + for (const segment of segments) { + if (segment) { + data = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)((0, util_1.unescapeJsonPointer)(segment))}`; + expr = (0, codegen_1._) `${expr} && ${data}`; + } + } + return expr; + function errorMsg(pointerType, up) { + return `Cannot access ${pointerType} ${up} levels up, current level is ${dataLevel}`; + } +} +exports.getData = getData; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/index.js.map b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/index.js.map new file mode 100644 index 0000000000..cdf5854ea0 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/compile/validate/index.ts"],"names":[],"mappings":";;;AASA,6CAAoE;AACpE,yCAAiE;AACjE,mDAA6D;AAC7D,yCAAmF;AACnF,yCAAyC;AACzC,uCAAkG;AAClG,2CAAiG;AACjG,wCAAwF;AACxF,oCAAwB;AACxB,wCAAqC;AACrC,kCAOgB;AAEhB,sCAMkB;AAElB,mGAAmG;AACnG,SAAgB,oBAAoB,CAAC,EAAa;IAChD,IAAI,WAAW,CAAC,EAAE,CAAC,EAAE,CAAC;QACpB,aAAa,CAAC,EAAE,CAAC,CAAA;QACjB,IAAI,iBAAiB,CAAC,EAAE,CAAC,EAAE,CAAC;YAC1B,gBAAgB,CAAC,EAAE,CAAC,CAAA;YACpB,OAAM;QACR,CAAC;IACH,CAAC;IACD,gBAAgB,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,IAAA,iCAAoB,E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B,WAAW,IAAI,EAAE,gCAAgC,SAAS,EAAE,CAAA;IACtF,CAAC;AACH,CAAC;AAtCD,0BAsCC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/keyword.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/keyword.d.ts new file mode 100644 index 0000000000..d15cee8780 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/keyword.d.ts @@ -0,0 +1,8 @@ +import type { KeywordCxt } from "."; +import type { AddedKeywordDefinition, MacroKeywordDefinition, FuncKeywordDefinition } from "../../types"; +import type { SchemaObjCxt } from ".."; +import type { JSONType } from "../rules"; +export declare function macroKeywordCode(cxt: KeywordCxt, def: MacroKeywordDefinition): void; +export declare function funcKeywordCode(cxt: KeywordCxt, def: FuncKeywordDefinition): void; +export declare function validSchemaType(schema: unknown, schemaType: JSONType[], allowUndefined?: boolean): boolean; +export declare function validateKeywordUsage({ schema, opts, self, errSchemaPath }: SchemaObjCxt, def: AddedKeywordDefinition, keyword: string): void; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/keyword.js b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/keyword.js new file mode 100644 index 0000000000..1109d3a451 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/keyword.js @@ -0,0 +1,124 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.validateKeywordUsage = exports.validSchemaType = exports.funcKeywordCode = exports.macroKeywordCode = void 0; +const codegen_1 = require("../codegen"); +const names_1 = require("../names"); +const code_1 = require("../../vocabularies/code"); +const errors_1 = require("../errors"); +function macroKeywordCode(cxt, def) { + const { gen, keyword, schema, parentSchema, it } = cxt; + const macroSchema = def.macro.call(it.self, schema, parentSchema, it); + const schemaRef = useKeyword(gen, keyword, macroSchema); + if (it.opts.validateSchema !== false) + it.self.validateSchema(macroSchema, true); + const valid = gen.name("valid"); + cxt.subschema({ + schema: macroSchema, + schemaPath: codegen_1.nil, + errSchemaPath: `${it.errSchemaPath}/${keyword}`, + topSchemaRef: schemaRef, + compositeRule: true, + }, valid); + cxt.pass(valid, () => cxt.error(true)); +} +exports.macroKeywordCode = macroKeywordCode; +function funcKeywordCode(cxt, def) { + var _a; + const { gen, keyword, schema, parentSchema, $data, it } = cxt; + checkAsyncKeyword(it, def); + const validate = !$data && def.compile ? def.compile.call(it.self, schema, parentSchema, it) : def.validate; + const validateRef = useKeyword(gen, keyword, validate); + const valid = gen.let("valid"); + cxt.block$data(valid, validateKeyword); + cxt.ok((_a = def.valid) !== null && _a !== void 0 ? _a : valid); + function validateKeyword() { + if (def.errors === false) { + assignValid(); + if (def.modifying) + modifyData(cxt); + reportErrs(() => cxt.error()); + } + else { + const ruleErrs = def.async ? validateAsync() : validateSync(); + if (def.modifying) + modifyData(cxt); + reportErrs(() => addErrs(cxt, ruleErrs)); + } + } + function validateAsync() { + const ruleErrs = gen.let("ruleErrs", null); + gen.try(() => assignValid((0, codegen_1._) `await `), (e) => gen.assign(valid, false).if((0, codegen_1._) `${e} instanceof ${it.ValidationError}`, () => gen.assign(ruleErrs, (0, codegen_1._) `${e}.errors`), () => gen.throw(e))); + return ruleErrs; + } + function validateSync() { + const validateErrs = (0, codegen_1._) `${validateRef}.errors`; + gen.assign(validateErrs, null); + assignValid(codegen_1.nil); + return validateErrs; + } + function assignValid(_await = def.async ? (0, codegen_1._) `await ` : codegen_1.nil) { + const passCxt = it.opts.passContext ? names_1.default.this : names_1.default.self; + const passSchema = !(("compile" in def && !$data) || def.schema === false); + gen.assign(valid, (0, codegen_1._) `${_await}${(0, code_1.callValidateCode)(cxt, validateRef, passCxt, passSchema)}`, def.modifying); + } + function reportErrs(errors) { + var _a; + gen.if((0, codegen_1.not)((_a = def.valid) !== null && _a !== void 0 ? _a : valid), errors); + } +} +exports.funcKeywordCode = funcKeywordCode; +function modifyData(cxt) { + const { gen, data, it } = cxt; + gen.if(it.parentData, () => gen.assign(data, (0, codegen_1._) `${it.parentData}[${it.parentDataProperty}]`)); +} +function addErrs(cxt, errs) { + const { gen } = cxt; + gen.if((0, codegen_1._) `Array.isArray(${errs})`, () => { + gen + .assign(names_1.default.vErrors, (0, codegen_1._) `${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`) + .assign(names_1.default.errors, (0, codegen_1._) `${names_1.default.vErrors}.length`); + (0, errors_1.extendErrors)(cxt); + }, () => cxt.error()); +} +function checkAsyncKeyword({ schemaEnv }, def) { + if (def.async && !schemaEnv.$async) + throw new Error("async keyword in sync schema"); +} +function useKeyword(gen, keyword, result) { + if (result === undefined) + throw new Error(`keyword "${keyword}" failed to compile`); + return gen.scopeValue("keyword", typeof result == "function" ? { ref: result } : { ref: result, code: (0, codegen_1.stringify)(result) }); +} +function validSchemaType(schema, schemaType, allowUndefined = false) { + // TODO add tests + return (!schemaType.length || + schemaType.some((st) => st === "array" + ? Array.isArray(schema) + : st === "object" + ? schema && typeof schema == "object" && !Array.isArray(schema) + : typeof schema == st || (allowUndefined && typeof schema == "undefined"))); +} +exports.validSchemaType = validSchemaType; +function validateKeywordUsage({ schema, opts, self, errSchemaPath }, def, keyword) { + /* istanbul ignore if */ + if (Array.isArray(def.keyword) ? !def.keyword.includes(keyword) : def.keyword !== keyword) { + throw new Error("ajv implementation error"); + } + const deps = def.dependencies; + if (deps === null || deps === void 0 ? void 0 : deps.some((kwd) => !Object.prototype.hasOwnProperty.call(schema, kwd))) { + throw new Error(`parent schema must have dependencies of ${keyword}: ${deps.join(",")}`); + } + if (def.validateSchema) { + const valid = def.validateSchema(schema[keyword]); + if (!valid) { + const msg = `keyword "${keyword}" value is invalid at path "${errSchemaPath}": ` + + self.errorsText(def.validateSchema.errors); + if (opts.validateSchema === "log") + self.logger.error(msg); + else + throw new Error(msg); + } + } +} +exports.validateKeywordUsage = validateKeywordUsage; +//# sourceMappingURL=keyword.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/keyword.js.map b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/keyword.js.map new file mode 100644 index 0000000000..ad1d1b99ab --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/keyword.js.map @@ -0,0 +1 @@ +{"version":3,"file":"keyword.js","sourceRoot":"","sources":["../../../lib/compile/validate/keyword.ts"],"names":[],"mappings":";;;AAUA,wCAAsE;AACtE,oCAAwB;AAExB,kDAAwD;AACxD,sCAAsC;AAItC,SAAgB,gBAAgB,CAAC,GAAe,EAAE,GAA2B;IAC3E,MAAM,EAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;IACpD,MAAM,WAAW,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,CAAC,CAAA;IACrE,MAAM,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE,OAAO,EAAE,WAAW,CAAC,CAAA;IACvD,IAAI,EAAE,CAAC,IAAI,CAAC,cAAc,KAAK,KAAK;QAAE,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,WAAW,EAAE,IAAI,CAAC,CAAA;IAE/E,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAC/B,GAAG,CAAC,SAAS,CACX;QACE,MAAM,EAAE,WAAW;QACnB,UAAU,EAAE,aAAG;QACf,aAAa,EAAE,GAAG,EAAE,CAAC,aAAa,IAAI,OAAO,EAAE;QAC/C,YAAY,EAAE,SAAS;QACvB,aAAa,EAAE,IAAI;KACpB,EACD,KAAK,CACN,CAAA;IACD,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAA;AACxC,CAAC;AAlBD,4CAkBC;AAED,SAAgB,eAAe,CAAC,GAAe,EAAE,GAA0B;;IACzE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CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,KAAK,OAAO,EAAE,CAAC;QAC1F,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;IAC7C,CAAC;IAED,MAAM,IAAI,GAAG,GAAG,CAAC,YAAY,CAAA;IAC7B,IAAI,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC;QAC5E,MAAM,IAAI,KAAK,CAAC,2CAA2C,OAAO,KAAK,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;IAC1F,CAAC;IAED,IAAI,GAAG,CAAC,cAAc,EAAE,CAAC;QACvB,MAAM,KAAK,GAAG,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;QACjD,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,GAAG,GACP,YAAY,OAAO,+BAA+B,aAAa,KAAK;gBACpE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,CAAA;YAC5C,IAAI,IAAI,CAAC,cAAc,KAAK,KAAK;gBAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;;gBACpD,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CAAA;QAC3B,CAAC;IACH,CAAC;AACH,CAAC;AAzBD,oDAyBC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/subschema.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/subschema.d.ts new file mode 100644 index 0000000000..b92785f2d7 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/subschema.d.ts @@ -0,0 +1,47 @@ +import type { AnySchema } from "../../types"; +import type { SchemaObjCxt } from ".."; +import { Code, Name } from "../codegen"; +import { Type } from "../util"; +import type { JSONType } from "../rules"; +export interface SubschemaContext { + schema: AnySchema; + schemaPath: Code; + errSchemaPath: string; + topSchemaRef?: Code; + errorPath?: Code; + dataLevel?: number; + dataTypes?: JSONType[]; + data?: Name; + parentData?: Name; + parentDataProperty?: Code | number; + dataNames?: Name[]; + dataPathArr?: (Code | number)[]; + propertyName?: Name; + jtdDiscriminator?: string; + jtdMetadata?: boolean; + compositeRule?: true; + createErrors?: boolean; + allErrors?: boolean; +} +export type SubschemaArgs = Partial<{ + keyword: string; + schemaProp: string | number; + schema: AnySchema; + schemaPath: Code; + errSchemaPath: string; + topSchemaRef: Code; + data: Name | Code; + dataProp: Code | string | number; + dataTypes: JSONType[]; + definedProperties: Set; + propertyName: Name; + dataPropType: Type; + jtdDiscriminator: string; + jtdMetadata: boolean; + compositeRule: true; + createErrors: boolean; + allErrors: boolean; +}>; +export declare function getSubschema(it: SchemaObjCxt, { keyword, schemaProp, schema, schemaPath, errSchemaPath, topSchemaRef }: SubschemaArgs): SubschemaContext; +export declare function extendSubschemaData(subschema: SubschemaContext, it: SchemaObjCxt, { dataProp, dataPropType: dpType, data, dataTypes, propertyName }: SubschemaArgs): void; +export declare function extendSubschemaMode(subschema: SubschemaContext, { jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors }: SubschemaArgs): void; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/subschema.js b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/subschema.js new file mode 100644 index 0000000000..9de2828690 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/subschema.js @@ -0,0 +1,81 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.extendSubschemaMode = exports.extendSubschemaData = exports.getSubschema = void 0; +const codegen_1 = require("../codegen"); +const util_1 = require("../util"); +function getSubschema(it, { keyword, schemaProp, schema, schemaPath, errSchemaPath, topSchemaRef }) { + if (keyword !== undefined && schema !== undefined) { + throw new Error('both "keyword" and "schema" passed, only one allowed'); + } + if (keyword !== undefined) { + const sch = it.schema[keyword]; + return schemaProp === undefined + ? { + schema: sch, + schemaPath: (0, codegen_1._) `${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}`, + errSchemaPath: `${it.errSchemaPath}/${keyword}`, + } + : { + schema: sch[schemaProp], + schemaPath: (0, codegen_1._) `${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}${(0, codegen_1.getProperty)(schemaProp)}`, + errSchemaPath: `${it.errSchemaPath}/${keyword}/${(0, util_1.escapeFragment)(schemaProp)}`, + }; + } + if (schema !== undefined) { + if (schemaPath === undefined || errSchemaPath === undefined || topSchemaRef === undefined) { + throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"'); + } + return { + schema, + schemaPath, + topSchemaRef, + errSchemaPath, + }; + } + throw new Error('either "keyword" or "schema" must be passed'); +} +exports.getSubschema = getSubschema; +function extendSubschemaData(subschema, it, { dataProp, dataPropType: dpType, data, dataTypes, propertyName }) { + if (data !== undefined && dataProp !== undefined) { + throw new Error('both "data" and "dataProp" passed, only one allowed'); + } + const { gen } = it; + if (dataProp !== undefined) { + const { errorPath, dataPathArr, opts } = it; + const nextData = gen.let("data", (0, codegen_1._) `${it.data}${(0, codegen_1.getProperty)(dataProp)}`, true); + dataContextProps(nextData); + subschema.errorPath = (0, codegen_1.str) `${errorPath}${(0, util_1.getErrorPath)(dataProp, dpType, opts.jsPropertySyntax)}`; + subschema.parentDataProperty = (0, codegen_1._) `${dataProp}`; + subschema.dataPathArr = [...dataPathArr, subschema.parentDataProperty]; + } + if (data !== undefined) { + const nextData = data instanceof codegen_1.Name ? data : gen.let("data", data, true); // replaceable if used once? + dataContextProps(nextData); + if (propertyName !== undefined) + subschema.propertyName = propertyName; + // TODO something is possibly wrong here with not changing parentDataProperty and not appending dataPathArr + } + if (dataTypes) + subschema.dataTypes = dataTypes; + function dataContextProps(_nextData) { + subschema.data = _nextData; + subschema.dataLevel = it.dataLevel + 1; + subschema.dataTypes = []; + it.definedProperties = new Set(); + subschema.parentData = it.data; + subschema.dataNames = [...it.dataNames, _nextData]; + } +} +exports.extendSubschemaData = extendSubschemaData; +function extendSubschemaMode(subschema, { jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors }) { + if (compositeRule !== undefined) + subschema.compositeRule = compositeRule; + if (createErrors !== undefined) + subschema.createErrors = createErrors; + if (allErrors !== undefined) + subschema.allErrors = allErrors; + subschema.jtdDiscriminator = jtdDiscriminator; // not inherited + subschema.jtdMetadata = jtdMetadata; // not inherited +} +exports.extendSubschemaMode = extendSubschemaMode; +//# sourceMappingURL=subschema.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/subschema.js.map b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/subschema.js.map new file mode 100644 index 0000000000..e4f903fbb4 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/compile/validate/subschema.js.map @@ -0,0 +1 @@ +{"version":3,"file":"subschema.js","sourceRoot":"","sources":["../../../lib/compile/validate/subschema.ts"],"names":[],"mappings":";;;AAEA,wCAA0D;AAC1D,kCAA0D;AA6C1D,SAAgB,YAAY,CAC1B,EAAgB,EAChB,EAAC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAgB;IAErF,IAAI,OAAO,KAAK,SAAS,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QAClD,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAA;IACzE,CAAC;IAED,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,MAAM,GAAG,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;QAC9B,OAAO,UAAU,KAAK,SAAS;YAC7B,CAAC,CAAC;gBACE,MA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,EAAU,CAAA;QACxC,SAAS,CAAC,UAAU,GAAG,EAAE,CAAC,IAAI,CAAA;QAC9B,SAAS,CAAC,SAAS,GAAG,CAAC,GAAG,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;IACpD,CAAC;AACH,CAAC;AArCD,kDAqCC;AAED,SAAgB,mBAAmB,CACjC,SAA2B,EAC3B,EAAC,gBAAgB,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,EAAgB;IAEtF,IAAI,aAAa,KAAK,SAAS;QAAE,SAAS,CAAC,aAAa,GAAG,aAAa,CAAA;IACxE,IAAI,YAAY,KAAK,SAAS;QAAE,SAAS,CAAC,YAAY,GAAG,YAAY,CAAA;IACrE,IAAI,SAAS,KAAK,SAAS;QAAE,SAAS,CAAC,SAAS,GAAG,SAAS,CAAA;IAC5D,SAAS,CAAC,gBAAgB,GAAG,gBAAgB,CAAA,CAAC,gBAAgB;IAC9D,SAAS,CAAC,WAAW,GAAG,WAAW,CAAA,CAAC,gBAAgB;AACtD,CAAC;AATD,kDASC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/core.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/core.d.ts new file mode 100644 index 0000000000..4591ed9ecb --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/core.d.ts @@ -0,0 +1,173 @@ +export { Format, FormatDefinition, AsyncFormatDefinition, KeywordDefinition, KeywordErrorDefinition, CodeKeywordDefinition, MacroKeywordDefinition, FuncKeywordDefinition, Vocabulary, Schema, SchemaObject, AnySchemaObject, AsyncSchema, AnySchema, ValidateFunction, AsyncValidateFunction, AnyValidateFunction, ErrorObject, ErrorNoParams, } from "./types"; +export { SchemaCxt, SchemaObjCxt } from "./compile"; +export interface Plugin { + (ajv: Ajv, options?: Opts): Ajv; + [prop: string]: any; +} +export { KeywordCxt } from "./compile/validate"; +export { DefinedError } from "./vocabularies/errors"; +export { JSONType } from "./compile/rules"; +export { JSONSchemaType } from "./types/json-schema"; +export { JTDSchemaType, SomeJTDSchemaType, JTDDataType } from "./types/jtd-schema"; +export { _, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions } from "./compile/codegen"; +import type { Schema, AnySchema, AnySchemaObject, SchemaObject, AsyncSchema, Vocabulary, KeywordDefinition, AddedKeywordDefinition, AnyValidateFunction, ValidateFunction, AsyncValidateFunction, ErrorObject, Format, AddedFormat, RegExpEngine, UriResolver } from "./types"; +import type { JSONSchemaType } from "./types/json-schema"; +import type { JTDSchemaType, SomeJTDSchemaType, JTDDataType } from "./types/jtd-schema"; +import ValidationError from "./runtime/validation_error"; +import MissingRefError from "./compile/ref_error"; +import { ValidationRules } from "./compile/rules"; +import { SchemaEnv } from "./compile"; +import { Code, ValueScope } from "./compile/codegen"; +export type Options = CurrentOptions & DeprecatedOptions; +export interface CurrentOptions { + strict?: boolean | "log"; + strictSchema?: boolean | "log"; + strictNumbers?: boolean | "log"; + strictTypes?: boolean | "log"; + strictTuples?: boolean | "log"; + strictRequired?: boolean | "log"; + allowMatchingProperties?: boolean; + allowUnionTypes?: boolean; + validateFormats?: boolean; + $data?: boolean; + allErrors?: boolean; + verbose?: boolean; + discriminator?: boolean; + unicodeRegExp?: boolean; + timestamp?: "string" | "date"; + parseDate?: boolean; + allowDate?: boolean; + $comment?: true | ((comment: string, schemaPath?: string, rootSchema?: AnySchemaObject) => unknown); + formats?: { + [Name in string]?: Format; + }; + keywords?: Vocabulary; + schemas?: AnySchema[] | { + [Key in string]?: AnySchema; + }; + logger?: Logger | false; + loadSchema?: (uri: string) => Promise; + removeAdditional?: boolean | "all" | "failing"; + useDefaults?: boolean | "empty"; + coerceTypes?: boolean | "array"; + next?: boolean; + unevaluated?: boolean; + dynamicRef?: boolean; + schemaId?: "id" | "$id"; + jtd?: boolean; + meta?: SchemaObject | boolean; + defaultMeta?: string | AnySchemaObject; + validateSchema?: boolean | "log"; + addUsedSchema?: boolean; + inlineRefs?: boolean | number; + passContext?: boolean; + loopRequired?: number; + loopEnum?: number; + ownProperties?: boolean; + multipleOfPrecision?: number; + int32range?: boolean; + messages?: boolean; + code?: CodeOptions; + uriResolver?: UriResolver; +} +export interface CodeOptions { + es5?: boolean; + esm?: boolean; + lines?: boolean; + optimize?: boolean | number; + formats?: Code; + source?: boolean; + process?: (code: string, schema?: SchemaEnv) => string; + regExp?: RegExpEngine; +} +interface InstanceCodeOptions extends CodeOptions { + regExp: RegExpEngine; + optimize: number; +} +interface DeprecatedOptions { + /** @deprecated */ + ignoreKeywordsWithRef?: boolean; + /** @deprecated */ + jsPropertySyntax?: boolean; + /** @deprecated */ + unicode?: boolean; +} +type RequiredInstanceOptions = { + [K in "strictSchema" | "strictNumbers" | "strictTypes" | "strictTuples" | "strictRequired" | "inlineRefs" | "loopRequired" | "loopEnum" | "meta" | "messages" | "schemaId" | "addUsedSchema" | "validateSchema" | "validateFormats" | "int32range" | "unicodeRegExp" | "uriResolver"]: NonNullable; +} & { + code: InstanceCodeOptions; +}; +export type InstanceOptions = Options & RequiredInstanceOptions; +export interface Logger { + log(...args: unknown[]): unknown; + warn(...args: unknown[]): unknown; + error(...args: unknown[]): unknown; +} +export default class Ajv { + opts: InstanceOptions; + errors?: ErrorObject[] | null; + logger: Logger; + readonly scope: ValueScope; + readonly schemas: { + [Key in string]?: SchemaEnv; + }; + readonly refs: { + [Ref in string]?: SchemaEnv | string; + }; + readonly formats: { + [Name in string]?: AddedFormat; + }; + readonly RULES: ValidationRules; + readonly _compilations: Set; + private readonly _loading; + private readonly _cache; + private readonly _metaOpts; + static ValidationError: typeof ValidationError; + static MissingRefError: typeof MissingRefError; + constructor(opts?: Options); + _addVocabularies(): void; + _addDefaultMetaSchema(): void; + defaultMeta(): string | AnySchemaObject | undefined; + validate(schema: Schema | string, data: unknown): boolean; + validate(schemaKeyRef: AnySchema | string, data: unknown): boolean | Promise; + validate(schema: Schema | JSONSchemaType | string, data: unknown): data is T; + validate(schema: JTDSchemaType, data: unknown): data is T; + validate(schema: T, data: unknown): data is JTDDataType; + validate(schema: AsyncSchema, data: unknown | T): Promise; + validate(schemaKeyRef: AnySchema | string, data: unknown): data is T | Promise; + compile(schema: Schema | JSONSchemaType, _meta?: boolean): ValidateFunction; + compile(schema: JTDSchemaType, _meta?: boolean): ValidateFunction; + compile(schema: T, _meta?: boolean): ValidateFunction>; + compile(schema: AsyncSchema, _meta?: boolean): AsyncValidateFunction; + compile(schema: AnySchema, _meta?: boolean): AnyValidateFunction; + compileAsync(schema: SchemaObject | JSONSchemaType, _meta?: boolean): Promise>; + compileAsync(schema: JTDSchemaType, _meta?: boolean): Promise>; + compileAsync(schema: AsyncSchema, meta?: boolean): Promise>; + compileAsync(schema: AnySchemaObject, meta?: boolean): Promise>; + addSchema(schema: AnySchema | AnySchema[], // If array is passed, `key` will be ignored + key?: string, // Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`. + _meta?: boolean, // true if schema is a meta-schema. Used internally, addMetaSchema should be used instead. + _validateSchema?: boolean | "log"): Ajv; + addMetaSchema(schema: AnySchemaObject, key?: string, // schema key + _validateSchema?: boolean | "log"): Ajv; + validateSchema(schema: AnySchema, throwOrLogError?: boolean): boolean | Promise; + getSchema(keyRef: string): AnyValidateFunction | undefined; + removeSchema(schemaKeyRef?: AnySchema | string | RegExp): Ajv; + addVocabulary(definitions: Vocabulary): Ajv; + addKeyword(kwdOrDef: string | KeywordDefinition, def?: KeywordDefinition): Ajv; + getKeyword(keyword: string): AddedKeywordDefinition | boolean; + removeKeyword(keyword: string): Ajv; + addFormat(name: string, format: Format): Ajv; + errorsText(errors?: ErrorObject[] | null | undefined, // optional array of validation errors + { separator, dataVar }?: ErrorsTextOptions): string; + $dataMetaSchema(metaSchema: AnySchemaObject, keywordsJsonPointers: string[]): AnySchemaObject; + private _removeAllSchemas; + _addSchema(schema: AnySchema, meta?: boolean, baseId?: string, validateSchema?: boolean | "log", addSchema?: boolean): SchemaEnv; + private _checkUnique; + private _compileSchemaEnv; + private _compileMetaSchema; +} +export interface ErrorsTextOptions { + separator?: string; + dataVar?: string; +} diff --git a/front_end/third_party/mcp-sdk/ajv/dist/core.js b/front_end/third_party/mcp-sdk/ajv/dist/core.js new file mode 100644 index 0000000000..7e30c83af9 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/core.js @@ -0,0 +1,618 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0; +var validate_1 = require("./compile/validate"); +Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function () { return validate_1.KeywordCxt; } }); +var codegen_1 = require("./compile/codegen"); +Object.defineProperty(exports, "_", { enumerable: true, get: function () { return codegen_1._; } }); +Object.defineProperty(exports, "str", { enumerable: true, get: function () { return codegen_1.str; } }); +Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return codegen_1.stringify; } }); +Object.defineProperty(exports, "nil", { enumerable: true, get: function () { return codegen_1.nil; } }); +Object.defineProperty(exports, "Name", { enumerable: true, get: function () { return codegen_1.Name; } }); +Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function () { return codegen_1.CodeGen; } }); +const validation_error_1 = require("./runtime/validation_error"); +const ref_error_1 = require("./compile/ref_error"); +const rules_1 = require("./compile/rules"); +const compile_1 = require("./compile"); +const codegen_2 = require("./compile/codegen"); +const resolve_1 = require("./compile/resolve"); +const dataType_1 = require("./compile/validate/dataType"); +const util_1 = require("./compile/util"); +const $dataRefSchema = require("./refs/data.json"); +const uri_1 = require("./runtime/uri"); +const defaultRegExp = (str, flags) => new RegExp(str, flags); +defaultRegExp.code = "new RegExp"; +const META_IGNORE_OPTIONS = ["removeAdditional", "useDefaults", "coerceTypes"]; +const EXT_SCOPE_NAMES = new Set([ + "validate", + "serialize", + "parse", + "wrapper", + "root", + "schema", + "keyword", + "pattern", + "formats", + "validate$data", + "func", + "obj", + "Error", +]); +const removedOptions = { + errorDataPath: "", + format: "`validateFormats: false` can be used instead.", + nullable: '"nullable" keyword is supported by default.', + jsonPointers: "Deprecated jsPropertySyntax can be used instead.", + extendRefs: "Deprecated ignoreKeywordsWithRef can be used instead.", + missingRefs: "Pass empty schema with $id that should be ignored to ajv.addSchema.", + processCode: "Use option `code: {process: (code, schemaEnv: object) => string}`", + sourceCode: "Use option `code: {source: true}`", + strictDefaults: "It is default now, see option `strict`.", + strictKeywords: "It is default now, see option `strict`.", + uniqueItems: '"uniqueItems" keyword is always validated.', + unknownFormats: "Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).", + cache: "Map is used as cache, schema object as key.", + serialize: "Map is used as cache, schema object as key.", + ajvErrors: "It is default now.", +}; +const deprecatedOptions = { + ignoreKeywordsWithRef: "", + jsPropertySyntax: "", + unicode: '"minLength"/"maxLength" account for unicode characters by default.', +}; +const MAX_EXPRESSION = 200; +// eslint-disable-next-line complexity +function requiredOptions(o) { + var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0; + const s = o.strict; + const _optz = (_a = o.code) === null || _a === void 0 ? void 0 : _a.optimize; + const optimize = _optz === true || _optz === undefined ? 1 : _optz || 0; + const regExp = (_c = (_b = o.code) === null || _b === void 0 ? void 0 : _b.regExp) !== null && _c !== void 0 ? _c : defaultRegExp; + const uriResolver = (_d = o.uriResolver) !== null && _d !== void 0 ? _d : uri_1.default; + return { + strictSchema: (_f = (_e = o.strictSchema) !== null && _e !== void 0 ? _e : s) !== null && _f !== void 0 ? _f : true, + strictNumbers: (_h = (_g = o.strictNumbers) !== null && _g !== void 0 ? _g : s) !== null && _h !== void 0 ? _h : true, + strictTypes: (_k = (_j = o.strictTypes) !== null && _j !== void 0 ? _j : s) !== null && _k !== void 0 ? _k : "log", + strictTuples: (_m = (_l = o.strictTuples) !== null && _l !== void 0 ? _l : s) !== null && _m !== void 0 ? _m : "log", + strictRequired: (_p = (_o = o.strictRequired) !== null && _o !== void 0 ? _o : s) !== null && _p !== void 0 ? _p : false, + code: o.code ? { ...o.code, optimize, regExp } : { optimize, regExp }, + loopRequired: (_q = o.loopRequired) !== null && _q !== void 0 ? _q : MAX_EXPRESSION, + loopEnum: (_r = o.loopEnum) !== null && _r !== void 0 ? _r : MAX_EXPRESSION, + meta: (_s = o.meta) !== null && _s !== void 0 ? _s : true, + messages: (_t = o.messages) !== null && _t !== void 0 ? _t : true, + inlineRefs: (_u = o.inlineRefs) !== null && _u !== void 0 ? _u : true, + schemaId: (_v = o.schemaId) !== null && _v !== void 0 ? _v : "$id", + addUsedSchema: (_w = o.addUsedSchema) !== null && _w !== void 0 ? _w : true, + validateSchema: (_x = o.validateSchema) !== null && _x !== void 0 ? _x : true, + validateFormats: (_y = o.validateFormats) !== null && _y !== void 0 ? _y : true, + unicodeRegExp: (_z = o.unicodeRegExp) !== null && _z !== void 0 ? _z : true, + int32range: (_0 = o.int32range) !== null && _0 !== void 0 ? _0 : true, + uriResolver: uriResolver, + }; +} +class Ajv { + constructor(opts = {}) { + this.schemas = {}; + this.refs = {}; + this.formats = {}; + this._compilations = new Set(); + this._loading = {}; + this._cache = new Map(); + opts = this.opts = { ...opts, ...requiredOptions(opts) }; + const { es5, lines } = this.opts.code; + this.scope = new codegen_2.ValueScope({ scope: {}, prefixes: EXT_SCOPE_NAMES, es5, lines }); + this.logger = getLogger(opts.logger); + const formatOpt = opts.validateFormats; + opts.validateFormats = false; + this.RULES = (0, rules_1.getRules)(); + checkOptions.call(this, removedOptions, opts, "NOT SUPPORTED"); + checkOptions.call(this, deprecatedOptions, opts, "DEPRECATED", "warn"); + this._metaOpts = getMetaSchemaOptions.call(this); + if (opts.formats) + addInitialFormats.call(this); + this._addVocabularies(); + this._addDefaultMetaSchema(); + if (opts.keywords) + addInitialKeywords.call(this, opts.keywords); + if (typeof opts.meta == "object") + this.addMetaSchema(opts.meta); + addInitialSchemas.call(this); + opts.validateFormats = formatOpt; + } + _addVocabularies() { + this.addKeyword("$async"); + } + _addDefaultMetaSchema() { + const { $data, meta, schemaId } = this.opts; + let _dataRefSchema = $dataRefSchema; + if (schemaId === "id") { + _dataRefSchema = { ...$dataRefSchema }; + _dataRefSchema.id = _dataRefSchema.$id; + delete _dataRefSchema.$id; + } + if (meta && $data) + this.addMetaSchema(_dataRefSchema, _dataRefSchema[schemaId], false); + } + defaultMeta() { + const { meta, schemaId } = this.opts; + return (this.opts.defaultMeta = typeof meta == "object" ? meta[schemaId] || meta : undefined); + } + validate(schemaKeyRef, // key, ref or schema object + // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents + data // to be validated + ) { + let v; + if (typeof schemaKeyRef == "string") { + v = this.getSchema(schemaKeyRef); + if (!v) + throw new Error(`no schema with key or ref "${schemaKeyRef}"`); + } + else { + v = this.compile(schemaKeyRef); + } + const valid = v(data); + if (!("$async" in v)) + this.errors = v.errors; + return valid; + } + compile(schema, _meta) { + const sch = this._addSchema(schema, _meta); + return (sch.validate || this._compileSchemaEnv(sch)); + } + compileAsync(schema, meta) { + if (typeof this.opts.loadSchema != "function") { + throw new Error("options.loadSchema should be a function"); + } + const { loadSchema } = this.opts; + return runCompileAsync.call(this, schema, meta); + async function runCompileAsync(_schema, _meta) { + await loadMetaSchema.call(this, _schema.$schema); + const sch = this._addSchema(_schema, _meta); + return sch.validate || _compileAsync.call(this, sch); + } + async function loadMetaSchema($ref) { + if ($ref && !this.getSchema($ref)) { + await runCompileAsync.call(this, { $ref }, true); + } + } + async function _compileAsync(sch) { + try { + return this._compileSchemaEnv(sch); + } + catch (e) { + if (!(e instanceof ref_error_1.default)) + throw e; + checkLoaded.call(this, e); + await loadMissingSchema.call(this, e.missingSchema); + return _compileAsync.call(this, sch); + } + } + function checkLoaded({ missingSchema: ref, missingRef }) { + if (this.refs[ref]) { + throw new Error(`AnySchema ${ref} is loaded but ${missingRef} cannot be resolved`); + } + } + async function loadMissingSchema(ref) { + const _schema = await _loadSchema.call(this, ref); + if (!this.refs[ref]) + await loadMetaSchema.call(this, _schema.$schema); + if (!this.refs[ref]) + this.addSchema(_schema, ref, meta); + } + async function _loadSchema(ref) { + const p = this._loading[ref]; + if (p) + return p; + try { + return await (this._loading[ref] = loadSchema(ref)); + } + finally { + delete this._loading[ref]; + } + } + } + // Adds schema to the instance + addSchema(schema, // If array is passed, `key` will be ignored + key, // Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`. + _meta, // true if schema is a meta-schema. Used internally, addMetaSchema should be used instead. + _validateSchema = this.opts.validateSchema // false to skip schema validation. Used internally, option validateSchema should be used instead. + ) { + if (Array.isArray(schema)) { + for (const sch of schema) + this.addSchema(sch, undefined, _meta, _validateSchema); + return this; + } + let id; + if (typeof schema === "object") { + const { schemaId } = this.opts; + id = schema[schemaId]; + if (id !== undefined && typeof id != "string") { + throw new Error(`schema ${schemaId} must be string`); + } + } + key = (0, resolve_1.normalizeId)(key || id); + this._checkUnique(key); + this.schemas[key] = this._addSchema(schema, _meta, key, _validateSchema, true); + return this; + } + // Add schema that will be used to validate other schemas + // options in META_IGNORE_OPTIONS are alway set to false + addMetaSchema(schema, key, // schema key + _validateSchema = this.opts.validateSchema // false to skip schema validation, can be used to override validateSchema option for meta-schema + ) { + this.addSchema(schema, key, true, _validateSchema); + return this; + } + // Validate schema against its meta-schema + validateSchema(schema, throwOrLogError) { + if (typeof schema == "boolean") + return true; + let $schema; + $schema = schema.$schema; + if ($schema !== undefined && typeof $schema != "string") { + throw new Error("$schema must be a string"); + } + $schema = $schema || this.opts.defaultMeta || this.defaultMeta(); + if (!$schema) { + this.logger.warn("meta-schema not available"); + this.errors = null; + return true; + } + const valid = this.validate($schema, schema); + if (!valid && throwOrLogError) { + const message = "schema is invalid: " + this.errorsText(); + if (this.opts.validateSchema === "log") + this.logger.error(message); + else + throw new Error(message); + } + return valid; + } + // Get compiled schema by `key` or `ref`. + // (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id) + getSchema(keyRef) { + let sch; + while (typeof (sch = getSchEnv.call(this, keyRef)) == "string") + keyRef = sch; + if (sch === undefined) { + const { schemaId } = this.opts; + const root = new compile_1.SchemaEnv({ schema: {}, schemaId }); + sch = compile_1.resolveSchema.call(this, root, keyRef); + if (!sch) + return; + this.refs[keyRef] = sch; + } + return (sch.validate || this._compileSchemaEnv(sch)); + } + // Remove cached schema(s). + // If no parameter is passed all schemas but meta-schemas are removed. + // If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed. + // Even if schema is referenced by other schemas it still can be removed as other schemas have local references. + removeSchema(schemaKeyRef) { + if (schemaKeyRef instanceof RegExp) { + this._removeAllSchemas(this.schemas, schemaKeyRef); + this._removeAllSchemas(this.refs, schemaKeyRef); + return this; + } + switch (typeof schemaKeyRef) { + case "undefined": + this._removeAllSchemas(this.schemas); + this._removeAllSchemas(this.refs); + this._cache.clear(); + return this; + case "string": { + const sch = getSchEnv.call(this, schemaKeyRef); + if (typeof sch == "object") + this._cache.delete(sch.schema); + delete this.schemas[schemaKeyRef]; + delete this.refs[schemaKeyRef]; + return this; + } + case "object": { + const cacheKey = schemaKeyRef; + this._cache.delete(cacheKey); + let id = schemaKeyRef[this.opts.schemaId]; + if (id) { + id = (0, resolve_1.normalizeId)(id); + delete this.schemas[id]; + delete this.refs[id]; + } + return this; + } + default: + throw new Error("ajv.removeSchema: invalid parameter"); + } + } + // add "vocabulary" - a collection of keywords + addVocabulary(definitions) { + for (const def of definitions) + this.addKeyword(def); + return this; + } + addKeyword(kwdOrDef, def // deprecated + ) { + let keyword; + if (typeof kwdOrDef == "string") { + keyword = kwdOrDef; + if (typeof def == "object") { + this.logger.warn("these parameters are deprecated, see docs for addKeyword"); + def.keyword = keyword; + } + } + else if (typeof kwdOrDef == "object" && def === undefined) { + def = kwdOrDef; + keyword = def.keyword; + if (Array.isArray(keyword) && !keyword.length) { + throw new Error("addKeywords: keyword must be string or non-empty array"); + } + } + else { + throw new Error("invalid addKeywords parameters"); + } + checkKeyword.call(this, keyword, def); + if (!def) { + (0, util_1.eachItem)(keyword, (kwd) => addRule.call(this, kwd)); + return this; + } + keywordMetaschema.call(this, def); + const definition = { + ...def, + type: (0, dataType_1.getJSONTypes)(def.type), + schemaType: (0, dataType_1.getJSONTypes)(def.schemaType), + }; + (0, util_1.eachItem)(keyword, definition.type.length === 0 + ? (k) => addRule.call(this, k, definition) + : (k) => definition.type.forEach((t) => addRule.call(this, k, definition, t))); + return this; + } + getKeyword(keyword) { + const rule = this.RULES.all[keyword]; + return typeof rule == "object" ? rule.definition : !!rule; + } + // Remove keyword + removeKeyword(keyword) { + // TODO return type should be Ajv + const { RULES } = this; + delete RULES.keywords[keyword]; + delete RULES.all[keyword]; + for (const group of RULES.rules) { + const i = group.rules.findIndex((rule) => rule.keyword === keyword); + if (i >= 0) + group.rules.splice(i, 1); + } + return this; + } + // Add format + addFormat(name, format) { + if (typeof format == "string") + format = new RegExp(format); + this.formats[name] = format; + return this; + } + errorsText(errors = this.errors, // optional array of validation errors + { separator = ", ", dataVar = "data" } = {} // optional options with properties `separator` and `dataVar` + ) { + if (!errors || errors.length === 0) + return "No errors"; + return errors + .map((e) => `${dataVar}${e.instancePath} ${e.message}`) + .reduce((text, msg) => text + separator + msg); + } + $dataMetaSchema(metaSchema, keywordsJsonPointers) { + const rules = this.RULES.all; + metaSchema = JSON.parse(JSON.stringify(metaSchema)); + for (const jsonPointer of keywordsJsonPointers) { + const segments = jsonPointer.split("/").slice(1); // first segment is an empty string + let keywords = metaSchema; + for (const seg of segments) + keywords = keywords[seg]; + for (const key in rules) { + const rule = rules[key]; + if (typeof rule != "object") + continue; + const { $data } = rule.definition; + const schema = keywords[key]; + if ($data && schema) + keywords[key] = schemaOrData(schema); + } + } + return metaSchema; + } + _removeAllSchemas(schemas, regex) { + for (const keyRef in schemas) { + const sch = schemas[keyRef]; + if (!regex || regex.test(keyRef)) { + if (typeof sch == "string") { + delete schemas[keyRef]; + } + else if (sch && !sch.meta) { + this._cache.delete(sch.schema); + delete schemas[keyRef]; + } + } + } + } + _addSchema(schema, meta, baseId, validateSchema = this.opts.validateSchema, addSchema = this.opts.addUsedSchema) { + let id; + const { schemaId } = this.opts; + if (typeof schema == "object") { + id = schema[schemaId]; + } + else { + if (this.opts.jtd) + throw new Error("schema must be object"); + else if (typeof schema != "boolean") + throw new Error("schema must be object or boolean"); + } + let sch = this._cache.get(schema); + if (sch !== undefined) + return sch; + baseId = (0, resolve_1.normalizeId)(id || baseId); + const localRefs = resolve_1.getSchemaRefs.call(this, schema, baseId); + sch = new compile_1.SchemaEnv({ schema, schemaId, meta, baseId, localRefs }); + this._cache.set(sch.schema, sch); + if (addSchema && !baseId.startsWith("#")) { + // TODO atm it is allowed to overwrite schemas without id (instead of not adding them) + if (baseId) + this._checkUnique(baseId); + this.refs[baseId] = sch; + } + if (validateSchema) + this.validateSchema(schema, true); + return sch; + } + _checkUnique(id) { + if (this.schemas[id] || this.refs[id]) { + throw new Error(`schema with key or id "${id}" already exists`); + } + } + _compileSchemaEnv(sch) { + if (sch.meta) + this._compileMetaSchema(sch); + else + compile_1.compileSchema.call(this, sch); + /* istanbul ignore if */ + if (!sch.validate) + throw new Error("ajv implementation error"); + return sch.validate; + } + _compileMetaSchema(sch) { + const currentOpts = this.opts; + this.opts = this._metaOpts; + try { + compile_1.compileSchema.call(this, sch); + } + finally { + this.opts = currentOpts; + } + } +} +Ajv.ValidationError = validation_error_1.default; +Ajv.MissingRefError = ref_error_1.default; +exports.default = Ajv; +function checkOptions(checkOpts, options, msg, log = "error") { + for (const key in checkOpts) { + const opt = key; + if (opt in options) + this.logger[log](`${msg}: option ${key}. ${checkOpts[opt]}`); + } +} +function getSchEnv(keyRef) { + keyRef = (0, resolve_1.normalizeId)(keyRef); // TODO tests fail without this line + return this.schemas[keyRef] || this.refs[keyRef]; +} +function addInitialSchemas() { + const optsSchemas = this.opts.schemas; + if (!optsSchemas) + return; + if (Array.isArray(optsSchemas)) + this.addSchema(optsSchemas); + else + for (const key in optsSchemas) + this.addSchema(optsSchemas[key], key); +} +function addInitialFormats() { + for (const name in this.opts.formats) { + const format = this.opts.formats[name]; + if (format) + this.addFormat(name, format); + } +} +function addInitialKeywords(defs) { + if (Array.isArray(defs)) { + this.addVocabulary(defs); + return; + } + this.logger.warn("keywords option as map is deprecated, pass array"); + for (const keyword in defs) { + const def = defs[keyword]; + if (!def.keyword) + def.keyword = keyword; + this.addKeyword(def); + } +} +function getMetaSchemaOptions() { + const metaOpts = { ...this.opts }; + for (const opt of META_IGNORE_OPTIONS) + delete metaOpts[opt]; + return metaOpts; +} +const noLogs = { log() { }, warn() { }, error() { } }; +function getLogger(logger) { + if (logger === false) + return noLogs; + if (logger === undefined) + return console; + if (logger.log && logger.warn && logger.error) + return logger; + throw new Error("logger must implement log, warn and error methods"); +} +const KEYWORD_NAME = /^[a-z_$][a-z0-9_$:-]*$/i; +function checkKeyword(keyword, def) { + const { RULES } = this; + (0, util_1.eachItem)(keyword, (kwd) => { + if (RULES.keywords[kwd]) + throw new Error(`Keyword ${kwd} is already defined`); + if (!KEYWORD_NAME.test(kwd)) + throw new Error(`Keyword ${kwd} has invalid name`); + }); + if (!def) + return; + if (def.$data && !("code" in def || "validate" in def)) { + throw new Error('$data keyword must have "code" or "validate" function'); + } +} +function addRule(keyword, definition, dataType) { + var _a; + const post = definition === null || definition === void 0 ? void 0 : definition.post; + if (dataType && post) + throw new Error('keyword with "post" flag cannot have "type"'); + const { RULES } = this; + let ruleGroup = post ? RULES.post : RULES.rules.find(({ type: t }) => t === dataType); + if (!ruleGroup) { + ruleGroup = { type: dataType, rules: [] }; + RULES.rules.push(ruleGroup); + } + RULES.keywords[keyword] = true; + if (!definition) + return; + const rule = { + keyword, + definition: { + ...definition, + type: (0, dataType_1.getJSONTypes)(definition.type), + schemaType: (0, dataType_1.getJSONTypes)(definition.schemaType), + }, + }; + if (definition.before) + addBeforeRule.call(this, ruleGroup, rule, definition.before); + else + ruleGroup.rules.push(rule); + RULES.all[keyword] = rule; + (_a = definition.implements) === null || _a === void 0 ? void 0 : _a.forEach((kwd) => this.addKeyword(kwd)); +} +function addBeforeRule(ruleGroup, rule, before) { + const i = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before); + if (i >= 0) { + ruleGroup.rules.splice(i, 0, rule); + } + else { + ruleGroup.rules.push(rule); + this.logger.warn(`rule ${before} is not defined`); + } +} +function keywordMetaschema(def) { + let { metaSchema } = def; + if (metaSchema === undefined) + return; + if (def.$data && this.opts.$data) + metaSchema = schemaOrData(metaSchema); + def.validateSchema = this.compile(metaSchema, true); +} +const $dataRef = { + $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", +}; +function schemaOrData(schema) { + return { anyOf: [schema, $dataRef] }; +} +//# sourceMappingURL=core.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/core.js.map b/front_end/third_party/mcp-sdk/ajv/dist/core.js.map new file mode 100644 index 0000000000..3760c3e466 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/core.js.map @@ -0,0 +1 @@ +{"version":3,"file":"core.js","sourceRoot":"","sources":["../lib/core.ts"],"names":[],"mappings":";;;AA4BA,+CAA6C;AAArC,sGAAA,UAAU,OAAA;AAKlB,6CAA6F;AAArF,4FAAA,CAAC,OAAA;AAAE,8FAAA,GAAG,OAAA;AAAE,oGAAA,SAAS,OAAA;AAAE,8FAAA,GAAG,OAAA;AAAE,+FAAA,IAAI,OAAA;AAAQ,kGAAA,OAAO,OAAA;AAsBnD,iEAAwD;AACxD,mDAAiD;AACjD,2CAAoF;AACpF,uCAAiE;AACjE,+CAAkD;AAClD,+CAA4D;AAC5D,0DAAwD;AACxD,yCAAuC;AACvC,mDAAkD;AAElD,uCAA8C;AAE9C,MAAM,aAAa,GAAiB,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;AAC1E,aAAa,CAAC,IAAI,GAAG,YAAY,CAAA;AAEjC,MAAM,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AU,GAAG,YAAY,CAAC,UAAU,CAAC,CAAA;IACvE,GAAG,CAAC,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;AACrD,CAAC;AAED,MAAM,QAAQ,GAAG;IACf,IAAI,EAAE,gFAAgF;CACvF,CAAA;AAED,SAAS,YAAY,CAAC,MAAiB;IACrC,OAAO,EAAC,KAAK,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAC,CAAA;AACpC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/cli.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/cli.d.ts new file mode 100644 index 0000000000..d9ae1944cf --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/cli.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=cli.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/cli.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/cli.d.ts.map new file mode 100644 index 0000000000..9984dd72bf --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/cli.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/cli.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/cli.js new file mode 100644 index 0000000000..af373f4406 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/cli.js @@ -0,0 +1,126 @@ +import WebSocket from "ws"; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +global.WebSocket = WebSocket; +import express from "express"; +import { Client } from "./client/index.js"; +import { SSEClientTransport } from "./client/sse.js"; +import { StdioClientTransport } from "./client/stdio.js"; +import { WebSocketClientTransport } from "./client/websocket.js"; +import { Server } from "./server/index.js"; +import { SSEServerTransport } from "./server/sse.js"; +import { StdioServerTransport } from "./server/stdio.js"; +import { ListResourcesResultSchema } from "./types.js"; +async function runClient(url_or_command, args) { + const client = new Client({ + name: "mcp-typescript test client", + version: "0.1.0", + }, { + capabilities: { + sampling: {}, + }, + }); + let clientTransport; + let url = undefined; + try { + url = new URL(url_or_command); + } + catch (_a) { + // Ignore + } + if ((url === null || url === void 0 ? void 0 : url.protocol) === "http:" || (url === null || url === void 0 ? void 0 : url.protocol) === "https:") { + clientTransport = new SSEClientTransport(new URL(url_or_command)); + } + else if ((url === null || url === void 0 ? void 0 : url.protocol) === "ws:" || (url === null || url === void 0 ? void 0 : url.protocol) === "wss:") { + clientTransport = new WebSocketClientTransport(new URL(url_or_command)); + } + else { + clientTransport = new StdioClientTransport({ + command: url_or_command, + args, + }); + } + console.log("Connected to server."); + await client.connect(clientTransport); + console.log("Initialized."); + await client.request({ method: "resources/list" }, ListResourcesResultSchema); + await client.close(); + console.log("Closed."); +} +async function runServer(port) { + if (port !== null) { + const app = express(); + let servers = []; + app.get("/sse", async (req, res) => { + console.log("Got new SSE connection"); + const transport = new SSEServerTransport("/message", res); + const server = new Server({ + name: "mcp-typescript test server", + version: "0.1.0", + }, { + capabilities: {}, + }); + servers.push(server); + server.onclose = () => { + console.log("SSE connection closed"); + servers = servers.filter((s) => s !== server); + }; + await server.connect(transport); + }); + app.post("/message", async (req, res) => { + console.log("Received message"); + const sessionId = req.query.sessionId; + const transport = servers + .map((s) => s.transport) + .find((t) => t.sessionId === sessionId); + if (!transport) { + res.status(404).send("Session not found"); + return; + } + await transport.handlePostMessage(req, res); + }); + app.listen(port, () => { + console.log(`Server running on http://localhost:${port}/sse`); + }); + } + else { + const server = new Server({ + name: "mcp-typescript test server", + version: "0.1.0", + }, { + capabilities: { + prompts: {}, + resources: {}, + tools: {}, + logging: {}, + }, + }); + const transport = new StdioServerTransport(); + await server.connect(transport); + console.log("Server running on stdio"); + } +} +const args = process.argv.slice(2); +const command = args[0]; +switch (command) { + case "client": + if (args.length < 2) { + console.error("Usage: client [args...]"); + process.exit(1); + } + runClient(args[1], args.slice(2)).catch((error) => { + console.error(error); + process.exit(1); + }); + break; + case "server": { + const port = args[1] ? parseInt(args[1]) : null; + runServer(port).catch((error) => { + console.error(error); + process.exit(1); + }); + break; + } + default: + console.error("Unrecognized command:", command); +} +//# sourceMappingURL=cli.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/cli.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/cli.js.map new file mode 100644 index 0000000000..81bafcd012 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/cli.js.map @@ -0,0 +1 @@ +{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,IAAI,CAAC;AAE3B,8DAA8D;AAC7D,MAAc,CAAC,SAAS,GAAG,SAAS,CAAC;AAEtC,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAEvD,KAAK,UAAU,SAAS,CAAC,cAAsB,EAAE,IAAc;IAC7D,MAAM,MAAM,GAAG,IAAI,MAAM,CACvB;QACE,IAAI,EAAE,4BAA4B;QAClC,OAAO,EAAE,OAAO;KACjB,EACD;QACE,YAAY,EAAE;YACZ,QAAQ,EAAE,EAAE;SACb;KACF,CACF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E,EAAE;YAChD,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;QAEH,MAAM;IAER,KAAK,QAAQ,CAAC,CAAC,CAAC;QACd,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAChD,SAAS,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YAC9B,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;QAEH,MAAM;IACR,CAAC;IAED;QACE,OAAO,CAAC,KAAK,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;AACpD,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/client/auth.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/auth.d.ts new file mode 100644 index 0000000000..ae1199056b --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/auth.d.ts @@ -0,0 +1,139 @@ +import type { OAuthClientMetadata, OAuthClientInformation, OAuthTokens, OAuthMetadata, OAuthClientInformationFull, OAuthProtectedResourceMetadata } from "../shared/auth.js"; +/** + * Implements an end-to-end OAuth client to be used with one MCP server. + * + * This client relies upon a concept of an authorized "session," the exact + * meaning of which is application-defined. Tokens, authorization codes, and + * code verifiers should not cross different sessions. + */ +export interface OAuthClientProvider { + /** + * The URL to redirect the user agent to after authorization. + */ + get redirectUrl(): string | URL; + /** + * Metadata about this OAuth client. + */ + get clientMetadata(): OAuthClientMetadata; + /** + * Returns a OAuth2 state parameter. + */ + state?(): string | Promise; + /** + * Loads information about this OAuth client, as registered already with the + * server, or returns `undefined` if the client is not registered with the + * server. + */ + clientInformation(): OAuthClientInformation | undefined | Promise; + /** + * If implemented, this permits the OAuth client to dynamically register with + * the server. Client information saved this way should later be read via + * `clientInformation()`. + * + * This method is not required to be implemented if client information is + * statically known (e.g., pre-registered). + */ + saveClientInformation?(clientInformation: OAuthClientInformationFull): void | Promise; + /** + * Loads any existing OAuth tokens for the current session, or returns + * `undefined` if there are no saved tokens. + */ + tokens(): OAuthTokens | undefined | Promise; + /** + * Stores new OAuth tokens for the current session, after a successful + * authorization. + */ + saveTokens(tokens: OAuthTokens): void | Promise; + /** + * Invoked to redirect the user agent to the given URL to begin the authorization flow. + */ + redirectToAuthorization(authorizationUrl: URL): void | Promise; + /** + * Saves a PKCE code verifier for the current session, before redirecting to + * the authorization flow. + */ + saveCodeVerifier(codeVerifier: string): void | Promise; + /** + * Loads the PKCE code verifier for the current session, necessary to validate + * the authorization result. + */ + codeVerifier(): string | Promise; +} +export type AuthResult = "AUTHORIZED" | "REDIRECT"; +export declare class UnauthorizedError extends Error { + constructor(message?: string); +} +/** + * Orchestrates the full auth flow with a server. + * + * This can be used as a single entry point for all authorization functionality, + * instead of linking together the other lower-level functions in this module. + */ +export declare function auth(provider: OAuthClientProvider, { serverUrl, authorizationCode, scope, resourceMetadataUrl }: { + serverUrl: string | URL; + authorizationCode?: string; + scope?: string; + resourceMetadataUrl?: URL; +}): Promise; +/** + * Extract resource_metadata from response header. + */ +export declare function extractResourceMetadataUrl(res: Response): URL | undefined; +/** + * Looks up RFC 9728 OAuth 2.0 Protected Resource Metadata. + * + * If the server returns a 404 for the well-known endpoint, this function will + * return `undefined`. Any other errors will be thrown as exceptions. + */ +export declare function discoverOAuthProtectedResourceMetadata(serverUrl: string | URL, opts?: { + protocolVersion?: string; + resourceMetadataUrl?: string | URL; +}): Promise; +/** + * Looks up RFC 8414 OAuth 2.0 Authorization Server Metadata. + * + * If the server returns a 404 for the well-known endpoint, this function will + * return `undefined`. Any other errors will be thrown as exceptions. + */ +export declare function discoverOAuthMetadata(authorizationServerUrl: string | URL, opts?: { + protocolVersion?: string; +}): Promise; +/** + * Begins the authorization flow with the given server, by generating a PKCE challenge and constructing the authorization URL. + */ +export declare function startAuthorization(authorizationServerUrl: string | URL, { metadata, clientInformation, redirectUrl, scope, state, }: { + metadata?: OAuthMetadata; + clientInformation: OAuthClientInformation; + redirectUrl: string | URL; + scope?: string; + state?: string; +}): Promise<{ + authorizationUrl: URL; + codeVerifier: string; +}>; +/** + * Exchanges an authorization code for an access token with the given server. + */ +export declare function exchangeAuthorization(authorizationServerUrl: string | URL, { metadata, clientInformation, authorizationCode, codeVerifier, redirectUri, }: { + metadata?: OAuthMetadata; + clientInformation: OAuthClientInformation; + authorizationCode: string; + codeVerifier: string; + redirectUri: string | URL; +}): Promise; +/** + * Exchange a refresh token for an updated access token. + */ +export declare function refreshAuthorization(authorizationServerUrl: string | URL, { metadata, clientInformation, refreshToken, }: { + metadata?: OAuthMetadata; + clientInformation: OAuthClientInformation; + refreshToken: string; +}): Promise; +/** + * Performs OAuth 2.0 Dynamic Client Registration according to RFC 7591. + */ +export declare function registerClient(authorizationServerUrl: string | URL, { metadata, clientMetadata, }: { + metadata?: OAuthMetadata; + clientMetadata: OAuthClientMetadata; +}): Promise; +//# sourceMappingURL=auth.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/client/auth.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/auth.d.ts.map new file mode 100644 index 0000000000..96f9fd8289 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/auth.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/client/auth.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,WAAW,EAAE,aAAa,EAAE,0BAA0B,EAAE,8BAA8B,EAAE,MAAM,mBAAmB,CAAC;AAG7K;;;;;;GAMG;AACH,MAAM,W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W,GACZ,EAAE;IACD,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,iBAAiB,EAAE,sBAAsB,CAAC;IAC1C,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,GAAG,GAAG,CAAC;CAC3B,GACA,OAAO,CAAC,WAAW,CAAC,CA6CtB;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,sBAAsB,EAAE,MAAM,GAAG,GAAG,EACpC,EACE,QAAQ,EACR,iBAAiB,EACjB,YAAY,GACb,EAAE;IACD,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,iBAAiB,EAAE,sBAAsB,CAAC;IAC1C,YAAY,EAAE,MAAM,CAAC;CACtB,GACA,OAAO,CAAC,WAAW,CAAC,CA0CtB;AAED;;GAEG;AACH,wBAAsB,cAAc,CAClC,sBAAsB,EAAE,MAAM,GAAG,GAAG,EACpC,EACE,QAAQ,EACR,cAAc,GACf,EAAE;IACD,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,cAAc,EAAE,mBAAmB,CAAC;CACrC,GACA,OAAO,CAAC,0BAA0B,CAAC,CA0BrC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/client/auth.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/auth.js new file mode 100644 index 0000000000..0dd228a8c2 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/auth.js @@ -0,0 +1,325 @@ +import pkceChallenge from "pkce-challenge"; +import { LATEST_PROTOCOL_VERSION } from "../types.js"; +import { OAuthClientInformationFullSchema, OAuthMetadataSchema, OAuthProtectedResourceMetadataSchema, OAuthTokensSchema } from "../shared/auth.js"; +export class UnauthorizedError extends Error { + constructor(message) { + super(message !== null && message !== void 0 ? message : "Unauthorized"); + } +} +/** + * Orchestrates the full auth flow with a server. + * + * This can be used as a single entry point for all authorization functionality, + * instead of linking together the other lower-level functions in this module. + */ +export async function auth(provider, { serverUrl, authorizationCode, scope, resourceMetadataUrl }) { + let authorizationServerUrl = serverUrl; + try { + const resourceMetadata = await discoverOAuthProtectedResourceMetadata(resourceMetadataUrl || serverUrl); + if (resourceMetadata.authorization_servers && resourceMetadata.authorization_servers.length > 0) { + authorizationServerUrl = resourceMetadata.authorization_servers[0]; + } + } + catch (error) { + console.warn("Could not load OAuth Protected Resource metadata, falling back to /.well-known/oauth-authorization-server", error); + } + const metadata = await discoverOAuthMetadata(authorizationServerUrl); + // Handle client registration if needed + let clientInformation = await Promise.resolve(provider.clientInformation()); + if (!clientInformation) { + if (authorizationCode !== undefined) { + throw new Error("Existing OAuth client information is required when exchanging an authorization code"); + } + if (!provider.saveClientInformation) { + throw new Error("OAuth client information must be saveable for dynamic registration"); + } + const fullInformation = await registerClient(authorizationServerUrl, { + metadata, + clientMetadata: provider.clientMetadata, + }); + await provider.saveClientInformation(fullInformation); + clientInformation = fullInformation; + } + // Exchange authorization code for tokens + if (authorizationCode !== undefined) { + const codeVerifier = await provider.codeVerifier(); + const tokens = await exchangeAuthorization(authorizationServerUrl, { + metadata, + clientInformation, + authorizationCode, + codeVerifier, + redirectUri: provider.redirectUrl, + }); + await provider.saveTokens(tokens); + return "AUTHORIZED"; + } + const tokens = await provider.tokens(); + // Handle token refresh or new authorization + if (tokens === null || tokens === void 0 ? void 0 : tokens.refresh_token) { + try { + // Attempt to refresh the token + const newTokens = await refreshAuthorization(authorizationServerUrl, { + metadata, + clientInformation, + refreshToken: tokens.refresh_token, + }); + await provider.saveTokens(newTokens); + return "AUTHORIZED"; + } + catch (error) { + console.error("Could not refresh OAuth tokens:", error); + } + } + const state = provider.state ? await provider.state() : undefined; + // Start new authorization flow + const { authorizationUrl, codeVerifier } = await startAuthorization(authorizationServerUrl, { + metadata, + clientInformation, + state, + redirectUrl: provider.redirectUrl, + scope: scope || provider.clientMetadata.scope, + }); + await provider.saveCodeVerifier(codeVerifier); + await provider.redirectToAuthorization(authorizationUrl); + return "REDIRECT"; +} +/** + * Extract resource_metadata from response header. + */ +export function extractResourceMetadataUrl(res) { + const authenticateHeader = res.headers.get("WWW-Authenticate"); + if (!authenticateHeader) { + return undefined; + } + const [type, scheme] = authenticateHeader.split(' '); + if (type.toLowerCase() !== 'bearer' || !scheme) { + console.log("Invalid WWW-Authenticate header format, expected 'Bearer'"); + return undefined; + } + const regex = /resource_metadata="([^"]*)"/; + const match = regex.exec(authenticateHeader); + if (!match) { + return undefined; + } + try { + return new URL(match[1]); + } + catch (_a) { + console.log("Invalid resource metadata url: ", match[1]); + return undefined; + } +} +/** + * Looks up RFC 9728 OAuth 2.0 Protected Resource Metadata. + * + * If the server returns a 404 for the well-known endpoint, this function will + * return `undefined`. Any other errors will be thrown as exceptions. + */ +export async function discoverOAuthProtectedResourceMetadata(serverUrl, opts) { + var _a; + let url; + if (opts === null || opts === void 0 ? void 0 : opts.resourceMetadataUrl) { + url = new URL(opts === null || opts === void 0 ? void 0 : opts.resourceMetadataUrl); + } + else { + url = new URL("/.well-known/oauth-protected-resource", serverUrl); + } + let response; + try { + response = await fetch(url, { + headers: { + "MCP-Protocol-Version": (_a = opts === null || opts === void 0 ? void 0 : opts.protocolVersion) !== null && _a !== void 0 ? _a : LATEST_PROTOCOL_VERSION + } + }); + } + catch (error) { + // CORS errors come back as TypeError + if (error instanceof TypeError) { + response = await fetch(url); + } + else { + throw error; + } + } + if (response.status === 404) { + throw new Error(`Resource server does not implement OAuth 2.0 Protected Resource Metadata.`); + } + if (!response.ok) { + throw new Error(`HTTP ${response.status} trying to load well-known OAuth protected resource metadata.`); + } + return OAuthProtectedResourceMetadataSchema.parse(await response.json()); +} +/** + * Looks up RFC 8414 OAuth 2.0 Authorization Server Metadata. + * + * If the server returns a 404 for the well-known endpoint, this function will + * return `undefined`. Any other errors will be thrown as exceptions. + */ +export async function discoverOAuthMetadata(authorizationServerUrl, opts) { + var _a; + const url = new URL("/.well-known/oauth-authorization-server", authorizationServerUrl); + let response; + try { + response = await fetch(url, { + headers: { + "MCP-Protocol-Version": (_a = opts === null || opts === void 0 ? void 0 : opts.protocolVersion) !== null && _a !== void 0 ? _a : LATEST_PROTOCOL_VERSION + } + }); + } + catch (error) { + // CORS errors come back as TypeError + if (error instanceof TypeError) { + response = await fetch(url); + } + else { + throw error; + } + } + if (response.status === 404) { + return undefined; + } + if (!response.ok) { + throw new Error(`HTTP ${response.status} trying to load well-known OAuth metadata`); + } + return OAuthMetadataSchema.parse(await response.json()); +} +/** + * Begins the authorization flow with the given server, by generating a PKCE challenge and constructing the authorization URL. + */ +export async function startAuthorization(authorizationServerUrl, { metadata, clientInformation, redirectUrl, scope, state, }) { + const responseType = "code"; + const codeChallengeMethod = "S256"; + let authorizationUrl; + if (metadata) { + authorizationUrl = new URL(metadata.authorization_endpoint); + if (!metadata.response_types_supported.includes(responseType)) { + throw new Error(`Incompatible auth server: does not support response type ${responseType}`); + } + if (!metadata.code_challenge_methods_supported || + !metadata.code_challenge_methods_supported.includes(codeChallengeMethod)) { + throw new Error(`Incompatible auth server: does not support code challenge method ${codeChallengeMethod}`); + } + } + else { + authorizationUrl = new URL("/authorize", authorizationServerUrl); + } + // Generate PKCE challenge + const challenge = await pkceChallenge(); + const codeVerifier = challenge.code_verifier; + const codeChallenge = challenge.code_challenge; + authorizationUrl.searchParams.set("response_type", responseType); + authorizationUrl.searchParams.set("client_id", clientInformation.client_id); + authorizationUrl.searchParams.set("code_challenge", codeChallenge); + authorizationUrl.searchParams.set("code_challenge_method", codeChallengeMethod); + authorizationUrl.searchParams.set("redirect_uri", String(redirectUrl)); + if (state) { + authorizationUrl.searchParams.set("state", state); + } + if (scope) { + authorizationUrl.searchParams.set("scope", scope); + } + return { authorizationUrl, codeVerifier }; +} +/** + * Exchanges an authorization code for an access token with the given server. + */ +export async function exchangeAuthorization(authorizationServerUrl, { metadata, clientInformation, authorizationCode, codeVerifier, redirectUri, }) { + const grantType = "authorization_code"; + let tokenUrl; + if (metadata) { + tokenUrl = new URL(metadata.token_endpoint); + if (metadata.grant_types_supported && + !metadata.grant_types_supported.includes(grantType)) { + throw new Error(`Incompatible auth server: does not support grant type ${grantType}`); + } + } + else { + tokenUrl = new URL("/token", authorizationServerUrl); + } + // Exchange code for tokens + const params = new URLSearchParams({ + grant_type: grantType, + client_id: clientInformation.client_id, + code: authorizationCode, + code_verifier: codeVerifier, + redirect_uri: String(redirectUri), + }); + if (clientInformation.client_secret) { + params.set("client_secret", clientInformation.client_secret); + } + const response = await fetch(tokenUrl, { + method: "POST", + headers: { + "Content-Type": "application/x-www-form-urlencoded", + }, + body: params, + }); + if (!response.ok) { + throw new Error(`Token exchange failed: HTTP ${response.status}`); + } + return OAuthTokensSchema.parse(await response.json()); +} +/** + * Exchange a refresh token for an updated access token. + */ +export async function refreshAuthorization(authorizationServerUrl, { metadata, clientInformation, refreshToken, }) { + const grantType = "refresh_token"; + let tokenUrl; + if (metadata) { + tokenUrl = new URL(metadata.token_endpoint); + if (metadata.grant_types_supported && + !metadata.grant_types_supported.includes(grantType)) { + throw new Error(`Incompatible auth server: does not support grant type ${grantType}`); + } + } + else { + tokenUrl = new URL("/token", authorizationServerUrl); + } + // Exchange refresh token + const params = new URLSearchParams({ + grant_type: grantType, + client_id: clientInformation.client_id, + refresh_token: refreshToken, + }); + if (clientInformation.client_secret) { + params.set("client_secret", clientInformation.client_secret); + } + const response = await fetch(tokenUrl, { + method: "POST", + headers: { + "Content-Type": "application/x-www-form-urlencoded", + }, + body: params, + }); + if (!response.ok) { + throw new Error(`Token refresh failed: HTTP ${response.status}`); + } + return OAuthTokensSchema.parse({ refresh_token: refreshToken, ...(await response.json()) }); +} +/** + * Performs OAuth 2.0 Dynamic Client Registration according to RFC 7591. + */ +export async function registerClient(authorizationServerUrl, { metadata, clientMetadata, }) { + let registrationUrl; + if (metadata) { + if (!metadata.registration_endpoint) { + throw new Error("Incompatible auth server: does not support dynamic client registration"); + } + registrationUrl = new URL(metadata.registration_endpoint); + } + else { + registrationUrl = new URL("/register", authorizationServerUrl); + } + const response = await fetch(registrationUrl, { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(clientMetadata), + }); + if (!response.ok) { + throw new Error(`Dynamic client registration failed: HTTP ${response.status}`); + } + return OAuthClientInformationFullSchema.parse(await response.json()); +} +//# sourceMappingURL=auth.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/client/auth.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/auth.js.map new file mode 100644 index 0000000000..59a36554dd --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/auth.js.map @@ -0,0 +1 @@ +{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/client/auth.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAEtD,OAAO,EAAE,gCAAgC,EAAE,mBAAmB,EAAE,oCAAoC,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AA0EnJ,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IAC1C,YAAY,OAAgB;QAC1B,KAAK,CAAC,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,cAAc,CAAC,CAAC;IACnC,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI,CACxB,QAA6B,EAC7B,EAAE,SAAS,EACT,iBAAiB,EACjB,KAAK,EACL,mBAAmB,EAKQ;IAE7B,IAAI,sBAAsB,GAAG,SAAS,CAAC;IACvC,IAAI,CAAC;QACH,MAAM,gBAAgB,GAAG,MAAM,sCAAsC,CACnE,mBAAmB,IAAI,SAAS,CAAC,CAAC;QAEpC,IAAI,gBAAgB,CAAC,qBAAqB,IAAI,gBAAgB,CAAC,qBAAqB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAChG,sBAAsB,GAAG,gBAAgB,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;QACrE,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C,CAAC;IAC5D,CAAC;SAAM,CAAC;QACN,eAAe,GAAG,IAAI,GAAG,CAAC,WAAW,EAAE,sBAAsB,CAAC,CAAC;IACjE,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,eAAe,EAAE;QAC5C,MAAM,EAAE,MAAM;QACd,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;SACnC;QACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC;KACrC,CAAC,CAAC;IAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,4CAA4C,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IACjF,CAAC;IAED,OAAO,gCAAgC,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;AACvE,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/client/index.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/index.d.ts new file mode 100644 index 0000000000..3b42a6c0c9 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/index.d.ts @@ -0,0 +1,942 @@ +import { Protocol, ProtocolOptions, RequestOptions } from "../shared/protocol.js"; +import { Transport } from "../shared/transport.js"; +import { CallToolRequest, CallToolResultSchema, ClientCapabilities, ClientNotification, ClientRequest, ClientResult, CompatibilityCallToolResultSchema, CompleteRequest, GetPromptRequest, Implementation, ListPromptsRequest, ListResourcesRequest, ListResourceTemplatesRequest, ListToolsRequest, LoggingLevel, Notification, ReadResourceRequest, Request, Result, ServerCapabilities, SubscribeRequest, UnsubscribeRequest } from "../types.js"; +export type ClientOptions = ProtocolOptions & { + /** + * Capabilities to advertise as being supported by this client. + */ + capabilities?: ClientCapabilities; +}; +/** + * An MCP client on top of a pluggable transport. + * + * The client will automatically begin the initialization flow with the server when connect() is called. + * + * To use with custom types, extend the base Request/Notification/Result types and pass them as type parameters: + * + * ```typescript + * // Custom schemas + * const CustomRequestSchema = RequestSchema.extend({...}) + * const CustomNotificationSchema = NotificationSchema.extend({...}) + * const CustomResultSchema = ResultSchema.extend({...}) + * + * // Type aliases + * type CustomRequest = z.infer + * type CustomNotification = z.infer + * type CustomResult = z.infer + * + * // Create typed client + * const client = new Client({ + * name: "CustomClient", + * version: "1.0.0" + * }) + * ``` + */ +export declare class Client extends Protocol { + private _clientInfo; + private _serverCapabilities?; + private _serverVersion?; + private _capabilities; + private _instructions?; + private _cachedToolOutputValidators; + private _ajv; + /** + * Initializes this client with the given name and version information. + */ + constructor(_clientInfo: Implementation, options?: ClientOptions); + /** + * Registers new capabilities. This can only be called before connecting to a transport. + * + * The new capabilities will be merged with any existing capabilities previously given (e.g., at initialization). + */ + registerCapabilities(capabilities: ClientCapabilities): void; + protected assertCapability(capability: keyof ServerCapabilities, method: string): void; + connect(transport: Transport, options?: RequestOptions): Promise; + /** + * After initialization has completed, this will be populated with the server's reported capabilities. + */ + getServerCapabilities(): ServerCapabilities | undefined; + /** + * After initialization has completed, this will be populated with information about the server's name and version. + */ + getServerVersion(): Implementation | undefined; + /** + * After initialization has completed, this may be populated with information about the server's instructions. + */ + getInstructions(): string | undefined; + protected assertCapabilityForMethod(method: RequestT["method"]): void; + protected assertNotificationCapability(method: NotificationT["method"]): void; + protected assertRequestHandlerCapability(method: string): void; + ping(options?: RequestOptions): Promise<{ + _meta?: import("zod").objectOutputType<{}, import("zod").ZodTypeAny, "passthrough"> | undefined; + }>; + complete(params: CompleteRequest["params"], options?: RequestOptions): Promise, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + completion: import("zod").ZodObject<{ + values: import("zod").ZodArray; + total: import("zod").ZodOptional; + hasMore: import("zod").ZodOptional; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + values: import("zod").ZodArray; + total: import("zod").ZodOptional; + hasMore: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + values: import("zod").ZodArray; + total: import("zod").ZodOptional; + hasMore: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">>; + }>, import("zod").ZodTypeAny, "passthrough">>; + setLoggingLevel(level: LoggingLevel, options?: RequestOptions): Promise<{ + _meta?: import("zod").objectOutputType<{}, import("zod").ZodTypeAny, "passthrough"> | undefined; + }>; + getPrompt(params: GetPromptRequest["params"], options?: RequestOptions): Promise, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + description: import("zod").ZodOptional; + messages: import("zod").ZodArray; + content: import("zod").ZodUnion<[import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"audio">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"audio">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"audio">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, import("zod").ZodTypeAny, "passthrough">>]>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + role: import("zod").ZodEnum<["user", "assistant"]>; + content: import("zod").ZodUnion<[import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"audio">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"audio">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"audio">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, import("zod").ZodTypeAny, "passthrough">>]>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + role: import("zod").ZodEnum<["user", "assistant"]>; + content: import("zod").ZodUnion<[import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"audio">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"audio">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"audio">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, import("zod").ZodTypeAny, "passthrough">>]>; + }, import("zod").ZodTypeAny, "passthrough">>, "many">; + }>, import("zod").ZodTypeAny, "passthrough">>; + listPrompts(params?: ListPromptsRequest["params"], options?: RequestOptions): Promise, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + nextCursor: import("zod").ZodOptional; + }>, { + prompts: import("zod").ZodArray; + arguments: import("zod").ZodOptional; + required: import("zod").ZodOptional; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + name: import("zod").ZodString; + description: import("zod").ZodOptional; + required: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + name: import("zod").ZodString; + description: import("zod").ZodOptional; + required: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">>, "many">>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + name: import("zod").ZodString; + description: import("zod").ZodOptional; + arguments: import("zod").ZodOptional; + required: import("zod").ZodOptional; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + name: import("zod").ZodString; + description: import("zod").ZodOptional; + required: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + name: import("zod").ZodString; + description: import("zod").ZodOptional; + required: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">>, "many">>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + name: import("zod").ZodString; + description: import("zod").ZodOptional; + arguments: import("zod").ZodOptional; + required: import("zod").ZodOptional; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + name: import("zod").ZodString; + description: import("zod").ZodOptional; + required: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + name: import("zod").ZodString; + description: import("zod").ZodOptional; + required: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">>, "many">>; + }, import("zod").ZodTypeAny, "passthrough">>, "many">; + }>, import("zod").ZodTypeAny, "passthrough">>; + listResources(params?: ListResourcesRequest["params"], options?: RequestOptions): Promise, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + nextCursor: import("zod").ZodOptional; + }>, { + resources: import("zod").ZodArray; + mimeType: import("zod").ZodOptional; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + uri: import("zod").ZodString; + name: import("zod").ZodString; + description: import("zod").ZodOptional; + mimeType: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + uri: import("zod").ZodString; + name: import("zod").ZodString; + description: import("zod").ZodOptional; + mimeType: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">>, "many">; + }>, import("zod").ZodTypeAny, "passthrough">>; + listResourceTemplates(params?: ListResourceTemplatesRequest["params"], options?: RequestOptions): Promise, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + nextCursor: import("zod").ZodOptional; + }>, { + resourceTemplates: import("zod").ZodArray; + mimeType: import("zod").ZodOptional; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + uriTemplate: import("zod").ZodString; + name: import("zod").ZodString; + description: import("zod").ZodOptional; + mimeType: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + uriTemplate: import("zod").ZodString; + name: import("zod").ZodString; + description: import("zod").ZodOptional; + mimeType: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">>, "many">; + }>, import("zod").ZodTypeAny, "passthrough">>; + readResource(params: ReadResourceRequest["params"], options?: RequestOptions): Promise, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + contents: import("zod").ZodArray; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>, "many">; + }>, import("zod").ZodTypeAny, "passthrough">>; + subscribeResource(params: SubscribeRequest["params"], options?: RequestOptions): Promise<{ + _meta?: import("zod").objectOutputType<{}, import("zod").ZodTypeAny, "passthrough"> | undefined; + }>; + unsubscribeResource(params: UnsubscribeRequest["params"], options?: RequestOptions): Promise<{ + _meta?: import("zod").objectOutputType<{}, import("zod").ZodTypeAny, "passthrough"> | undefined; + }>; + callTool(params: CallToolRequest["params"], resultSchema?: typeof CallToolResultSchema | typeof CompatibilityCallToolResultSchema, options?: RequestOptions): Promise, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + content: import("zod").ZodDefault; + text: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"audio">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"audio">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"audio">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, import("zod").ZodTypeAny, "passthrough">>]>, "many">>; + structuredContent: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + isError: import("zod").ZodOptional; + }>, import("zod").ZodTypeAny, "passthrough"> | import("zod").objectOutputType, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + toolResult: import("zod").ZodUnknown; + }>, import("zod").ZodTypeAny, "passthrough">>; + private cacheToolOutputSchemas; + private getToolOutputValidator; + listTools(params?: ListToolsRequest["params"], options?: RequestOptions): Promise, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + nextCursor: import("zod").ZodOptional; + }>, { + tools: import("zod").ZodArray; + inputSchema: import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + required: import("zod").ZodOptional>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + required: import("zod").ZodOptional>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + required: import("zod").ZodOptional>; + }, import("zod").ZodTypeAny, "passthrough">>; + outputSchema: import("zod").ZodOptional; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + required: import("zod").ZodOptional>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + required: import("zod").ZodOptional>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + required: import("zod").ZodOptional>; + }, import("zod").ZodTypeAny, "passthrough">>>; + annotations: import("zod").ZodOptional; + readOnlyHint: import("zod").ZodOptional; + destructiveHint: import("zod").ZodOptional; + idempotentHint: import("zod").ZodOptional; + openWorldHint: import("zod").ZodOptional; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + title: import("zod").ZodOptional; + readOnlyHint: import("zod").ZodOptional; + destructiveHint: import("zod").ZodOptional; + idempotentHint: import("zod").ZodOptional; + openWorldHint: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + title: import("zod").ZodOptional; + readOnlyHint: import("zod").ZodOptional; + destructiveHint: import("zod").ZodOptional; + idempotentHint: import("zod").ZodOptional; + openWorldHint: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">>>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + name: import("zod").ZodString; + description: import("zod").ZodOptional; + inputSchema: import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + required: import("zod").ZodOptional>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + required: import("zod").ZodOptional>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + required: import("zod").ZodOptional>; + }, import("zod").ZodTypeAny, "passthrough">>; + outputSchema: import("zod").ZodOptional; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + required: import("zod").ZodOptional>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + required: import("zod").ZodOptional>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + required: import("zod").ZodOptional>; + }, import("zod").ZodTypeAny, "passthrough">>>; + annotations: import("zod").ZodOptional; + readOnlyHint: import("zod").ZodOptional; + destructiveHint: import("zod").ZodOptional; + idempotentHint: import("zod").ZodOptional; + openWorldHint: import("zod").ZodOptional; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + title: import("zod").ZodOptional; + readOnlyHint: import("zod").ZodOptional; + destructiveHint: import("zod").ZodOptional; + idempotentHint: import("zod").ZodOptional; + openWorldHint: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + title: import("zod").ZodOptional; + readOnlyHint: import("zod").ZodOptional; + destructiveHint: import("zod").ZodOptional; + idempotentHint: import("zod").ZodOptional; + openWorldHint: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">>>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + name: import("zod").ZodString; + description: import("zod").ZodOptional; + inputSchema: import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + required: import("zod").ZodOptional>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + required: import("zod").ZodOptional>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + required: import("zod").ZodOptional>; + }, import("zod").ZodTypeAny, "passthrough">>; + outputSchema: import("zod").ZodOptional; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + required: import("zod").ZodOptional>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + required: import("zod").ZodOptional>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + required: import("zod").ZodOptional>; + }, import("zod").ZodTypeAny, "passthrough">>>; + annotations: import("zod").ZodOptional; + readOnlyHint: import("zod").ZodOptional; + destructiveHint: import("zod").ZodOptional; + idempotentHint: import("zod").ZodOptional; + openWorldHint: import("zod").ZodOptional; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + title: import("zod").ZodOptional; + readOnlyHint: import("zod").ZodOptional; + destructiveHint: import("zod").ZodOptional; + idempotentHint: import("zod").ZodOptional; + openWorldHint: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + title: import("zod").ZodOptional; + readOnlyHint: import("zod").ZodOptional; + destructiveHint: import("zod").ZodOptional; + idempotentHint: import("zod").ZodOptional; + openWorldHint: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">>>; + }, import("zod").ZodTypeAny, "passthrough">>, "many">; + }>, import("zod").ZodTypeAny, "passthrough">>; + sendRootsListChanged(): Promise; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/client/index.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/index.d.ts.map new file mode 100644 index 0000000000..256a1bdeef --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EACR,eAAe,EACf,cAAc,EACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,YAAY,EACZ,iCAAiC,EACjC,eAAe,EAGf,gBAAgB,EAEhB,cAAc,EAGd,kBAAkB,EAElB,oBAAoB,EAEpB,4BAA4B,EAE5B,gBAAgB,EAEhB,YAAY,EACZ,YAAY,EACZ,mBAAmB,EAEnB,OAAO,EACP,MAAM,EACN,kBAAkB,EAClB,gBAAgB,EAEhB,kBAAkB,EAInB,MAAM,aAAa,CAAC;AAIrB,MAAM,MAAM,aAAa,GAAG,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AO,CAAC,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;IASpB,YAAY,CAChB,MAAM,EAAE,mBAAmB,CAAC,QAAQ,CAAC,EACrC,OAAO,CAAC,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IASpB,iBAAiB,CACrB,MAAM,EAAE,gBAAgB,CAAC,QAAQ,CAAC,EAClC,OAAO,CAAC,EAAE,cAAc;;;IASpB,mBAAmB,CACvB,MAAM,EAAE,kBAAkB,CAAC,QAAQ,CAAC,EACpC,OAAO,CAAC,EAAE,cAAc;;;IASpB,QAAQ,CACZ,MAAM,EAAE,eAAe,CAAC,QAAQ,CAAC,EACjC,YAAY,GACR,OAAO,oBAAoB,GAC3B,OAAO,iCAAwD,EACnE,OAAO,CAAC,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA8C1B,OAAO,CAAC,sBAAsB;IAgB9B,OAAO,CAAC,sBAAsB;IAIxB,SAAS,CACb,MAAM,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,EACnC,OAAO,CAAC,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAcpB,oBAAoB;CAG3B"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/client/index.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/index.js new file mode 100644 index 0000000000..beed6795c8 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/index.js @@ -0,0 +1,279 @@ +import { mergeCapabilities, Protocol, } from "../shared/protocol.js"; +import { CallToolResultSchema, CompleteResultSchema, EmptyResultSchema, GetPromptResultSchema, InitializeResultSchema, LATEST_PROTOCOL_VERSION, ListPromptsResultSchema, ListResourcesResultSchema, ListResourceTemplatesResultSchema, ListToolsResultSchema, ReadResourceResultSchema, SUPPORTED_PROTOCOL_VERSIONS, ErrorCode, McpError, } from "../types.js"; +import Ajv from "ajv"; +/** + * An MCP client on top of a pluggable transport. + * + * The client will automatically begin the initialization flow with the server when connect() is called. + * + * To use with custom types, extend the base Request/Notification/Result types and pass them as type parameters: + * + * ```typescript + * // Custom schemas + * const CustomRequestSchema = RequestSchema.extend({...}) + * const CustomNotificationSchema = NotificationSchema.extend({...}) + * const CustomResultSchema = ResultSchema.extend({...}) + * + * // Type aliases + * type CustomRequest = z.infer + * type CustomNotification = z.infer + * type CustomResult = z.infer + * + * // Create typed client + * const client = new Client({ + * name: "CustomClient", + * version: "1.0.0" + * }) + * ``` + */ +export class Client extends Protocol { + /** + * Initializes this client with the given name and version information. + */ + constructor(_clientInfo, options) { + var _a; + super(options); + this._clientInfo = _clientInfo; + this._cachedToolOutputValidators = new Map(); + this._capabilities = (_a = options === null || options === void 0 ? void 0 : options.capabilities) !== null && _a !== void 0 ? _a : {}; + this._ajv = new Ajv(); + } + /** + * Registers new capabilities. This can only be called before connecting to a transport. + * + * The new capabilities will be merged with any existing capabilities previously given (e.g., at initialization). + */ + registerCapabilities(capabilities) { + if (this.transport) { + throw new Error("Cannot register capabilities after connecting to transport"); + } + this._capabilities = mergeCapabilities(this._capabilities, capabilities); + } + assertCapability(capability, method) { + var _a; + if (!((_a = this._serverCapabilities) === null || _a === void 0 ? void 0 : _a[capability])) { + throw new Error(`Server does not support ${capability} (required for ${method})`); + } + } + async connect(transport, options) { + await super.connect(transport); + // When transport sessionId is already set this means we are trying to reconnect. + // In this case we don't need to initialize again. + if (transport.sessionId !== undefined) { + return; + } + try { + const result = await this.request({ + method: "initialize", + params: { + protocolVersion: LATEST_PROTOCOL_VERSION, + capabilities: this._capabilities, + clientInfo: this._clientInfo, + }, + }, InitializeResultSchema, options); + if (result === undefined) { + throw new Error(`Server sent invalid initialize result: ${result}`); + } + if (!SUPPORTED_PROTOCOL_VERSIONS.includes(result.protocolVersion)) { + throw new Error(`Server's protocol version is not supported: ${result.protocolVersion}`); + } + this._serverCapabilities = result.capabilities; + this._serverVersion = result.serverInfo; + this._instructions = result.instructions; + await this.notification({ + method: "notifications/initialized", + }); + } + catch (error) { + // Disconnect if initialization fails. + void this.close(); + throw error; + } + } + /** + * After initialization has completed, this will be populated with the server's reported capabilities. + */ + getServerCapabilities() { + return this._serverCapabilities; + } + /** + * After initialization has completed, this will be populated with information about the server's name and version. + */ + getServerVersion() { + return this._serverVersion; + } + /** + * After initialization has completed, this may be populated with information about the server's instructions. + */ + getInstructions() { + return this._instructions; + } + assertCapabilityForMethod(method) { + var _a, _b, _c, _d, _e; + switch (method) { + case "logging/setLevel": + if (!((_a = this._serverCapabilities) === null || _a === void 0 ? void 0 : _a.logging)) { + throw new Error(`Server does not support logging (required for ${method})`); + } + break; + case "prompts/get": + case "prompts/list": + if (!((_b = this._serverCapabilities) === null || _b === void 0 ? void 0 : _b.prompts)) { + throw new Error(`Server does not support prompts (required for ${method})`); + } + break; + case "resources/list": + case "resources/templates/list": + case "resources/read": + case "resources/subscribe": + case "resources/unsubscribe": + if (!((_c = this._serverCapabilities) === null || _c === void 0 ? void 0 : _c.resources)) { + throw new Error(`Server does not support resources (required for ${method})`); + } + if (method === "resources/subscribe" && + !this._serverCapabilities.resources.subscribe) { + throw new Error(`Server does not support resource subscriptions (required for ${method})`); + } + break; + case "tools/call": + case "tools/list": + if (!((_d = this._serverCapabilities) === null || _d === void 0 ? void 0 : _d.tools)) { + throw new Error(`Server does not support tools (required for ${method})`); + } + break; + case "completion/complete": + if (!((_e = this._serverCapabilities) === null || _e === void 0 ? void 0 : _e.completions)) { + throw new Error(`Server does not support completions (required for ${method})`); + } + break; + case "initialize": + // No specific capability required for initialize + break; + case "ping": + // No specific capability required for ping + break; + } + } + assertNotificationCapability(method) { + var _a; + switch (method) { + case "notifications/roots/list_changed": + if (!((_a = this._capabilities.roots) === null || _a === void 0 ? void 0 : _a.listChanged)) { + throw new Error(`Client does not support roots list changed notifications (required for ${method})`); + } + break; + case "notifications/initialized": + // No specific capability required for initialized + break; + case "notifications/cancelled": + // Cancellation notifications are always allowed + break; + case "notifications/progress": + // Progress notifications are always allowed + break; + } + } + assertRequestHandlerCapability(method) { + switch (method) { + case "sampling/createMessage": + if (!this._capabilities.sampling) { + throw new Error(`Client does not support sampling capability (required for ${method})`); + } + break; + case "roots/list": + if (!this._capabilities.roots) { + throw new Error(`Client does not support roots capability (required for ${method})`); + } + break; + case "ping": + // No specific capability required for ping + break; + } + } + async ping(options) { + return this.request({ method: "ping" }, EmptyResultSchema, options); + } + async complete(params, options) { + return this.request({ method: "completion/complete", params }, CompleteResultSchema, options); + } + async setLoggingLevel(level, options) { + return this.request({ method: "logging/setLevel", params: { level } }, EmptyResultSchema, options); + } + async getPrompt(params, options) { + return this.request({ method: "prompts/get", params }, GetPromptResultSchema, options); + } + async listPrompts(params, options) { + return this.request({ method: "prompts/list", params }, ListPromptsResultSchema, options); + } + async listResources(params, options) { + return this.request({ method: "resources/list", params }, ListResourcesResultSchema, options); + } + async listResourceTemplates(params, options) { + return this.request({ method: "resources/templates/list", params }, ListResourceTemplatesResultSchema, options); + } + async readResource(params, options) { + return this.request({ method: "resources/read", params }, ReadResourceResultSchema, options); + } + async subscribeResource(params, options) { + return this.request({ method: "resources/subscribe", params }, EmptyResultSchema, options); + } + async unsubscribeResource(params, options) { + return this.request({ method: "resources/unsubscribe", params }, EmptyResultSchema, options); + } + async callTool(params, resultSchema = CallToolResultSchema, options) { + const result = await this.request({ method: "tools/call", params }, resultSchema, options); + // Check if the tool has an outputSchema + const validator = this.getToolOutputValidator(params.name); + if (validator) { + // If tool has outputSchema, it MUST return structuredContent (unless it's an error) + if (!result.structuredContent && !result.isError) { + throw new McpError(ErrorCode.InvalidRequest, `Tool ${params.name} has an output schema but did not return structured content`); + } + // Only validate structured content if present (not when there's an error) + if (result.structuredContent) { + try { + // Validate the structured content (which is already an object) against the schema + const isValid = validator(result.structuredContent); + if (!isValid) { + throw new McpError(ErrorCode.InvalidParams, `Structured content does not match the tool's output schema: ${this._ajv.errorsText(validator.errors)}`); + } + } + catch (error) { + if (error instanceof McpError) { + throw error; + } + throw new McpError(ErrorCode.InvalidParams, `Failed to validate structured content: ${error instanceof Error ? error.message : String(error)}`); + } + } + } + return result; + } + cacheToolOutputSchemas(tools) { + this._cachedToolOutputValidators.clear(); + for (const tool of tools) { + // If the tool has an outputSchema, create and cache the Ajv validator + if (tool.outputSchema) { + try { + const validator = this._ajv.compile(tool.outputSchema); + this._cachedToolOutputValidators.set(tool.name, validator); + } + catch (error) { + console.warn(`Failed to compile output schema for tool ${tool.name}: ${error}`); + } + } + } + } + getToolOutputValidator(toolName) { + return this._cachedToolOutputValidators.get(toolName); + } + async listTools(params, options) { + const result = await this.request({ method: "tools/list", params }, ListToolsResultSchema, options); + // Cache the tools and their output schemas for future validation + this.cacheToolOutputSchemas(result.tools); + return result; + } + async sendRootsListChanged() { + return this.notification({ method: "notifications/roots/list_changed" }); + } +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/client/index.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/index.js.map new file mode 100644 index 0000000000..c002057d70 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,QAAQ,GAGT,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAEL,oBAAoB,EAOpB,oBAAoB,EACpB,iBAAiB,EAEjB,qBAAqB,EAErB,sBAAsB,EACtB,uBAA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/B,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,EAChC,qBAAqB,EACrB,OAAO,CACR,CAAC;QAEF,iEAAiE;QACjE,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAE1C,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,KAAK,CAAC,oBAAoB;QACxB,OAAO,IAAI,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,kCAAkC,EAAE,CAAC,CAAC;IAC3E,CAAC;CACF"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/client/sse.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/sse.d.ts new file mode 100644 index 0000000000..49e882a682 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/sse.d.ts @@ -0,0 +1,71 @@ +import { type ErrorEvent, type EventSourceInit } from "eventsource"; +import { Transport } from "../shared/transport.js"; +import { JSONRPCMessage } from "../types.js"; +import { OAuthClientProvider } from "./auth.js"; +export declare class SseError extends Error { + readonly code: number | undefined; + readonly event: ErrorEvent; + constructor(code: number | undefined, message: string | undefined, event: ErrorEvent); +} +/** + * Configuration options for the `SSEClientTransport`. + */ +export type SSEClientTransportOptions = { + /** + * An OAuth client provider to use for authentication. + * + * When an `authProvider` is specified and the SSE connection is started: + * 1. The connection is attempted with any existing access token from the `authProvider`. + * 2. If the access token has expired, the `authProvider` is used to refresh the token. + * 3. If token refresh fails or no access token exists, and auth is required, `OAuthClientProvider.redirectToAuthorization` is called, and an `UnauthorizedError` will be thrown from `connect`/`start`. + * + * After the user has finished authorizing via their user agent, and is redirected back to the MCP client application, call `SSEClientTransport.finishAuth` with the authorization code before retrying the connection. + * + * If an `authProvider` is not provided, and auth is required, an `UnauthorizedError` will be thrown. + * + * `UnauthorizedError` might also be thrown when sending any message over the SSE transport, indicating that the session has expired, and needs to be re-authed and reconnected. + */ + authProvider?: OAuthClientProvider; + /** + * Customizes the initial SSE request to the server (the request that begins the stream). + * + * NOTE: Setting this property will prevent an `Authorization` header from + * being automatically attached to the SSE request, if an `authProvider` is + * also given. This can be worked around by setting the `Authorization` header + * manually. + */ + eventSourceInit?: EventSourceInit; + /** + * Customizes recurring POST requests to the server. + */ + requestInit?: RequestInit; +}; +/** + * Client transport for SSE: this will connect to a server using Server-Sent Events for receiving + * messages and make separate POST requests for sending messages. + */ +export declare class SSEClientTransport implements Transport { + private _eventSource?; + private _endpoint?; + private _abortController?; + private _url; + private _resourceMetadataUrl?; + private _eventSourceInit?; + private _requestInit?; + private _authProvider?; + onclose?: () => void; + onerror?: (error: Error) => void; + onmessage?: (message: JSONRPCMessage) => void; + constructor(url: URL, opts?: SSEClientTransportOptions); + private _authThenStart; + private _commonHeaders; + private _startOrAuth; + start(): Promise; + /** + * Call this method after the user has finished authorizing via their user agent and is redirected back to the MCP client application. This will exchange the authorization code for an access token, enabling the next connection attempt to successfully auth. + */ + finishAuth(authorizationCode: string): Promise; + close(): Promise; + send(message: JSONRPCMessage): Promise; +} +//# sourceMappingURL=sse.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/client/sse.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/sse.d.ts.map new file mode 100644 index 0000000000..644bc6bb13 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/sse.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"sse.d.ts","sourceRoot":"","sources":["../../../src/client/sse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAwB,MAAM,aAAa,CAAC;AACnE,OAAO,EAAgD,mBAAmB,EAAqB,MAAM,WAAW,CAAC;AAEjH,qBAAa,QAAS,SAAQ,KAAK;aAEf,IAAI,EAAE,MAAM,GAAG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-sdk/ajv/dist/esm/client/sse.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/sse.js new file mode 100644 index 0000000000..588c62ae52 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/sse.js @@ -0,0 +1,171 @@ +import { EventSource } from "eventsource"; +import { JSONRPCMessageSchema } from "../types.js"; +import { auth, extractResourceMetadataUrl, UnauthorizedError } from "./auth.js"; +export class SseError extends Error { + constructor(code, message, event) { + super(`SSE error: ${message}`); + this.code = code; + this.event = event; + } +} +/** + * Client transport for SSE: this will connect to a server using Server-Sent Events for receiving + * messages and make separate POST requests for sending messages. + */ +export class SSEClientTransport { + constructor(url, opts) { + this._url = url; + this._resourceMetadataUrl = undefined; + this._eventSourceInit = opts === null || opts === void 0 ? void 0 : opts.eventSourceInit; + this._requestInit = opts === null || opts === void 0 ? void 0 : opts.requestInit; + this._authProvider = opts === null || opts === void 0 ? void 0 : opts.authProvider; + } + async _authThenStart() { + var _a; + if (!this._authProvider) { + throw new UnauthorizedError("No auth provider"); + } + let result; + try { + result = await auth(this._authProvider, { serverUrl: this._url, resourceMetadataUrl: this._resourceMetadataUrl }); + } + catch (error) { + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + throw error; + } + if (result !== "AUTHORIZED") { + throw new UnauthorizedError(); + } + return await this._startOrAuth(); + } + async _commonHeaders() { + var _a; + const headers = { ...(_a = this._requestInit) === null || _a === void 0 ? void 0 : _a.headers }; + if (this._authProvider) { + const tokens = await this._authProvider.tokens(); + if (tokens) { + headers["Authorization"] = `Bearer ${tokens.access_token}`; + } + } + return headers; + } + _startOrAuth() { + return new Promise((resolve, reject) => { + var _a; + this._eventSource = new EventSource(this._url.href, (_a = this._eventSourceInit) !== null && _a !== void 0 ? _a : { + fetch: (url, init) => this._commonHeaders().then((headers) => fetch(url, { + ...init, + headers: { + ...headers, + Accept: "text/event-stream" + } + })), + }); + this._abortController = new AbortController(); + this._eventSource.onerror = (event) => { + var _a; + if (event.code === 401 && this._authProvider) { + this._authThenStart().then(resolve, reject); + return; + } + const error = new SseError(event.code, event.message, event); + reject(error); + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + }; + this._eventSource.onopen = () => { + // The connection is open, but we need to wait for the endpoint to be received. + }; + this._eventSource.addEventListener("endpoint", (event) => { + var _a; + const messageEvent = event; + try { + this._endpoint = new URL(messageEvent.data, this._url); + if (this._endpoint.origin !== this._url.origin) { + throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`); + } + } + catch (error) { + reject(error); + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + void this.close(); + return; + } + resolve(); + }); + this._eventSource.onmessage = (event) => { + var _a, _b; + const messageEvent = event; + let message; + try { + message = JSONRPCMessageSchema.parse(JSON.parse(messageEvent.data)); + } + catch (error) { + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + return; + } + (_b = this.onmessage) === null || _b === void 0 ? void 0 : _b.call(this, message); + }; + }); + } + async start() { + if (this._eventSource) { + throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically."); + } + return await this._startOrAuth(); + } + /** + * Call this method after the user has finished authorizing via their user agent and is redirected back to the MCP client application. This will exchange the authorization code for an access token, enabling the next connection attempt to successfully auth. + */ + async finishAuth(authorizationCode) { + if (!this._authProvider) { + throw new UnauthorizedError("No auth provider"); + } + const result = await auth(this._authProvider, { serverUrl: this._url, authorizationCode, resourceMetadataUrl: this._resourceMetadataUrl }); + if (result !== "AUTHORIZED") { + throw new UnauthorizedError("Failed to authorize"); + } + } + async close() { + var _a, _b, _c; + (_a = this._abortController) === null || _a === void 0 ? void 0 : _a.abort(); + (_b = this._eventSource) === null || _b === void 0 ? void 0 : _b.close(); + (_c = this.onclose) === null || _c === void 0 ? void 0 : _c.call(this); + } + async send(message) { + var _a, _b, _c; + if (!this._endpoint) { + throw new Error("Not connected"); + } + try { + const commonHeaders = await this._commonHeaders(); + const headers = new Headers({ ...commonHeaders, ...(_a = this._requestInit) === null || _a === void 0 ? void 0 : _a.headers }); + headers.set("content-type", "application/json"); + const init = { + ...this._requestInit, + method: "POST", + headers, + body: JSON.stringify(message), + signal: (_b = this._abortController) === null || _b === void 0 ? void 0 : _b.signal, + }; + const response = await fetch(this._endpoint, init); + if (!response.ok) { + if (response.status === 401 && this._authProvider) { + this._resourceMetadataUrl = extractResourceMetadataUrl(response); + const result = await auth(this._authProvider, { serverUrl: this._url, resourceMetadataUrl: this._resourceMetadataUrl }); + if (result !== "AUTHORIZED") { + throw new UnauthorizedError(); + } + // Purposely _not_ awaited, so we don't call onerror twice + return this.send(message); + } + const text = await response.text().catch(() => null); + throw new Error(`Error POSTing to endpoint (HTTP ${response.status}): ${text}`); + } + } + catch (error) { + (_c = this.onerror) === null || _c === void 0 ? void 0 : _c.call(this, error); + throw error; + } + } +} +//# sourceMappingURL=sse.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/client/sse.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/sse.js.map new file mode 100644 index 0000000000..8f33832f96 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/sse.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sse.js","sourceRoot":"","sources":["../../../src/client/sse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAyC,MAAM,aAAa,CAAC;AAEjF,OAAO,EAAkB,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,IAAI,EAAc,0BAA0B,EAAuB,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEjH,MAAM,OAAO,QAAS,SAAQ,KAAK;IACjC,YACkB,IAAwB,EACxC,OAA2B,EACX,KAAiB;QAEjC,KAAK,CAAC,cAAc,OAAO,EAAE,CAAC,CAAC;QAJf,SAAI,GAAJ,IAAI,CAAoB;QAExB,UAAK,GAAL,KAAK,CAAY;IAGnC,CAAC;CACF;AAsCD;;;GAGG;AACH,MAA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--git a/front_end/third_party/mcp-sdk/ajv/dist/esm/client/stdio.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/stdio.d.ts new file mode 100644 index 0000000000..9db03502ad --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/stdio.d.ts @@ -0,0 +1,72 @@ +import { IOType } from "node:child_process"; +import { Stream } from "node:stream"; +import { Transport } from "../shared/transport.js"; +import { JSONRPCMessage } from "../types.js"; +export type StdioServerParameters = { + /** + * The executable to run to start the server. + */ + command: string; + /** + * Command line arguments to pass to the executable. + */ + args?: string[]; + /** + * The environment to use when spawning the process. + * + * If not specified, the result of getDefaultEnvironment() will be used. + */ + env?: Record; + /** + * How to handle stderr of the child process. This matches the semantics of Node's `child_process.spawn`. + * + * The default is "inherit", meaning messages to stderr will be printed to the parent process's stderr. + */ + stderr?: IOType | Stream | number; + /** + * The working directory to use when spawning the process. + * + * If not specified, the current working directory will be inherited. + */ + cwd?: string; +}; +/** + * Environment variables to inherit by default, if an environment is not explicitly given. + */ +export declare const DEFAULT_INHERITED_ENV_VARS: string[]; +/** + * Returns a default environment object including only environment variables deemed safe to inherit. + */ +export declare function getDefaultEnvironment(): Record; +/** + * Client transport for stdio: this will connect to a server by spawning a process and communicating with it over stdin/stdout. + * + * This transport is only available in Node.js environments. + */ +export declare class StdioClientTransport implements Transport { + private _process?; + private _abortController; + private _readBuffer; + private _serverParams; + private _stderrStream; + onclose?: () => void; + onerror?: (error: Error) => void; + onmessage?: (message: JSONRPCMessage) => void; + constructor(server: StdioServerParameters); + /** + * Starts the server process and prepares to communicate with it. + */ + start(): Promise; + /** + * The stderr stream of the child process, if `StdioServerParameters.stderr` was set to "pipe" or "overlapped". + * + * If stderr piping was requested, a PassThrough stream is returned _immediately_, allowing callers to + * attach listeners before the start method is invoked. This prevents loss of any early + * error output emitted by the child process. + */ + get stderr(): Stream | null; + private processReadBuffer; + close(): Promise; + send(message: JSONRPCMessage): Promise; +} +//# sourceMappingURL=stdio.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/client/stdio.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/stdio.d.ts.map new file mode 100644 index 0000000000..4d01323e0b --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/stdio.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"stdio.d.ts","sourceRoot":"","sources":["../../../src/client/stdio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG1D,OAAO,EAAE,MAAM,EAAe,MAAM,aAAa,CAAC;AAElD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAEhB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE7B;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IAElC;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,UAgBmB,CAAC;AAE3D;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAkB9D;AAED;;;;GAIG;AACH,qBAAa,oBAAqB,YAAW,SAAS;IACpD,OAAO,CAAC,QAAQ,CAAC,CAAe;IAChC,OAAO,CAAC,gBAAgB,CAA0C;IAClE,OAAO,CAAC,WAAW,CAAgC;IACnD,OAAO,CAAC,aAAa,CAAwB;IAC7C,OAAO,CAAC,aAAa,CAA4B;IAEjD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;gBAElC,MAAM,EAAE,qBAAqB;IAOzC;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IA4D5B;;;;;;OAMG;IACH,IAAI,MAAM,IAAI,MAAM,GAAG,IAAI,CAM1B;IAED,OAAO,CAAC,iBAAiB;IAenB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAM5B,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAc7C"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/client/stdio.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/stdio.js new file mode 100644 index 0000000000..0edafa5893 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/stdio.js @@ -0,0 +1,162 @@ +import spawn from "cross-spawn"; +import process from "node:process"; +import { PassThrough } from "node:stream"; +import { ReadBuffer, serializeMessage } from "../shared/stdio.js"; +/** + * Environment variables to inherit by default, if an environment is not explicitly given. + */ +export const DEFAULT_INHERITED_ENV_VARS = process.platform === "win32" + ? [ + "APPDATA", + "HOMEDRIVE", + "HOMEPATH", + "LOCALAPPDATA", + "PATH", + "PROCESSOR_ARCHITECTURE", + "SYSTEMDRIVE", + "SYSTEMROOT", + "TEMP", + "USERNAME", + "USERPROFILE", + ] + : /* list inspired by the default env inheritance of sudo */ + ["HOME", "LOGNAME", "PATH", "SHELL", "TERM", "USER"]; +/** + * Returns a default environment object including only environment variables deemed safe to inherit. + */ +export function getDefaultEnvironment() { + const env = {}; + for (const key of DEFAULT_INHERITED_ENV_VARS) { + const value = process.env[key]; + if (value === undefined) { + continue; + } + if (value.startsWith("()")) { + // Skip functions, which are a security risk. + continue; + } + env[key] = value; + } + return env; +} +/** + * Client transport for stdio: this will connect to a server by spawning a process and communicating with it over stdin/stdout. + * + * This transport is only available in Node.js environments. + */ +export class StdioClientTransport { + constructor(server) { + this._abortController = new AbortController(); + this._readBuffer = new ReadBuffer(); + this._stderrStream = null; + this._serverParams = server; + if (server.stderr === "pipe" || server.stderr === "overlapped") { + this._stderrStream = new PassThrough(); + } + } + /** + * Starts the server process and prepares to communicate with it. + */ + async start() { + if (this._process) { + throw new Error("StdioClientTransport already started! If using Client class, note that connect() calls start() automatically."); + } + return new Promise((resolve, reject) => { + var _a, _b, _c, _d, _e, _f; + this._process = spawn(this._serverParams.command, (_a = this._serverParams.args) !== null && _a !== void 0 ? _a : [], { + env: (_b = this._serverParams.env) !== null && _b !== void 0 ? _b : getDefaultEnvironment(), + stdio: ["pipe", "pipe", (_c = this._serverParams.stderr) !== null && _c !== void 0 ? _c : "inherit"], + shell: false, + signal: this._abortController.signal, + windowsHide: process.platform === "win32" && isElectron(), + cwd: this._serverParams.cwd, + }); + this._process.on("error", (error) => { + var _a, _b; + if (error.name === "AbortError") { + // Expected when close() is called. + (_a = this.onclose) === null || _a === void 0 ? void 0 : _a.call(this); + return; + } + reject(error); + (_b = this.onerror) === null || _b === void 0 ? void 0 : _b.call(this, error); + }); + this._process.on("spawn", () => { + resolve(); + }); + this._process.on("close", (_code) => { + var _a; + this._process = undefined; + (_a = this.onclose) === null || _a === void 0 ? void 0 : _a.call(this); + }); + (_d = this._process.stdin) === null || _d === void 0 ? void 0 : _d.on("error", (error) => { + var _a; + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + }); + (_e = this._process.stdout) === null || _e === void 0 ? void 0 : _e.on("data", (chunk) => { + this._readBuffer.append(chunk); + this.processReadBuffer(); + }); + (_f = this._process.stdout) === null || _f === void 0 ? void 0 : _f.on("error", (error) => { + var _a; + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + }); + if (this._stderrStream && this._process.stderr) { + this._process.stderr.pipe(this._stderrStream); + } + }); + } + /** + * The stderr stream of the child process, if `StdioServerParameters.stderr` was set to "pipe" or "overlapped". + * + * If stderr piping was requested, a PassThrough stream is returned _immediately_, allowing callers to + * attach listeners before the start method is invoked. This prevents loss of any early + * error output emitted by the child process. + */ + get stderr() { + var _a, _b; + if (this._stderrStream) { + return this._stderrStream; + } + return (_b = (_a = this._process) === null || _a === void 0 ? void 0 : _a.stderr) !== null && _b !== void 0 ? _b : null; + } + processReadBuffer() { + var _a, _b; + while (true) { + try { + const message = this._readBuffer.readMessage(); + if (message === null) { + break; + } + (_a = this.onmessage) === null || _a === void 0 ? void 0 : _a.call(this, message); + } + catch (error) { + (_b = this.onerror) === null || _b === void 0 ? void 0 : _b.call(this, error); + } + } + } + async close() { + this._abortController.abort(); + this._process = undefined; + this._readBuffer.clear(); + } + send(message) { + return new Promise((resolve) => { + var _a; + if (!((_a = this._process) === null || _a === void 0 ? void 0 : _a.stdin)) { + throw new Error("Not connected"); + } + const json = serializeMessage(message); + if (this._process.stdin.write(json)) { + resolve(); + } + else { + this._process.stdin.once("drain", resolve); + } + }); + } +} +function isElectron() { + return "type" in process; +} +//# sourceMappingURL=stdio.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/client/stdio.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/stdio.js.map new file mode 100644 index 0000000000..257403fe52 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/stdio.js.map @@ -0,0 +1 @@ +{"version":3,"file":"stdio.js","sourceRoot":"","sources":["../../../src/client/stdio.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,aAAa,CAAC;AAChC,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAU,WAAW,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAqClE;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GACrC,OAAO,CAAC,QAAQ,KAAK,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BACrB,MAAM;gBACR,CAAC;gBAED,MAAA,IAAI,CAAC,SAAS,qDAAG,OAAO,CAAC,CAAC;YAC5B,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAA,IAAI,CAAC,OAAO,qDAAG,KAAc,CAAC,CAAC;YACjC,CAAC;QACH,CAAC;IACH,CAAC;IAED,KAAK,CAAC,KAAK;QACT,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,CAAC;QAC9B,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC;QAC1B,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;IAC3B,CAAC;IAED,IAAI,CAAC,OAAuB;QAC1B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;;YAC7B,IAAI,CAAC,CAAA,MAAA,IAAI,CAAC,QAAQ,0CAAE,KAAK,CAAA,EAAE,CAAC;gBAC1B,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;YACnC,CAAC;YAED,MAAM,IAAI,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;YACvC,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;gBACpC,OAAO,EAAE,CAAC;YACZ,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAC7C,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAED,SAAS,UAAU;IACjB,OAAO,MAAM,IAAI,OAAO,CAAC;AAC3B,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/client/streamableHttp.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/streamableHttp.d.ts new file mode 100644 index 0000000000..e3e8697f2d --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/streamableHttp.d.ts @@ -0,0 +1,125 @@ +import { Transport } from "../shared/transport.js"; +import { JSONRPCMessage } from "../types.js"; +import { OAuthClientProvider } from "./auth.js"; +export declare class StreamableHTTPError extends Error { + readonly code: number | undefined; + constructor(code: number | undefined, message: string | undefined); +} +/** + * Configuration options for reconnection behavior of the StreamableHTTPClientTransport. + */ +export interface StreamableHTTPReconnectionOptions { + /** + * Maximum backoff time between reconnection attempts in milliseconds. + * Default is 30000 (30 seconds). + */ + maxReconnectionDelay: number; + /** + * Initial backoff time between reconnection attempts in milliseconds. + * Default is 1000 (1 second). + */ + initialReconnectionDelay: number; + /** + * The factor by which the reconnection delay increases after each attempt. + * Default is 1.5. + */ + reconnectionDelayGrowFactor: number; + /** + * Maximum number of reconnection attempts before giving up. + * Default is 2. + */ + maxRetries: number; +} +/** + * Configuration options for the `StreamableHTTPClientTransport`. + */ +export type StreamableHTTPClientTransportOptions = { + /** + * An OAuth client provider to use for authentication. + * + * When an `authProvider` is specified and the connection is started: + * 1. The connection is attempted with any existing access token from the `authProvider`. + * 2. If the access token has expired, the `authProvider` is used to refresh the token. + * 3. If token refresh fails or no access token exists, and auth is required, `OAuthClientProvider.redirectToAuthorization` is called, and an `UnauthorizedError` will be thrown from `connect`/`start`. + * + * After the user has finished authorizing via their user agent, and is redirected back to the MCP client application, call `StreamableHTTPClientTransport.finishAuth` with the authorization code before retrying the connection. + * + * If an `authProvider` is not provided, and auth is required, an `UnauthorizedError` will be thrown. + * + * `UnauthorizedError` might also be thrown when sending any message over the transport, indicating that the session has expired, and needs to be re-authed and reconnected. + */ + authProvider?: OAuthClientProvider; + /** + * Customizes HTTP requests to the server. + */ + requestInit?: RequestInit; + /** + * Options to configure the reconnection behavior. + */ + reconnectionOptions?: StreamableHTTPReconnectionOptions; + /** + * Session ID for the connection. This is used to identify the session on the server. + * When not provided and connecting to a server that supports session IDs, the server will generate a new session ID. + */ + sessionId?: string; +}; +/** + * Client transport for Streamable HTTP: this implements the MCP Streamable HTTP transport specification. + * It will connect to a server using HTTP POST for sending messages and HTTP GET with Server-Sent Events + * for receiving messages. + */ +export declare class StreamableHTTPClientTransport implements Transport { + private _abortController?; + private _url; + private _resourceMetadataUrl?; + private _requestInit?; + private _authProvider?; + private _sessionId?; + private _reconnectionOptions; + onclose?: () => void; + onerror?: (error: Error) => void; + onmessage?: (message: JSONRPCMessage) => void; + constructor(url: URL, opts?: StreamableHTTPClientTransportOptions); + private _authThenStart; + private _commonHeaders; + private _startOrAuthSse; + /** + * Calculates the next reconnection delay using backoff algorithm + * + * @param attempt Current reconnection attempt count for the specific stream + * @returns Time to wait in milliseconds before next reconnection attempt + */ + private _getNextReconnectionDelay; + /** + * Schedule a reconnection attempt with exponential backoff + * + * @param lastEventId The ID of the last received event for resumability + * @param attemptCount Current reconnection attempt count for this specific stream + */ + private _scheduleReconnection; + private _handleSseStream; + start(): Promise; + /** + * Call this method after the user has finished authorizing via their user agent and is redirected back to the MCP client application. This will exchange the authorization code for an access token, enabling the next connection attempt to successfully auth. + */ + finishAuth(authorizationCode: string): Promise; + close(): Promise; + send(message: JSONRPCMessage | JSONRPCMessage[], options?: { + resumptionToken?: string; + onresumptiontoken?: (token: string) => void; + }): Promise; + get sessionId(): string | undefined; + /** + * Terminates the current session by sending a DELETE request to the server. + * + * Clients that no longer need a particular session + * (e.g., because the user is leaving the client application) SHOULD send an + * HTTP DELETE to the MCP endpoint with the Mcp-Session-Id header to explicitly + * terminate the session. + * + * The server MAY respond with HTTP 405 Method Not Allowed, indicating that + * the server does not allow clients to terminate sessions. + */ + terminateSession(): Promise; +} +//# sourceMappingURL=streamableHttp.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/client/streamableHttp.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/streamableHttp.d.ts.map new file mode 100644 index 0000000000..a8b31bc102 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/streamableHttp.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"streamableHttp.d.ts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E,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;gBAG5C,GAAG,EAAE,GAAG,EACR,IAAI,CAAC,EAAE,oCAAoC;YAU/B,cAAc;YAoBd,cAAc;YAmBd,eAAe;IA6C7B;;;;;OAKG;IACH,OAAO,CAAC,yBAAyB;IAWjC;;;;;OAKG;IACH,OAAO,CAAC,qBAAqB;IAwB7B,OAAO,CAAC,gBAAgB;IAoElB,KAAK;IAUX;;OAEG;IACG,UAAU,CAAC,iBAAiB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAWpD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAOtB,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,cAAc,EAAE,EAAE,OAAO,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,MAAM,CAAC;QAAC,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAkG1J,IAAI,SAAS,IAAI,MAAM,GAAG,SAAS,CAElC;IAED;;;;;;;;;;OAUG;IACG,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;CAgCxC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/client/streamableHttp.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/streamableHttp.js new file mode 100644 index 0000000000..3613b408e6 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/streamableHttp.js @@ -0,0 +1,350 @@ +import { isInitializedNotification, isJSONRPCRequest, isJSONRPCResponse, JSONRPCMessageSchema } from "../types.js"; +import { auth, extractResourceMetadataUrl, UnauthorizedError } from "./auth.js"; +import { EventSourceParserStream } from "eventsource-parser/stream"; +// Default reconnection options for StreamableHTTP connections +const DEFAULT_STREAMABLE_HTTP_RECONNECTION_OPTIONS = { + initialReconnectionDelay: 1000, + maxReconnectionDelay: 30000, + reconnectionDelayGrowFactor: 1.5, + maxRetries: 2, +}; +export class StreamableHTTPError extends Error { + constructor(code, message) { + super(`Streamable HTTP error: ${message}`); + this.code = code; + } +} +/** + * Client transport for Streamable HTTP: this implements the MCP Streamable HTTP transport specification. + * It will connect to a server using HTTP POST for sending messages and HTTP GET with Server-Sent Events + * for receiving messages. + */ +export class StreamableHTTPClientTransport { + constructor(url, opts) { + var _a; + this._url = url; + this._resourceMetadataUrl = undefined; + this._requestInit = opts === null || opts === void 0 ? void 0 : opts.requestInit; + this._authProvider = opts === null || opts === void 0 ? void 0 : opts.authProvider; + this._sessionId = opts === null || opts === void 0 ? void 0 : opts.sessionId; + this._reconnectionOptions = (_a = opts === null || opts === void 0 ? void 0 : opts.reconnectionOptions) !== null && _a !== void 0 ? _a : DEFAULT_STREAMABLE_HTTP_RECONNECTION_OPTIONS; + } + async _authThenStart() { + var _a; + if (!this._authProvider) { + throw new UnauthorizedError("No auth provider"); + } + let result; + try { + result = await auth(this._authProvider, { serverUrl: this._url, resourceMetadataUrl: this._resourceMetadataUrl }); + } + catch (error) { + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + throw error; + } + if (result !== "AUTHORIZED") { + throw new UnauthorizedError(); + } + return await this._startOrAuthSse({ resumptionToken: undefined }); + } + async _commonHeaders() { + var _a; + const headers = {}; + if (this._authProvider) { + const tokens = await this._authProvider.tokens(); + if (tokens) { + headers["Authorization"] = `Bearer ${tokens.access_token}`; + } + } + if (this._sessionId) { + headers["mcp-session-id"] = this._sessionId; + } + return new Headers({ ...headers, ...(_a = this._requestInit) === null || _a === void 0 ? void 0 : _a.headers }); + } + async _startOrAuthSse(options) { + var _a, _b; + const { resumptionToken } = options; + try { + // Try to open an initial SSE stream with GET to listen for server messages + // This is optional according to the spec - server may not support it + const headers = await this._commonHeaders(); + headers.set("Accept", "text/event-stream"); + // Include Last-Event-ID header for resumable streams if provided + if (resumptionToken) { + headers.set("last-event-id", resumptionToken); + } + const response = await fetch(this._url, { + method: "GET", + headers, + signal: (_a = this._abortController) === null || _a === void 0 ? void 0 : _a.signal, + }); + if (!response.ok) { + if (response.status === 401 && this._authProvider) { + // Need to authenticate + return await this._authThenStart(); + } + // 405 indicates that the server does not offer an SSE stream at GET endpoint + // This is an expected case that should not trigger an error + if (response.status === 405) { + return; + } + throw new StreamableHTTPError(response.status, `Failed to open SSE stream: ${response.statusText}`); + } + this._handleSseStream(response.body, options); + } + catch (error) { + (_b = this.onerror) === null || _b === void 0 ? void 0 : _b.call(this, error); + throw error; + } + } + /** + * Calculates the next reconnection delay using backoff algorithm + * + * @param attempt Current reconnection attempt count for the specific stream + * @returns Time to wait in milliseconds before next reconnection attempt + */ + _getNextReconnectionDelay(attempt) { + // Access default values directly, ensuring they're never undefined + const initialDelay = this._reconnectionOptions.initialReconnectionDelay; + const growFactor = this._reconnectionOptions.reconnectionDelayGrowFactor; + const maxDelay = this._reconnectionOptions.maxReconnectionDelay; + // Cap at maximum delay + return Math.min(initialDelay * Math.pow(growFactor, attempt), maxDelay); + } + /** + * Schedule a reconnection attempt with exponential backoff + * + * @param lastEventId The ID of the last received event for resumability + * @param attemptCount Current reconnection attempt count for this specific stream + */ + _scheduleReconnection(options, attemptCount = 0) { + var _a; + // Use provided options or default options + const maxRetries = this._reconnectionOptions.maxRetries; + // Check if we've exceeded maximum retry attempts + if (maxRetries > 0 && attemptCount >= maxRetries) { + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, new Error(`Maximum reconnection attempts (${maxRetries}) exceeded.`)); + return; + } + // Calculate next delay based on current attempt count + const delay = this._getNextReconnectionDelay(attemptCount); + // Schedule the reconnection + setTimeout(() => { + // Use the last event ID to resume where we left off + this._startOrAuthSse(options).catch(error => { + var _a; + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, new Error(`Failed to reconnect SSE stream: ${error instanceof Error ? error.message : String(error)}`)); + // Schedule another attempt if this one failed, incrementing the attempt counter + this._scheduleReconnection(options, attemptCount + 1); + }); + }, delay); + } + _handleSseStream(stream, options) { + if (!stream) { + return; + } + const { onresumptiontoken, replayMessageId } = options; + let lastEventId; + const processStream = async () => { + var _a, _b, _c, _d; + // this is the closest we can get to trying to catch network errors + // if something happens reader will throw + try { + // Create a pipeline: binary stream -> text decoder -> SSE parser + const reader = stream + .pipeThrough(new TextDecoderStream()) + .pipeThrough(new EventSourceParserStream()) + .getReader(); + while (true) { + const { value: event, done } = await reader.read(); + if (done) { + break; + } + // Update last event ID if provided + if (event.id) { + lastEventId = event.id; + onresumptiontoken === null || onresumptiontoken === void 0 ? void 0 : onresumptiontoken(event.id); + } + if (!event.event || event.event === "message") { + try { + const message = JSONRPCMessageSchema.parse(JSON.parse(event.data)); + if (replayMessageId !== undefined && isJSONRPCResponse(message)) { + message.id = replayMessageId; + } + (_a = this.onmessage) === null || _a === void 0 ? void 0 : _a.call(this, message); + } + catch (error) { + (_b = this.onerror) === null || _b === void 0 ? void 0 : _b.call(this, error); + } + } + } + } + catch (error) { + // Handle stream errors - likely a network disconnect + (_c = this.onerror) === null || _c === void 0 ? void 0 : _c.call(this, new Error(`SSE stream disconnected: ${error}`)); + // Attempt to reconnect if the stream disconnects unexpectedly and we aren't closing + if (this._abortController && !this._abortController.signal.aborted) { + // Use the exponential backoff reconnection strategy + if (lastEventId !== undefined) { + try { + this._scheduleReconnection({ + resumptionToken: lastEventId, + onresumptiontoken, + replayMessageId + }, 0); + } + catch (error) { + (_d = this.onerror) === null || _d === void 0 ? void 0 : _d.call(this, new Error(`Failed to reconnect: ${error instanceof Error ? error.message : String(error)}`)); + } + } + } + } + }; + processStream(); + } + async start() { + if (this._abortController) { + throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically."); + } + this._abortController = new AbortController(); + } + /** + * Call this method after the user has finished authorizing via their user agent and is redirected back to the MCP client application. This will exchange the authorization code for an access token, enabling the next connection attempt to successfully auth. + */ + async finishAuth(authorizationCode) { + if (!this._authProvider) { + throw new UnauthorizedError("No auth provider"); + } + const result = await auth(this._authProvider, { serverUrl: this._url, authorizationCode, resourceMetadataUrl: this._resourceMetadataUrl }); + if (result !== "AUTHORIZED") { + throw new UnauthorizedError("Failed to authorize"); + } + } + async close() { + var _a, _b; + // Abort any pending requests + (_a = this._abortController) === null || _a === void 0 ? void 0 : _a.abort(); + (_b = this.onclose) === null || _b === void 0 ? void 0 : _b.call(this); + } + async send(message, options) { + var _a, _b, _c; + try { + const { resumptionToken, onresumptiontoken } = options || {}; + if (resumptionToken) { + // If we have at last event ID, we need to reconnect the SSE stream + this._startOrAuthSse({ resumptionToken, replayMessageId: isJSONRPCRequest(message) ? message.id : undefined }).catch(err => { var _a; return (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, err); }); + return; + } + const headers = await this._commonHeaders(); + headers.set("content-type", "application/json"); + headers.set("accept", "application/json, text/event-stream"); + const init = { + ...this._requestInit, + method: "POST", + headers, + body: JSON.stringify(message), + signal: (_a = this._abortController) === null || _a === void 0 ? void 0 : _a.signal, + }; + const response = await fetch(this._url, init); + // Handle session ID received during initialization + const sessionId = response.headers.get("mcp-session-id"); + if (sessionId) { + this._sessionId = sessionId; + } + if (!response.ok) { + if (response.status === 401 && this._authProvider) { + this._resourceMetadataUrl = extractResourceMetadataUrl(response); + const result = await auth(this._authProvider, { serverUrl: this._url, resourceMetadataUrl: this._resourceMetadataUrl }); + if (result !== "AUTHORIZED") { + throw new UnauthorizedError(); + } + // Purposely _not_ awaited, so we don't call onerror twice + return this.send(message); + } + const text = await response.text().catch(() => null); + throw new Error(`Error POSTing to endpoint (HTTP ${response.status}): ${text}`); + } + // If the response is 202 Accepted, there's no body to process + if (response.status === 202) { + // if the accepted notification is initialized, we start the SSE stream + // if it's supported by the server + if (isInitializedNotification(message)) { + // Start without a lastEventId since this is a fresh connection + this._startOrAuthSse({ resumptionToken: undefined }).catch(err => { var _a; return (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, err); }); + } + return; + } + // Get original message(s) for detecting request IDs + const messages = Array.isArray(message) ? message : [message]; + const hasRequests = messages.filter(msg => "method" in msg && "id" in msg && msg.id !== undefined).length > 0; + // Check the response type + const contentType = response.headers.get("content-type"); + if (hasRequests) { + if (contentType === null || contentType === void 0 ? void 0 : contentType.includes("text/event-stream")) { + // Handle SSE stream responses for requests + // We use the same handler as standalone streams, which now supports + // reconnection with the last event ID + this._handleSseStream(response.body, { onresumptiontoken }); + } + else if (contentType === null || contentType === void 0 ? void 0 : contentType.includes("application/json")) { + // For non-streaming servers, we might get direct JSON responses + const data = await response.json(); + const responseMessages = Array.isArray(data) + ? data.map(msg => JSONRPCMessageSchema.parse(msg)) + : [JSONRPCMessageSchema.parse(data)]; + for (const msg of responseMessages) { + (_b = this.onmessage) === null || _b === void 0 ? void 0 : _b.call(this, msg); + } + } + else { + throw new StreamableHTTPError(-1, `Unexpected content type: ${contentType}`); + } + } + } + catch (error) { + (_c = this.onerror) === null || _c === void 0 ? void 0 : _c.call(this, error); + throw error; + } + } + get sessionId() { + return this._sessionId; + } + /** + * Terminates the current session by sending a DELETE request to the server. + * + * Clients that no longer need a particular session + * (e.g., because the user is leaving the client application) SHOULD send an + * HTTP DELETE to the MCP endpoint with the Mcp-Session-Id header to explicitly + * terminate the session. + * + * The server MAY respond with HTTP 405 Method Not Allowed, indicating that + * the server does not allow clients to terminate sessions. + */ + async terminateSession() { + var _a, _b; + if (!this._sessionId) { + return; // No session to terminate + } + try { + const headers = await this._commonHeaders(); + const init = { + ...this._requestInit, + method: "DELETE", + headers, + signal: (_a = this._abortController) === null || _a === void 0 ? void 0 : _a.signal, + }; + const response = await fetch(this._url, init); + // We specifically handle 405 as a valid response according to the spec, + // meaning the server does not support explicit session termination + if (!response.ok && response.status !== 405) { + throw new StreamableHTTPError(response.status, `Failed to terminate session: ${response.statusText}`); + } + this._sessionId = undefined; + } + catch (error) { + (_b = this.onerror) === null || _b === void 0 ? void 0 : _b.call(this, error); + throw error; + } + } +} +//# sourceMappingURL=streamableHttp.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/client/streamableHttp.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/streamableHttp.js.map new file mode 100644 index 0000000000..504b5a65ae --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/streamableHttp.js.map @@ -0,0 +1 @@ +{"version":3,"file":"streamableHttp.js","sourceRoot":"","sources":["../../../src/client/streamableHttp.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,iBAAiB,EAAkB,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnI,OAAO,EAAE,IAAI,EAAc,0BAA0B,EAAuB,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACjH,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,8DAA8D;AAC9D,MAAM,4CAA4C,GAAsC;IACtF,wBAAwB,EAAE,IAAI;IAC9B,oBAAoB,EAAE,KAAK;IAC3B,2BAA2B,EAAE,GAAG;IAChC,UAAU,EAAE,CAAC;CACd,CAAC;AAEF,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IAC5C,YACkB,IAAwB,EACxC,OAA2B;QAE3B,KAAK,CAAC,0BAA0B,OAAO,EAAE,CAAC,CAAC;QAH3B,SAAI,GAAJ,IAAI,CAAoB;IAI1C,CAAC;CACF;AA6FD;;;;GAIG;AACH,MAAM,OAAO,6BAA6B;IAaxC,YACE,GAAQ,EACR,IAA2C;;QAE3C,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QAChB,IAAI,CAAC,oBAAoB,GAAG,SAAS,CAAC;QACtC,IAAI,CAAC,YAAY,GAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,WAAW,CAAC;QACtC,IAAI,CAAC,aAAa,GAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,YAAY,CAAC;QACxC,IAAI,CAAC,UA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ACP,MAAM,EAAE,MAAA,IAAI,CAAC,gBAAgB,0CAAE,MAAM;aACtC,CAAC;YAEF,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAE9C,wEAAwE;YACxE,mEAAmE;YACnE,IAAI,CAAC,QAAQ,CAAC,EAAE,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;gBAC5C,MAAM,IAAI,mBAAmB,CAC3B,QAAQ,CAAC,MAAM,EACf,gCAAgC,QAAQ,CAAC,UAAU,EAAE,CACtD,CAAC;YACJ,CAAC;YAED,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC9B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAA,IAAI,CAAC,OAAO,qDAAG,KAAc,CAAC,CAAC;YAC/B,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/client/websocket.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/websocket.d.ts new file mode 100644 index 0000000000..53945e788c --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/websocket.d.ts @@ -0,0 +1,17 @@ +import { Transport } from "../shared/transport.js"; +import { JSONRPCMessage } from "../types.js"; +/** + * Client transport for WebSocket: this will connect to a server over the WebSocket protocol. + */ +export declare class WebSocketClientTransport implements Transport { + private _socket?; + private _url; + onclose?: () => void; + onerror?: (error: Error) => void; + onmessage?: (message: JSONRPCMessage) => void; + constructor(url: URL); + start(): Promise; + close(): Promise; + send(message: JSONRPCMessage): Promise; +} +//# sourceMappingURL=websocket.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/client/websocket.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/websocket.d.ts.map new file mode 100644 index 0000000000..642fd27094 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/websocket.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"websocket.d.ts","sourceRoot":"","sources":["../../../src/client/websocket.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAwB,MAAM,aAAa,CAAC;AAInE;;GAEG;AACH,qBAAa,wBAAyB,YAAW,SAAS;IACxD,OAAO,CAAC,OAAO,CAAC,CAAY;IAC5B,OAAO,CAAC,IAAI,CAAM;IAElB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;gBAElC,GAAG,EAAE,GAAG;IAIpB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAyChB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAI5B,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAW7C"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/client/websocket.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/websocket.js new file mode 100644 index 0000000000..a424f3b569 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/websocket.js @@ -0,0 +1,61 @@ +import { JSONRPCMessageSchema } from "../types.js"; +const SUBPROTOCOL = "mcp"; +/** + * Client transport for WebSocket: this will connect to a server over the WebSocket protocol. + */ +export class WebSocketClientTransport { + constructor(url) { + this._url = url; + } + start() { + if (this._socket) { + throw new Error("WebSocketClientTransport already started! If using Client class, note that connect() calls start() automatically."); + } + return new Promise((resolve, reject) => { + this._socket = new WebSocket(this._url, SUBPROTOCOL); + this._socket.onerror = (event) => { + var _a; + const error = "error" in event + ? event.error + : new Error(`WebSocket error: ${JSON.stringify(event)}`); + reject(error); + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + }; + this._socket.onopen = () => { + resolve(); + }; + this._socket.onclose = () => { + var _a; + (_a = this.onclose) === null || _a === void 0 ? void 0 : _a.call(this); + }; + this._socket.onmessage = (event) => { + var _a, _b; + let message; + try { + message = JSONRPCMessageSchema.parse(JSON.parse(event.data)); + } + catch (error) { + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + return; + } + (_b = this.onmessage) === null || _b === void 0 ? void 0 : _b.call(this, message); + }; + }); + } + async close() { + var _a; + (_a = this._socket) === null || _a === void 0 ? void 0 : _a.close(); + } + send(message) { + return new Promise((resolve, reject) => { + var _a; + if (!this._socket) { + reject(new Error("Not connected")); + return; + } + (_a = this._socket) === null || _a === void 0 ? void 0 : _a.send(JSON.stringify(message)); + resolve(); + }); + } +} +//# sourceMappingURL=websocket.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/client/websocket.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/websocket.js.map new file mode 100644 index 0000000000..81d8506ec5 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/client/websocket.js.map @@ -0,0 +1 @@ +{"version":3,"file":"websocket.js","sourceRoot":"","sources":["../../../src/client/websocket.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnE,MAAM,WAAW,GAAG,KAAK,CAAC;AAE1B;;GAEG;AACH,MAAM,OAAO,wBAAwB;IAQnC,YAAY,GAAQ;QAClB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;IAClB,CAAC;IAED,KAAK;QACH,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CACb,mHAAmH,CACpH,CAAC;QACJ,CAAC;QAED,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,IAAI,CAAC,OAAO,GAAG,IAAI,SAAS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C,OAAO,EAAE,MAAM,EAAE,EAAE;;YACrC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;gBAClB,MAAM,CAAC,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC;gBACnC,OAAO;YACT,CAAC;YAED,MAAA,IAAI,CAAC,OAAO,0CAAE,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;YAC5C,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC,CAAC;IACL,CAAC;CACF"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/multipleClientsParallel.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/multipleClientsParallel.d.ts new file mode 100644 index 0000000000..0ac5af8e56 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/multipleClientsParallel.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=multipleClientsParallel.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/multipleClientsParallel.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/multipleClientsParallel.d.ts.map new file mode 100644 index 0000000000..91051dc946 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/multipleClientsParallel.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"multipleClientsParallel.d.ts","sourceRoot":"","sources":["../../../../src/examples/client/multipleClientsParallel.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/multipleClientsParallel.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/multipleClientsParallel.js new file mode 100644 index 0000000000..1f0d94a254 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/multipleClientsParallel.js @@ -0,0 +1,132 @@ +import { Client } from '../../client/index.js'; +import { StreamableHTTPClientTransport } from '../../client/streamableHttp.js'; +import { CallToolResultSchema, LoggingMessageNotificationSchema, } from '../../types.js'; +/** + * Multiple Clients MCP Example + * + * This client demonstrates how to: + * 1. Create multiple MCP clients in parallel + * 2. Each client calls a single tool + * 3. Track notifications from each client independently + */ +// Command line args processing +const args = process.argv.slice(2); +const serverUrl = args[0] || 'http://localhost:3000/mcp'; +async function createAndRunClient(config) { + console.log(`[${config.id}] Creating client: ${config.name}`); + const client = new Client({ + name: config.name, + version: '1.0.0' + }); + const transport = new StreamableHTTPClientTransport(new URL(serverUrl)); + // Set up client-specific error handler + client.onerror = (error) => { + console.error(`[${config.id}] Client error:`, error); + }; + // Set up client-specific notification handler + client.setNotificationHandler(LoggingMessageNotificationSchema, (notification) => { + console.log(`[${config.id}] Notification: ${notification.params.data}`); + }); + try { + // Connect to the server + await client.connect(transport); + console.log(`[${config.id}] Connected to MCP server`); + // Call the specified tool + console.log(`[${config.id}] Calling tool: ${config.toolName}`); + const toolRequest = { + method: 'tools/call', + params: { + name: config.toolName, + arguments: { + ...config.toolArguments, + // Add client ID to arguments for identification in notifications + caller: config.id + } + } + }; + const result = await client.request(toolRequest, CallToolResultSchema); + console.log(`[${config.id}] Tool call completed`); + // Keep the connection open for a bit to receive notifications + await new Promise(resolve => setTimeout(resolve, 5000)); + // Disconnect + await transport.close(); + console.log(`[${config.id}] Disconnected from MCP server`); + return { id: config.id, result }; + } + catch (error) { + console.error(`[${config.id}] Error:`, error); + throw error; + } +} +async function main() { + console.log('MCP Multiple Clients Example'); + console.log('============================'); + console.log(`Server URL: ${serverUrl}`); + console.log(''); + try { + // Define client configurations + const clientConfigs = [ + { + id: 'client1', + name: 'basic-client-1', + toolName: 'start-notification-stream', + toolArguments: { + interval: 3, // 1 second between notifications + count: 5 // Send 5 notifications + } + }, + { + id: 'client2', + name: 'basic-client-2', + toolName: 'start-notification-stream', + toolArguments: { + interval: 2, // 2 seconds between notifications + count: 3 // Send 3 notifications + } + }, + { + id: 'client3', + name: 'basic-client-3', + toolName: 'start-notification-stream', + toolArguments: { + interval: 1, // 0.5 second between notifications + count: 8 // Send 8 notifications + } + } + ]; + // Start all clients in parallel + console.log(`Starting ${clientConfigs.length} clients in parallel...`); + console.log(''); + const clientPromises = clientConfigs.map(config => createAndRunClient(config)); + const results = await Promise.all(clientPromises); + // Display results from all clients + console.log('\n=== Final Results ==='); + results.forEach(({ id, result }) => { + console.log(`\n[${id}] Tool result:`); + if (Array.isArray(result.content)) { + result.content.forEach((item) => { + if (item.type === 'text' && item.text) { + console.log(` ${item.text}`); + } + else { + console.log(` ${item.type} content:`, item); + } + }); + } + else { + console.log(` Unexpected result format:`, result); + } + }); + console.log('\n=== All clients completed successfully ==='); + } + catch (error) { + console.error('Error running multiple clients:', error); + process.exit(1); + } +} +// Start the example +main().catch((error) => { + console.error('Error running MCP multiple clients example:', error); + process.exit(1); +}); +//# sourceMappingURL=multipleClientsParallel.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/multipleClientsParallel.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/multipleClientsParallel.js.map new file mode 100644 index 0000000000..f48a409da3 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/multipleClientsParallel.js.map @@ -0,0 +1 @@ +{"version":3,"file":"multipleClientsParallel.js","sourceRoot":"","sources":["../../../../src/examples/client/multipleClientsParallel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAEL,oBAAoB,EACpB,gCAAgC,GAEjC,MAAM,gBAAgB,CAAC;AAExB;;;;;;;GAOG;AAEH,+BAA+B;AAC/B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACnC,MAAM,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,2BAA2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CAAC,IAAI,WAAW,EAAE,IAAI,CAAC,CAAC;oBAC/C,CAAC;gBACH,CAAC,CAAC,CAAC;YACL,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,GAAG,CAAC,6BAA6B,EAAE,MAAM,CAAC,CAAC;YACrD,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,CAAC,GAAG,CAAC,8CAA8C,CAAC,CAAC;IAE9D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,iCAAiC,EAAE,KAAK,CAAC,CAAC;QACxD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,oBAAoB;AACpB,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IAC9B,OAAO,CAAC,KAAK,CAAC,6CAA6C,EAAE,KAAK,CAAC,CAAC;IACpE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/parallelToolCallsClient.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/parallelToolCallsClient.d.ts new file mode 100644 index 0000000000..e93d4d69d2 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/parallelToolCallsClient.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=parallelToolCallsClient.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/parallelToolCallsClient.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/parallelToolCallsClient.d.ts.map new file mode 100644 index 0000000000..25a3b820cf --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/parallelToolCallsClient.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"parallelToolCallsClient.d.ts","sourceRoot":"","sources":["../../../../src/examples/client/parallelToolCallsClient.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/parallelToolCallsClient.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/parallelToolCallsClient.js new file mode 100644 index 0000000000..cb3fa0bf63 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/parallelToolCallsClient.js @@ -0,0 +1,173 @@ +import { Client } from '../../client/index.js'; +import { StreamableHTTPClientTransport } from '../../client/streamableHttp.js'; +import { ListToolsResultSchema, CallToolResultSchema, LoggingMessageNotificationSchema, } from '../../types.js'; +/** + * Parallel Tool Calls MCP Client + * + * This client demonstrates how to: + * 1. Start multiple tool calls in parallel + * 2. Track notifications from each tool call using a caller parameter + */ +// Command line args processing +const args = process.argv.slice(2); +const serverUrl = args[0] || 'http://localhost:3000/mcp'; +async function main() { + console.log('MCP Parallel Tool Calls Client'); + console.log('=============================='); + console.log(`Connecting to server at: ${serverUrl}`); + let client; + let transport; + try { + // Create client with streamable HTTP transport + client = new Client({ + name: 'parallel-tool-calls-client', + version: '1.0.0' + }); + client.onerror = (error) => { + console.error('Client error:', error); + }; + // Connect to the server + transport = new StreamableHTTPClientTransport(new URL(serverUrl)); + await client.connect(transport); + console.log('Successfully connected to MCP server'); + // Set up notification handler with caller identification + client.setNotificationHandler(LoggingMessageNotificationSchema, (notification) => { + console.log(`Notification: ${notification.params.data}`); + }); + console.log("List tools"); + const toolsRequest = await listTools(client); + console.log("Tools: ", toolsRequest); + // 2. Start multiple notification tools in parallel + console.log('\n=== Starting Multiple Notification Streams in Parallel ==='); + const toolResults = await startParallelNotificationTools(client); + // Log the results from each tool call + for (const [caller, result] of Object.entries(toolResults)) { + console.log(`\n=== Tool result for ${caller} ===`); + result.content.forEach((item) => { + if (item.type === 'text') { + console.log(` ${item.text}`); + } + else { + console.log(` ${item.type} content:`, item); + } + }); + } + // 3. Wait for all notifications (10 seconds) + console.log('\n=== Waiting for all notifications ==='); + await new Promise(resolve => setTimeout(resolve, 10000)); + // 4. Disconnect + console.log('\n=== Disconnecting ==='); + await transport.close(); + console.log('Disconnected from MCP server'); + } + catch (error) { + console.error('Error running client:', error); + process.exit(1); + } +} +/** + * List available tools on the server + */ +async function listTools(client) { + try { + const toolsRequest = { + method: 'tools/list', + params: {} + }; + const toolsResult = await client.request(toolsRequest, ListToolsResultSchema); + console.log('Available tools:'); + if (toolsResult.tools.length === 0) { + console.log(' No tools available'); + } + else { + for (const tool of toolsResult.tools) { + console.log(` - ${tool.name}: ${tool.description}`); + } + } + } + catch (error) { + console.log(`Tools not supported by this server: ${error}`); + } +} +/** + * Start multiple notification tools in parallel with different configurations + * Each tool call includes a caller parameter to identify its notifications + */ +async function startParallelNotificationTools(client) { + try { + // Define multiple tool calls with different configurations + const toolCalls = [ + { + caller: 'fast-notifier', + request: { + method: 'tools/call', + params: { + name: 'start-notification-stream', + arguments: { + interval: 2, // 0.5 second between notifications + count: 10, // Send 10 notifications + caller: 'fast-notifier' // Identify this tool call + } + } + } + }, + { + caller: 'slow-notifier', + request: { + method: 'tools/call', + params: { + name: 'start-notification-stream', + arguments: { + interval: 5, // 2 seconds between notifications + count: 5, // Send 5 notifications + caller: 'slow-notifier' // Identify this tool call + } + } + } + }, + { + caller: 'burst-notifier', + request: { + method: 'tools/call', + params: { + name: 'start-notification-stream', + arguments: { + interval: 1, // 0.1 second between notifications + count: 3, // Send just 3 notifications + caller: 'burst-notifier' // Identify this tool call + } + } + } + } + ]; + console.log(`Starting ${toolCalls.length} notification tools in parallel...`); + // Start all tool calls in parallel + const toolPromises = toolCalls.map(({ caller, request }) => { + console.log(`Starting tool call for ${caller}...`); + return client.request(request, CallToolResultSchema) + .then(result => ({ caller, result })) + .catch(error => { + console.error(`Error in tool call for ${caller}:`, error); + throw error; + }); + }); + // Wait for all tool calls to complete + const results = await Promise.all(toolPromises); + // Organize results by caller + const resultsByTool = {}; + results.forEach(({ caller, result }) => { + resultsByTool[caller] = result; + }); + return resultsByTool; + } + catch (error) { + console.error(`Error starting parallel notification tools:`, error); + throw error; + } +} +// Start the client +main().catch((error) => { + console.error('Error running MCP client:', error); + process.exit(1); +}); +//# sourceMappingURL=parallelToolCallsClient.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/parallelToolCallsClient.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/parallelToolCallsClient.js.map new file mode 100644 index 0000000000..c5e7f187b7 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/parallelToolCallsClient.js.map @@ -0,0 +1 @@ +{"version":3,"file":"parallelToolCallsClient.js","sourceRoot":"","sources":["../../../../src/examples/client/parallelToolCallsClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAEL,qBAAqB,EACrB,oBAAoB,EACpB,gCAAgC,GAEjC,MAAM,gBAAgB,CAAC;AAExB;;;;;;GAMG;AAEH,+BAA+B;AAC/B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACnC,MAAM,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,2BAA2B,CAAC;AAEzD,KAAK,UAAU,IAAI;IACjB,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;IAC9C,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;IAC9C,OAAO,CAAC,GAAG,CAAC,4BAA4B,SAAS,EAAE,CAAC,CAAC;IAErD,IAAI,MAAc,CAAC;IACnB,IAAI,SAAwC,CAAC;IAE7C,IAAI,CAAC;QACH,+CAA+C;QAC/C,MAAM,GAAG,IAAI,MAAM,CAAC;YAClB,IAAI,EAAE,4BAA4B;YAClC,OAAO,EAAE,OAAO;SACjB,CAAC,CAA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dk/ajv/dist/esm/examples/client/simpleOAuthClient.d.ts new file mode 100644 index 0000000000..e4b43dbc01 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/simpleOAuthClient.d.ts @@ -0,0 +1,3 @@ +#!/usr/bin/env node +export {}; +//# sourceMappingURL=simpleOAuthClient.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/simpleOAuthClient.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/simpleOAuthClient.d.ts.map new file mode 100644 index 0000000000..c09eef86ea --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/simpleOAuthClient.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"simpleOAuthClient.d.ts","sourceRoot":"","sources":["../../../../src/examples/client/simpleOAuthClient.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/simpleOAuthClient.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/simpleOAuthClient.js new file mode 100644 index 0000000000..c60d1f0458 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/simpleOAuthClient.js @@ -0,0 +1,370 @@ +#!/usr/bin/env node +import { createServer } from 'node:http'; +import { createInterface } from 'node:readline'; +import { URL } from 'node:url'; +import { exec } from 'node:child_process'; +import { Client } from '../../client/index.js'; +import { StreamableHTTPClientTransport } from '../../client/streamableHttp.js'; +import { CallToolResultSchema, ListToolsResultSchema } from '../../types.js'; +import { UnauthorizedError } from '../../client/auth.js'; +// Configuration +const DEFAULT_SERVER_URL = 'http://localhost:3000/mcp'; +const CALLBACK_PORT = 8090; // Use different port than auth server (3001) +const CALLBACK_URL = `http://localhost:${CALLBACK_PORT}/callback`; +/** + * In-memory OAuth client provider for demonstration purposes + * In production, you should persist tokens securely + */ +class InMemoryOAuthClientProvider { + constructor(_redirectUrl, _clientMetadata, onRedirect) { + this._redirectUrl = _redirectUrl; + this._clientMetadata = _clientMetadata; + this._onRedirect = onRedirect || ((url) => { + console.log(`Redirect to: ${url.toString()}`); + }); + } + get redirectUrl() { + return this._redirectUrl; + } + get clientMetadata() { + return this._clientMetadata; + } + clientInformation() { + return this._clientInformation; + } + saveClientInformation(clientInformation) { + this._clientInformation = clientInformation; + } + tokens() { + return this._tokens; + } + saveTokens(tokens) { + this._tokens = tokens; + } + redirectToAuthorization(authorizationUrl) { + this._onRedirect(authorizationUrl); + } + saveCodeVerifier(codeVerifier) { + this._codeVerifier = codeVerifier; + } + codeVerifier() { + if (!this._codeVerifier) { + throw new Error('No code verifier saved'); + } + return this._codeVerifier; + } +} +/** + * Interactive MCP client with OAuth authentication + * Demonstrates the complete OAuth flow with browser-based authorization + */ +class InteractiveOAuthClient { + constructor(serverUrl) { + this.serverUrl = serverUrl; + this.client = null; + this.rl = createInterface({ + input: process.stdin, + output: process.stdout, + }); + } + /** + * Prompts user for input via readline + */ + async question(query) { + return new Promise((resolve) => { + this.rl.question(query, resolve); + }); + } + /** + * Opens the authorization URL in the user's default browser + */ + async openBrowser(url) { + console.log(`🌐 Opening browser for authorization: ${url}`); + const command = `open "${url}"`; + exec(command, (error) => { + if (error) { + console.error(`Failed to open browser: ${error.message}`); + console.log(`Please manually open: ${url}`); + } + }); + } + /** + * Example OAuth callback handler - in production, use a more robust approach + * for handling callbacks and storing tokens + */ + /** + * Starts a temporary HTTP server to receive the OAuth callback + */ + async waitForOAuthCallback() { + return new Promise((resolve, reject) => { + const server = createServer((req, res) => { + // Ignore favicon requests + if (req.url === '/favicon.ico') { + res.writeHead(404); + res.end(); + return; + } + console.log(`📥 Received callback: ${req.url}`); + const parsedUrl = new URL(req.url || '', 'http://localhost'); + const code = parsedUrl.searchParams.get('code'); + const error = parsedUrl.searchParams.get('error'); + if (code) { + console.log(`✅ Authorization code received: ${code === null || code === void 0 ? void 0 : code.substring(0, 10)}...`); + res.writeHead(200, { 'Content-Type': 'text/html' }); + res.end(` + + +

Authorization Successful!

+

You can close this window and return to the terminal.

+ + + + `); + resolve(code); + setTimeout(() => server.close(), 3000); + } + else if (error) { + console.log(`❌ Authorization error: ${error}`); + res.writeHead(400, { 'Content-Type': 'text/html' }); + res.end(` + + +

Authorization Failed

+

Error: ${error}

+ + + `); + reject(new Error(`OAuth authorization failed: ${error}`)); + } + else { + console.log(`❌ No authorization code or error in callback`); + res.writeHead(400); + res.end('Bad request'); + reject(new Error('No authorization code provided')); + } + }); + server.listen(CALLBACK_PORT, () => { + console.log(`OAuth callback server started on http://localhost:${CALLBACK_PORT}`); + }); + }); + } + async attemptConnection(oauthProvider) { + console.log('🚢 Creating transport with OAuth provider...'); + const baseUrl = new URL(this.serverUrl); + const transport = new StreamableHTTPClientTransport(baseUrl, { + authProvider: oauthProvider + }); + console.log('🚢 Transport created'); + try { + console.log('🔌 Attempting connection (this will trigger OAuth redirect)...'); + await this.client.connect(transport); + console.log('✅ Connected successfully'); + } + catch (error) { + if (error instanceof UnauthorizedError) { + console.log('🔐 OAuth required - waiting for authorization...'); + const callbackPromise = this.waitForOAuthCallback(); + const authCode = await callbackPromise; + await transport.finishAuth(authCode); + console.log('🔐 Authorization code received:', authCode); + console.log('🔌 Reconnecting with authenticated transport...'); + await this.attemptConnection(oauthProvider); + } + else { + console.error('❌ Connection failed with non-auth error:', error); + throw error; + } + } + } + /** + * Establishes connection to the MCP server with OAuth authentication + */ + async connect() { + console.log(`🔗 Attempting to connect to ${this.serverUrl}...`); + const clientMetadata = { + client_name: 'Simple OAuth MCP Client', + redirect_uris: [CALLBACK_URL], + grant_types: ['authorization_code', 'refresh_token'], + response_types: ['code'], + token_endpoint_auth_method: 'client_secret_post', + scope: 'mcp:tools' + }; + console.log('🔐 Creating OAuth provider...'); + const oauthProvider = new InMemoryOAuthClientProvider(CALLBACK_URL, clientMetadata, (redirectUrl) => { + console.log(`📌 OAuth redirect handler called - opening browser`); + console.log(`Opening browser to: ${redirectUrl.toString()}`); + this.openBrowser(redirectUrl.toString()); + }); + console.log('🔐 OAuth provider created'); + console.log('👤 Creating MCP client...'); + this.client = new Client({ + name: 'simple-oauth-client', + version: '1.0.0', + }, { capabilities: {} }); + console.log('👤 Client created'); + console.log('🔐 Starting OAuth flow...'); + await this.attemptConnection(oauthProvider); + // Start interactive loop + await this.interactiveLoop(); + } + /** + * Main interactive loop for user commands + */ + async interactiveLoop() { + console.log('\n🎯 Interactive MCP Client with OAuth'); + console.log('Commands:'); + console.log(' list - List available tools'); + console.log(' call [args] - Call a tool'); + console.log(' quit - Exit the client'); + console.log(); + while (true) { + try { + const command = await this.question('mcp> '); + if (!command.trim()) { + continue; + } + if (command === 'quit') { + break; + } + else if (command === 'list') { + await this.listTools(); + } + else if (command.startsWith('call ')) { + await this.handleCallTool(command); + } + else { + console.log('❌ Unknown command. Try \'list\', \'call \', or \'quit\''); + } + } + catch (error) { + if (error instanceof Error && error.message === 'SIGINT') { + console.log('\n\n👋 Goodbye!'); + break; + } + console.error('❌ Error:', error); + } + } + } + async listTools() { + if (!this.client) { + console.log('❌ Not connected to server'); + return; + } + try { + const request = { + method: 'tools/list', + params: {}, + }; + const result = await this.client.request(request, ListToolsResultSchema); + if (result.tools && result.tools.length > 0) { + console.log('\n📋 Available tools:'); + result.tools.forEach((tool, index) => { + console.log(`${index + 1}. ${tool.name}`); + if (tool.description) { + console.log(` Description: ${tool.description}`); + } + console.log(); + }); + } + else { + console.log('No tools available'); + } + } + catch (error) { + console.error('❌ Failed to list tools:', error); + } + } + async handleCallTool(command) { + const parts = command.split(/\s+/); + const toolName = parts[1]; + if (!toolName) { + console.log('❌ Please specify a tool name'); + return; + } + // Parse arguments (simple JSON-like format) + let toolArgs = {}; + if (parts.length > 2) { + const argsString = parts.slice(2).join(' '); + try { + toolArgs = JSON.parse(argsString); + } + catch (_a) { + console.log('❌ Invalid arguments format (expected JSON)'); + return; + } + } + await this.callTool(toolName, toolArgs); + } + async callTool(toolName, toolArgs) { + if (!this.client) { + console.log('❌ Not connected to server'); + return; + } + try { + const request = { + method: 'tools/call', + params: { + name: toolName, + arguments: toolArgs, + }, + }; + const result = await this.client.request(request, CallToolResultSchema); + console.log(`\n🔧 Tool '${toolName}' result:`); + if (result.content) { + result.content.forEach((content) => { + if (content.type === 'text') { + console.log(content.text); + } + else { + console.log(content); + } + }); + } + else { + console.log(result); + } + } + catch (error) { + console.error(`❌ Failed to call tool '${toolName}':`, error); + } + } + close() { + this.rl.close(); + if (this.client) { + // Note: Client doesn't have a close method in the current implementation + // This would typically close the transport connection + } + } +} +/** + * Main entry point + */ +async function main() { + const serverUrl = process.env.MCP_SERVER_URL || DEFAULT_SERVER_URL; + console.log('🚀 Simple MCP OAuth Client'); + console.log(`Connecting to: ${serverUrl}`); + console.log(); + const client = new InteractiveOAuthClient(serverUrl); + // Handle graceful shutdown + process.on('SIGINT', () => { + console.log('\n\n👋 Goodbye!'); + client.close(); + process.exit(0); + }); + try { + await client.connect(); + } + catch (error) { + console.error('Failed to start client:', error); + process.exit(1); + } + finally { + client.close(); + } +} +// Run if this file is executed directly +main().catch((error) => { + console.error('Unhandled error:', error); + process.exit(1); +}); +//# sourceMappingURL=simpleOAuthClient.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/simpleOAuthClient.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/simpleOAuthClient.js.map new file mode 100644 index 0000000000..8be55c55b9 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/simpleOAuthClient.js.map @@ -0,0 +1 @@ +{"version":3,"file":"simpleOAuthClient.js","sourceRoot":"","sources":["../../../../src/examples/client/simpleOAuthClient.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAA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kBAAkB,SAAS,EAAE,CAAC,CAAC;IAC3C,OAAO,CAAC,GAAG,EAAE,CAAC;IAEd,MAAM,MAAM,GAAG,IAAI,sBAAsB,CAAC,SAAS,CAAC,CAAC;IAErD,2BAA2B;IAC3B,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;QACxB,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC/B,MAAM,CAAC,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC;IACzB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;QAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;YAAS,CAAC;QACT,MAAM,CAAC,KAAK,EAAE,CAAC;IACjB,CAAC;AACH,CAAC;AAED,wCAAwC;AACxC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;IACzC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/simpleStreamableHttp.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/simpleStreamableHttp.d.ts new file mode 100644 index 0000000000..a20be42ca4 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/simpleStreamableHttp.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=simpleStreamableHttp.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/simpleStreamableHttp.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/simpleStreamableHttp.d.ts.map new file mode 100644 index 0000000000..28406b0c1e --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/simpleStreamableHttp.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"simpleStreamableHttp.d.ts","sourceRoot":"","sources":["../../../../src/examples/client/simpleStreamableHttp.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/simpleStreamableHttp.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/simpleStreamableHttp.js new file mode 100644 index 0000000000..d1642a8fb8 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/simpleStreamableHttp.js @@ -0,0 +1,485 @@ +import { Client } from '../../client/index.js'; +import { StreamableHTTPClientTransport } from '../../client/streamableHttp.js'; +import { createInterface } from 'node:readline'; +import { ListToolsResultSchema, CallToolResultSchema, ListPromptsResultSchema, GetPromptResultSchema, ListResourcesResultSchema, LoggingMessageNotificationSchema, ResourceListChangedNotificationSchema, } from '../../types.js'; +// Create readline interface for user input +const readline = createInterface({ + input: process.stdin, + output: process.stdout +}); +// Track received notifications for debugging resumability +let notificationCount = 0; +// Global client and transport for interactive commands +let client = null; +let transport = null; +let serverUrl = 'http://localhost:3000/mcp'; +let notificationsToolLastEventId = undefined; +let sessionId = undefined; +async function main() { + console.log('MCP Interactive Client'); + console.log('====================='); + // Connect to server immediately with default settings + await connect(); + // Print help and start the command loop + printHelp(); + commandLoop(); +} +function printHelp() { + console.log('\nAvailable commands:'); + console.log(' connect [url] - Connect to MCP server (default: http://localhost:3000/mcp)'); + console.log(' disconnect - Disconnect from server'); + console.log(' terminate-session - Terminate the current session'); + console.log(' reconnect - Reconnect to the server'); + console.log(' list-tools - List available tools'); + console.log(' call-tool [args] - Call a tool with optional JSON arguments'); + console.log(' greet [name] - Call the greet tool'); + console.log(' multi-greet [name] - Call the multi-greet tool with notifications'); + console.log(' start-notifications [interval] [count] - Start periodic notifications'); + console.log(' run-notifications-tool-with-resumability [interval] [count] - Run notification tool with resumability'); + console.log(' list-prompts - List available prompts'); + console.log(' get-prompt [name] [args] - Get a prompt with optional JSON arguments'); + console.log(' list-resources - List available resources'); + console.log(' help - Show this help'); + console.log(' quit - Exit the program'); +} +function commandLoop() { + readline.question('\n> ', async (input) => { + var _a; + const args = input.trim().split(/\s+/); + const command = (_a = args[0]) === null || _a === void 0 ? void 0 : _a.toLowerCase(); + try { + switch (command) { + case 'connect': + await connect(args[1]); + break; + case 'disconnect': + await disconnect(); + break; + case 'terminate-session': + await terminateSession(); + break; + case 'reconnect': + await reconnect(); + break; + case 'list-tools': + await listTools(); + break; + case 'call-tool': + if (args.length < 2) { + console.log('Usage: call-tool [args]'); + } + else { + const toolName = args[1]; + let toolArgs = {}; + if (args.length > 2) { + try { + toolArgs = JSON.parse(args.slice(2).join(' ')); + } + catch (_b) { + console.log('Invalid JSON arguments. Using empty args.'); + } + } + await callTool(toolName, toolArgs); + } + break; + case 'greet': + await callGreetTool(args[1] || 'MCP User'); + break; + case 'multi-greet': + await callMultiGreetTool(args[1] || 'MCP User'); + break; + case 'start-notifications': { + const interval = args[1] ? parseInt(args[1], 10) : 2000; + const count = args[2] ? parseInt(args[2], 10) : 10; + await startNotifications(interval, count); + break; + } + case 'run-notifications-tool-with-resumability': { + const interval = args[1] ? parseInt(args[1], 10) : 2000; + const count = args[2] ? parseInt(args[2], 10) : 10; + await runNotificationsToolWithResumability(interval, count); + break; + } + case 'list-prompts': + await listPrompts(); + break; + case 'get-prompt': + if (args.length < 2) { + console.log('Usage: get-prompt [args]'); + } + else { + const promptName = args[1]; + let promptArgs = {}; + if (args.length > 2) { + try { + promptArgs = JSON.parse(args.slice(2).join(' ')); + } + catch (_c) { + console.log('Invalid JSON arguments. Using empty args.'); + } + } + await getPrompt(promptName, promptArgs); + } + break; + case 'list-resources': + await listResources(); + break; + case 'help': + printHelp(); + break; + case 'quit': + case 'exit': + await cleanup(); + return; + default: + if (command) { + console.log(`Unknown command: ${command}`); + } + break; + } + } + catch (error) { + console.error(`Error executing command: ${error}`); + } + // Continue the command loop + commandLoop(); + }); +} +async function connect(url) { + if (client) { + console.log('Already connected. Disconnect first.'); + return; + } + if (url) { + serverUrl = url; + } + console.log(`Connecting to ${serverUrl}...`); + try { + // Create a new client + client = new Client({ + name: 'example-client', + version: '1.0.0' + }); + client.onerror = (error) => { + console.error('\x1b[31mClient error:', error, '\x1b[0m'); + }; + transport = new StreamableHTTPClientTransport(new URL(serverUrl), { + sessionId: sessionId + }); + // Set up notification handlers + client.setNotificationHandler(LoggingMessageNotificationSchema, (notification) => { + notificationCount++; + console.log(`\nNotification #${notificationCount}: ${notification.params.level} - ${notification.params.data}`); + // Re-display the prompt + process.stdout.write('> '); + }); + client.setNotificationHandler(ResourceListChangedNotificationSchema, async (_) => { + console.log(`\nResource list changed notification received!`); + try { + if (!client) { + console.log('Client disconnected, cannot fetch resources'); + return; + } + const resourcesResult = await client.request({ + method: 'resources/list', + params: {} + }, ListResourcesResultSchema); + console.log('Available resources count:', resourcesResult.resources.length); + } + catch (_a) { + console.log('Failed to list resources after change notification'); + } + // Re-display the prompt + process.stdout.write('> '); + }); + // Connect the client + await client.connect(transport); + sessionId = transport.sessionId; + console.log('Transport created with session ID:', sessionId); + console.log('Connected to MCP server'); + } + catch (error) { + console.error('Failed to connect:', error); + client = null; + transport = null; + } +} +async function disconnect() { + if (!client || !transport) { + console.log('Not connected.'); + return; + } + try { + await transport.close(); + console.log('Disconnected from MCP server'); + client = null; + transport = null; + } + catch (error) { + console.error('Error disconnecting:', error); + } +} +async function terminateSession() { + if (!client || !transport) { + console.log('Not connected.'); + return; + } + try { + console.log('Terminating session with ID:', transport.sessionId); + await transport.terminateSession(); + console.log('Session terminated successfully'); + // Check if sessionId was cleared after termination + if (!transport.sessionId) { + console.log('Session ID has been cleared'); + sessionId = undefined; + // Also close the transport and clear client objects + await transport.close(); + console.log('Transport closed after session termination'); + client = null; + transport = null; + } + else { + console.log('Server responded with 405 Method Not Allowed (session termination not supported)'); + console.log('Session ID is still active:', transport.sessionId); + } + } + catch (error) { + console.error('Error terminating session:', error); + } +} +async function reconnect() { + if (client) { + await disconnect(); + } + await connect(); +} +async function listTools() { + if (!client) { + console.log('Not connected to server.'); + return; + } + try { + const toolsRequest = { + method: 'tools/list', + params: {} + }; + const toolsResult = await client.request(toolsRequest, ListToolsResultSchema); + console.log('Available tools:'); + if (toolsResult.tools.length === 0) { + console.log(' No tools available'); + } + else { + for (const tool of toolsResult.tools) { + console.log(` - ${tool.name}: ${tool.description}`); + } + } + } + catch (error) { + console.log(`Tools not supported by this server (${error})`); + } +} +async function callTool(name, args) { + if (!client) { + console.log('Not connected to server.'); + return; + } + try { + const request = { + method: 'tools/call', + params: { + name, + arguments: args + } + }; + console.log(`Calling tool '${name}' with args:`, args); + const result = await client.request(request, CallToolResultSchema); + console.log('Tool result:'); + result.content.forEach(item => { + if (item.type === 'text') { + console.log(` ${item.text}`); + } + else { + console.log(` ${item.type} content:`, item); + } + }); + } + catch (error) { + console.log(`Error calling tool ${name}: ${error}`); + } +} +async function callGreetTool(name) { + await callTool('greet', { name }); +} +async function callMultiGreetTool(name) { + console.log('Calling multi-greet tool with notifications...'); + await callTool('multi-greet', { name }); +} +async function startNotifications(interval, count) { + console.log(`Starting notification stream: interval=${interval}ms, count=${count || 'unlimited'}`); + await callTool('start-notification-stream', { interval, count }); +} +async function runNotificationsToolWithResumability(interval, count) { + if (!client) { + console.log('Not connected to server.'); + return; + } + try { + console.log(`Starting notification stream with resumability: interval=${interval}ms, count=${count || 'unlimited'}`); + console.log(`Using resumption token: ${notificationsToolLastEventId || 'none'}`); + const request = { + method: 'tools/call', + params: { + name: 'start-notification-stream', + arguments: { interval, count } + } + }; + const onLastEventIdUpdate = (event) => { + notificationsToolLastEventId = event; + console.log(`Updated resumption token: ${event}`); + }; + const result = await client.request(request, CallToolResultSchema, { + resumptionToken: notificationsToolLastEventId, + onresumptiontoken: onLastEventIdUpdate + }); + console.log('Tool result:'); + result.content.forEach(item => { + if (item.type === 'text') { + console.log(` ${item.text}`); + } + else { + console.log(` ${item.type} content:`, item); + } + }); + } + catch (error) { + console.log(`Error starting notification stream: ${error}`); + } +} +async function listPrompts() { + if (!client) { + console.log('Not connected to server.'); + return; + } + try { + const promptsRequest = { + method: 'prompts/list', + params: {} + }; + const promptsResult = await client.request(promptsRequest, ListPromptsResultSchema); + console.log('Available prompts:'); + if (promptsResult.prompts.length === 0) { + console.log(' No prompts available'); + } + else { + for (const prompt of promptsResult.prompts) { + console.log(` - ${prompt.name}: ${prompt.description}`); + } + } + } + catch (error) { + console.log(`Prompts not supported by this server (${error})`); + } +} +async function getPrompt(name, args) { + if (!client) { + console.log('Not connected to server.'); + return; + } + try { + const promptRequest = { + method: 'prompts/get', + params: { + name, + arguments: args + } + }; + const promptResult = await client.request(promptRequest, GetPromptResultSchema); + console.log('Prompt template:'); + promptResult.messages.forEach((msg, index) => { + console.log(` [${index + 1}] ${msg.role}: ${msg.content.text}`); + }); + } + catch (error) { + console.log(`Error getting prompt ${name}: ${error}`); + } +} +async function listResources() { + if (!client) { + console.log('Not connected to server.'); + return; + } + try { + const resourcesRequest = { + method: 'resources/list', + params: {} + }; + const resourcesResult = await client.request(resourcesRequest, ListResourcesResultSchema); + console.log('Available resources:'); + if (resourcesResult.resources.length === 0) { + console.log(' No resources available'); + } + else { + for (const resource of resourcesResult.resources) { + console.log(` - ${resource.name}: ${resource.uri}`); + } + } + } + catch (error) { + console.log(`Resources not supported by this server (${error})`); + } +} +async function cleanup() { + if (client && transport) { + try { + // First try to terminate the session gracefully + if (transport.sessionId) { + try { + console.log('Terminating session before exit...'); + await transport.terminateSession(); + console.log('Session terminated successfully'); + } + catch (error) { + console.error('Error terminating session:', error); + } + } + // Then close the transport + await transport.close(); + } + catch (error) { + console.error('Error closing transport:', error); + } + } + process.stdin.setRawMode(false); + readline.close(); + console.log('\nGoodbye!'); + process.exit(0); +} +// Set up raw mode for keyboard input to capture Escape key +process.stdin.setRawMode(true); +process.stdin.on('data', async (data) => { + // Check for Escape key (27) + if (data.length === 1 && data[0] === 27) { + console.log('\nESC key pressed. Disconnecting from server...'); + // Abort current operation and disconnect from server + if (client && transport) { + await disconnect(); + console.log('Disconnected. Press Enter to continue.'); + } + else { + console.log('Not connected to server.'); + } + // Re-display the prompt + process.stdout.write('> '); + } +}); +// Handle Ctrl+C +process.on('SIGINT', async () => { + console.log('\nReceived SIGINT. Cleaning up...'); + await cleanup(); +}); +// Start the interactive client +main().catch((error) => { + console.error('Error running MCP client:', error); + process.exit(1); +}); +//# sourceMappingURL=simpleStreamableHttp.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/simpleStreamableHttp.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/simpleStreamableHttp.js.map new file mode 100644 index 0000000000..25b985cb53 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/simpleStreamableHttp.js.map @@ -0,0 +1 @@ +{"version":3,"file":"simpleStreamableHttp.js","sourceRoot":"","sources":["../../../../src/examples/client/simpleStreamableHttp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAEL,qBAAqB,EAErB,oBAAoB,EAEpB,uBAAuB,EAEvB,qBAAqB,EAErB,yBAAyB,EACzB,gCAAgC,EAChC,qCAAqC,GACtC,MAAM,gBAAgB,CAAC;AAExB,2CAA2C;AAC3C,MAAM,QAAQ,GAAG,eAAe,CAAC;IAC/B,KAAK,EAAE,OAAO,CAAC,KAAK;IACpB,MAAM,EAAE,OAAO,CAAC,MAAM;CACvB,CAAC,CAAC;AAEH,0DAA0D;AA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AAC;QAC1C,CAAC;QAED,wBAAwB;QACxB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,gBAAgB;AAChB,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;IAC9B,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;IACjD,MAAM,OAAO,EAAE,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,+BAA+B;AAC/B,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IAC9B,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;IAClD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/streamableHttpWithSseFallbackClient.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/streamableHttpWithSseFallbackClient.d.ts new file mode 100644 index 0000000000..c2679e6694 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/streamableHttpWithSseFallbackClient.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=streamableHttpWithSseFallbackClient.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/streamableHttpWithSseFallbackClient.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/streamableHttpWithSseFallbackClient.d.ts.map new file mode 100644 index 0000000000..b79ae2a72c --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/streamableHttpWithSseFallbackClient.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"streamableHttpWithSseFallbackClient.d.ts","sourceRoot":"","sources":["../../../../src/examples/client/streamableHttpWithSseFallbackClient.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/streamableHttpWithSseFallbackClient.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/streamableHttpWithSseFallbackClient.js new file mode 100644 index 0000000000..d73a534582 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/streamableHttpWithSseFallbackClient.js @@ -0,0 +1,166 @@ +import { Client } from '../../client/index.js'; +import { StreamableHTTPClientTransport } from '../../client/streamableHttp.js'; +import { SSEClientTransport } from '../../client/sse.js'; +import { ListToolsResultSchema, CallToolResultSchema, LoggingMessageNotificationSchema, } from '../../types.js'; +/** + * Simplified Backwards Compatible MCP Client + * + * This client demonstrates backward compatibility with both: + * 1. Modern servers using Streamable HTTP transport (protocol version 2025-03-26) + * 2. Older servers using HTTP+SSE transport (protocol version 2024-11-05) + * + * Following the MCP specification for backwards compatibility: + * - Attempts to POST an initialize request to the server URL first (modern transport) + * - If that fails with 4xx status, falls back to GET request for SSE stream (older transport) + */ +// Command line args processing +const args = process.argv.slice(2); +const serverUrl = args[0] || 'http://localhost:3000/mcp'; +async function main() { + console.log('MCP Backwards Compatible Client'); + console.log('==============================='); + console.log(`Connecting to server at: ${serverUrl}`); + let client; + let transport; + try { + // Try connecting with automatic transport detection + const connection = await connectWithBackwardsCompatibility(serverUrl); + client = connection.client; + transport = connection.transport; + // Set up notification handler + client.setNotificationHandler(LoggingMessageNotificationSchema, (notification) => { + console.log(`Notification: ${notification.params.level} - ${notification.params.data}`); + }); + // DEMO WORKFLOW: + // 1. List available tools + console.log('\n=== Listing Available Tools ==='); + await listTools(client); + // 2. Call the notification tool + console.log('\n=== Starting Notification Stream ==='); + await startNotificationTool(client); + // 3. Wait for all notifications (5 seconds) + console.log('\n=== Waiting for all notifications ==='); + await new Promise(resolve => setTimeout(resolve, 5000)); + // 4. Disconnect + console.log('\n=== Disconnecting ==='); + await transport.close(); + console.log('Disconnected from MCP server'); + } + catch (error) { + console.error('Error running client:', error); + process.exit(1); + } +} +/** + * Connect to an MCP server with backwards compatibility + * Following the spec for client backward compatibility + */ +async function connectWithBackwardsCompatibility(url) { + console.log('1. Trying Streamable HTTP transport first...'); + // Step 1: Try Streamable HTTP transport first + const client = new Client({ + name: 'backwards-compatible-client', + version: '1.0.0' + }); + client.onerror = (error) => { + console.error('Client error:', error); + }; + const baseUrl = new URL(url); + try { + // Create modern transport + const streamableTransport = new StreamableHTTPClientTransport(baseUrl); + await client.connect(streamableTransport); + console.log('Successfully connected using modern Streamable HTTP transport.'); + return { + client, + transport: streamableTransport, + transportType: 'streamable-http' + }; + } + catch (error) { + // Step 2: If transport fails, try the older SSE transport + console.log(`StreamableHttp transport connection failed: ${error}`); + console.log('2. Falling back to deprecated HTTP+SSE transport...'); + try { + // Create SSE transport pointing to /sse endpoint + const sseTransport = new SSEClientTransport(baseUrl); + const sseClient = new Client({ + name: 'backwards-compatible-client', + version: '1.0.0' + }); + await sseClient.connect(sseTransport); + console.log('Successfully connected using deprecated HTTP+SSE transport.'); + return { + client: sseClient, + transport: sseTransport, + transportType: 'sse' + }; + } + catch (sseError) { + console.error(`Failed to connect with either transport method:\n1. Streamable HTTP error: ${error}\n2. SSE error: ${sseError}`); + throw new Error('Could not connect to server with any available transport'); + } + } +} +/** + * List available tools on the server + */ +async function listTools(client) { + try { + const toolsRequest = { + method: 'tools/list', + params: {} + }; + const toolsResult = await client.request(toolsRequest, ListToolsResultSchema); + console.log('Available tools:'); + if (toolsResult.tools.length === 0) { + console.log(' No tools available'); + } + else { + for (const tool of toolsResult.tools) { + console.log(` - ${tool.name}: ${tool.description}`); + } + } + } + catch (error) { + console.log(`Tools not supported by this server: ${error}`); + } +} +/** + * Start a notification stream by calling the notification tool + */ +async function startNotificationTool(client) { + try { + // Call the notification tool using reasonable defaults + const request = { + method: 'tools/call', + params: { + name: 'start-notification-stream', + arguments: { + interval: 1000, // 1 second between notifications + count: 5 // Send 5 notifications + } + } + }; + console.log('Calling notification tool...'); + const result = await client.request(request, CallToolResultSchema); + console.log('Tool result:'); + result.content.forEach(item => { + if (item.type === 'text') { + console.log(` ${item.text}`); + } + else { + console.log(` ${item.type} content:`, item); + } + }); + } + catch (error) { + console.log(`Error calling notification tool: ${error}`); + } +} +// Start the client +main().catch((error) => { + console.error('Error running MCP client:', error); + process.exit(1); +}); +//# sourceMappingURL=streamableHttpWithSseFallbackClient.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/streamableHttpWithSseFallbackClient.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/streamableHttpWithSseFallbackClient.js.map new file mode 100644 index 0000000000..6b15d21dce --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/client/streamableHttpWithSseFallbackClient.js.map @@ -0,0 +1 @@ +{"version":3,"file":"streamableHttpWithSseFallbackClient.js","sourceRoot":"","sources":["../../../../src/examples/client/streamableHttpWithSseFallbackClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAEL,qBAAqB,EAErB,oBAAoB,EACpB,gCAAgC,GACjC,MAAM,gBAAgB,CAAC;AAExB;;;;;;;;;;GAUG;AAEH,+BAA+B;AAC/B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACnC,MAAM,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,2BAA2B,CAAC;AAEzD,KAAK,UAAU,IAAI;IACjB,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;IAC/C,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;IAC/C,OAAO,CAAC,GAAG,CAAC,4BAA4B,SAAS,EAAE,CAAC,CAAC;IAErD,IAAI,MA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AuB;iBACvC;aACF;SACF,CAAC;QAEF,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;QAC5C,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC;QAEnE,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAC5B,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YAC5B,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;gBACzB,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;YAChC,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,IAAI,WAAW,EAAE,IAAI,CAAC,CAAC;YAC/C,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,GAAG,CAAC,oCAAoC,KAAK,EAAE,CAAC,CAAC;IAC3D,CAAC;AACH,CAAC;AAED,mBAAmB;AACnB,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IAC9B,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;IAClD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/demoInMemoryOAuthProvider.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/demoInMemoryOAuthProvider.d.ts new file mode 100644 index 0000000000..80364629ed --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/demoInMemoryOAuthProvider.d.ts @@ -0,0 +1,70 @@ +import { AuthorizationParams, OAuthServerProvider } from '../../server/auth/provider.js'; +import { OAuthRegisteredClientsStore } from '../../server/auth/clients.js'; +import { OAuthClientInformationFull, OAuthMetadata, OAuthTokens } from 'src/shared/auth.js'; +import { Response } from "express"; +import { AuthInfo } from 'src/server/auth/types.js'; +export declare class DemoInMemoryClientsStore implements OAuthRegisteredClientsStore { + private clients; + getClient(clientId: string): Promise<{ + redirect_uris: string[]; + client_id: string; + jwks_uri?: string | undefined; + scope?: string | undefined; + token_endpoint_auth_method?: string | undefined; + grant_types?: string[] | undefined; + response_types?: string[] | undefined; + client_name?: string | undefined; + client_uri?: string | undefined; + logo_uri?: string | undefined; + contacts?: string[] | undefined; + tos_uri?: string | undefined; + policy_uri?: string | undefined; + jwks?: any; + software_id?: string | undefined; + software_version?: string | undefined; + client_secret?: string | undefined; + client_id_issued_at?: number | undefined; + client_secret_expires_at?: number | undefined; + } | undefined>; + registerClient(clientMetadata: OAuthClientInformationFull): Promise<{ + redirect_uris: string[]; + client_id: string; + jwks_uri?: string | undefined; + scope?: string | undefined; + token_endpoint_auth_method?: string | undefined; + grant_types?: string[] | undefined; + response_types?: string[] | undefined; + client_name?: string | undefined; + client_uri?: string | undefined; + logo_uri?: string | undefined; + contacts?: string[] | undefined; + tos_uri?: string | undefined; + policy_uri?: string | undefined; + jwks?: any; + software_id?: string | undefined; + software_version?: string | undefined; + client_secret?: string | undefined; + client_id_issued_at?: number | undefined; + client_secret_expires_at?: number | undefined; + }>; +} +/** + * 🚨 DEMO ONLY - NOT FOR PRODUCTION + * + * This example demonstrates MCP OAuth flow but lacks some of the features required for production use, + * for example: + * - Persistent token storage + * - Rate limiting + */ +export declare class DemoInMemoryAuthProvider implements OAuthServerProvider { + clientsStore: DemoInMemoryClientsStore; + private codes; + private tokens; + authorize(client: OAuthClientInformationFull, params: AuthorizationParams, res: Response): Promise; + challengeForAuthorizationCode(client: OAuthClientInformationFull, authorizationCode: string): Promise; + exchangeAuthorizationCode(client: OAuthClientInformationFull, authorizationCode: string, _codeVerifier?: string): Promise; + exchangeRefreshToken(_client: OAuthClientInformationFull, _refreshToken: string, _scopes?: string[]): Promise; + verifyAccessToken(token: string): Promise; +} +export declare const setupAuthServer: (authServerUrl: URL) => OAuthMetadata; +//# sourceMappingURL=demoInMemoryOAuthProvider.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/demoInMemoryOAuthProvider.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/demoInMemoryOAuthProvider.d.ts.map new file mode 100644 index 0000000000..af1206a81e --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/demoInMemoryOAuthProvider.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"demoInMemoryOAuthProvider.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/demoInMemoryOAuthProvider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EAAE,0BAA0B,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC5F,OAAgB,EAAW,QAAQ,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIpD,qBAAa,wBAAyB,YAAW,2BAA2B;IAC1E,OAAO,CAAC,OAAO,CAAiD;IAE1D,SAAS,CAAC,QAAQ,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;IAI1B,cAAc,CAAC,cAAc,EAAE,0BAA0B;;;;;;;;;;;;;;;;;;;;;CAIhE;AAED;;;;;;;GAOG;AACH,qBAAa,wBAAyB,YAAW,mBAAmB;IAClE,YAAY,2BAAkC;IAC9C,OAAO,CAAC,KAAK,CAE4B;IACzC,OAAO,CAAC,MAAM,CAA+B;IAEvC,SAAS,CACb,MAAM,EAAE,0BAA0B,EAClC,MAAM,EAAE,mBAAmB,EAC3B,GAAG,EAAE,QAAQ,GACZ,OAAO,CAAC,IAAI,CAAC;IAoBV,6BAA6B,CACjC,MAAM,EAAE,0BAA0B,EAClC,iBAAiB,EAAE,MAAM,GACxB,OAAO,CAAC,MAAM,CAAC;IAWZ,yBAAyB,CAC7B,MAAM,EAAE,0BAA0B,EAClC,iBAAiB,EAAE,MAAM,EAGzB,aAAa,CAAC,EAAE,MAAM,GACrB,OAAO,CAAC,WAAW,CAAC;IA+BjB,oBAAoB,CACxB,OAAO,EAAE,0BAA0B,EACnC,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,MAAM,EAAE,GACjB,OAAO,CAAC,WAAW,CAAC;IAIjB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;CAa1D;AAGD,eAAO,MAAM,eAAe,kBAAmB,GAAG,KAAG,aA+DpD,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/demoInMemoryOAuthProvider.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/demoInMemoryOAuthProvider.js new file mode 100644 index 0000000000..64cb1ca992 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/demoInMemoryOAuthProvider.js @@ -0,0 +1,156 @@ +import { randomUUID } from 'node:crypto'; +import express from "express"; +import { createOAuthMetadata, mcpAuthRouter } from 'src/server/auth/router.js'; +export class DemoInMemoryClientsStore { + constructor() { + this.clients = new Map(); + } + async getClient(clientId) { + return this.clients.get(clientId); + } + async registerClient(clientMetadata) { + this.clients.set(clientMetadata.client_id, clientMetadata); + return clientMetadata; + } +} +/** + * 🚨 DEMO ONLY - NOT FOR PRODUCTION + * + * This example demonstrates MCP OAuth flow but lacks some of the features required for production use, + * for example: + * - Persistent token storage + * - Rate limiting + */ +export class DemoInMemoryAuthProvider { + constructor() { + this.clientsStore = new DemoInMemoryClientsStore(); + this.codes = new Map(); + this.tokens = new Map(); + } + async authorize(client, params, res) { + const code = randomUUID(); + const searchParams = new URLSearchParams({ + code, + }); + if (params.state !== undefined) { + searchParams.set('state', params.state); + } + this.codes.set(code, { + client, + params + }); + const targetUrl = new URL(client.redirect_uris[0]); + targetUrl.search = searchParams.toString(); + res.redirect(targetUrl.toString()); + } + async challengeForAuthorizationCode(client, authorizationCode) { + // Store the challenge with the code data + const codeData = this.codes.get(authorizationCode); + if (!codeData) { + throw new Error('Invalid authorization code'); + } + return codeData.params.codeChallenge; + } + async exchangeAuthorizationCode(client, authorizationCode, + // Note: code verifier is checked in token.ts by default + // it's unused here for that reason. + _codeVerifier) { + const codeData = this.codes.get(authorizationCode); + if (!codeData) { + throw new Error('Invalid authorization code'); + } + if (codeData.client.client_id !== client.client_id) { + throw new Error(`Authorization code was not issued to this client, ${codeData.client.client_id} != ${client.client_id}`); + } + this.codes.delete(authorizationCode); + const token = randomUUID(); + const tokenData = { + token, + clientId: client.client_id, + scopes: codeData.params.scopes || [], + expiresAt: Date.now() + 3600000, // 1 hour + type: 'access' + }; + this.tokens.set(token, tokenData); + return { + access_token: token, + token_type: 'bearer', + expires_in: 3600, + scope: (codeData.params.scopes || []).join(' '), + }; + } + async exchangeRefreshToken(_client, _refreshToken, _scopes) { + throw new Error('Not implemented for example demo'); + } + async verifyAccessToken(token) { + const tokenData = this.tokens.get(token); + if (!tokenData || !tokenData.expiresAt || tokenData.expiresAt < Date.now()) { + throw new Error('Invalid or expired token'); + } + return { + token, + clientId: tokenData.clientId, + scopes: tokenData.scopes, + expiresAt: Math.floor(tokenData.expiresAt / 1000), + }; + } +} +export const setupAuthServer = (authServerUrl) => { + // Create separate auth server app + // NOTE: This is a separate app on a separate port to illustrate + // how to separate an OAuth Authorization Server from a Resource + // server in the SDK. The SDK is not intended to be provide a standalone + // authorization server. + const provider = new DemoInMemoryAuthProvider(); + const authApp = express(); + authApp.use(express.json()); + // For introspection requests + authApp.use(express.urlencoded()); + // Add OAuth routes to the auth server + // NOTE: this will also add a protected resource metadata route, + // but it won't be used, so leave it. + authApp.use(mcpAuthRouter({ + provider, + issuerUrl: authServerUrl, + scopesSupported: ['mcp:tools'], + })); + authApp.post('/introspect', async (req, res) => { + try { + const { token } = req.body; + if (!token) { + res.status(400).json({ error: 'Token is required' }); + return; + } + const tokenInfo = await provider.verifyAccessToken(token); + res.json({ + active: true, + client_id: tokenInfo.clientId, + scope: tokenInfo.scopes.join(' '), + exp: tokenInfo.expiresAt + }); + return; + } + catch (error) { + res.status(401).json({ + active: false, + error: 'Unauthorized', + error_description: `Invalid token: ${error}` + }); + } + }); + const auth_port = authServerUrl.port; + // Start the auth server + authApp.listen(auth_port, () => { + console.log(`OAuth Authorization Server listening on port ${auth_port}`); + }); + // Note: we could fetch this from the server, but then we end up + // with some top level async which gets annoying. + const oauthMetadata = createOAuthMetadata({ + provider, + issuerUrl: authServerUrl, + scopesSupported: ['mcp:tools'], + }); + oauthMetadata.introspection_endpoint = new URL("/introspect", authServerUrl).href; + return oauthMetadata; +}; +//# sourceMappingURL=demoInMemoryOAuthProvider.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/demoInMemoryOAuthProvider.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/demoInMemoryOAuthProvider.js.map new file mode 100644 index 0000000000..4736690b93 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/demoInMemoryOAuthProvider.js.map @@ -0,0 +1 @@ +{"version":3,"file":"demoInMemoryOAuthProvider.js","sourceRoot":"","sources":["../../../../src/examples/server/demoInMemoryOAuthProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAIzC,OAAO,OAA8B,MAAM,SAAS,CAAC;AAErD,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAG/E,MAAM,OAAO,wBAAwB;IAArC;QACU,YAAO,GAAG,IAAI,GAAG,EAAsC,CAAC;IAUlE,CAAC;IARC,KAAK,CAAC,SAAS,CAAC,QAAgB;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,CAAA;IAEF,aAAa,CAAC,sBAAsB,GAAG,IAAI,GAAG,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC,IAAI,CAAC;IAElF,OAAO,aAAa,CAAC;AACvB,CAAC,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/jsonResponseStreamableHttp.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/jsonResponseStreamableHttp.d.ts new file mode 100644 index 0000000000..477fa6bae7 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/jsonResponseStreamableHttp.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=jsonResponseStreamableHttp.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/jsonResponseStreamableHttp.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/jsonResponseStreamableHttp.d.ts.map new file mode 100644 index 0000000000..ee8117ee2e --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/jsonResponseStreamableHttp.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"jsonResponseStreamableHttp.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/jsonResponseStreamableHttp.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/jsonResponseStreamableHttp.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/jsonResponseStreamableHttp.js new file mode 100644 index 0000000000..23093bb099 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/jsonResponseStreamableHttp.js @@ -0,0 +1,137 @@ +import express from 'express'; +import { randomUUID } from 'node:crypto'; +import { McpServer } from '../../server/mcp.js'; +import { StreamableHTTPServerTransport } from '../../server/streamableHttp.js'; +import { z } from 'zod'; +import { isInitializeRequest } from '../../types.js'; +// Create an MCP server with implementation details +const getServer = () => { + const server = new McpServer({ + name: 'json-response-streamable-http-server', + version: '1.0.0', + }, { + capabilities: { + logging: {}, + } + }); + // Register a simple tool that returns a greeting + server.tool('greet', 'A simple greeting tool', { + name: z.string().describe('Name to greet'), + }, async ({ name }) => { + return { + content: [ + { + type: 'text', + text: `Hello, ${name}!`, + }, + ], + }; + }); + // Register a tool that sends multiple greetings with notifications + server.tool('multi-greet', 'A tool that sends different greetings with delays between them', { + name: z.string().describe('Name to greet'), + }, async ({ name }, { sendNotification }) => { + const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)); + await sendNotification({ + method: "notifications/message", + params: { level: "debug", data: `Starting multi-greet for ${name}` } + }); + await sleep(1000); // Wait 1 second before first greeting + await sendNotification({ + method: "notifications/message", + params: { level: "info", data: `Sending first greeting to ${name}` } + }); + await sleep(1000); // Wait another second before second greeting + await sendNotification({ + method: "notifications/message", + params: { level: "info", data: `Sending second greeting to ${name}` } + }); + return { + content: [ + { + type: 'text', + text: `Good morning, ${name}!`, + } + ], + }; + }); + return server; +}; +const app = express(); +app.use(express.json()); +// Map to store transports by session ID +const transports = {}; +app.post('/mcp', async (req, res) => { + console.log('Received MCP request:', req.body); + try { + // Check for existing session ID + const sessionId = req.headers['mcp-session-id']; + let transport; + if (sessionId && transports[sessionId]) { + // Reuse existing transport + transport = transports[sessionId]; + } + else if (!sessionId && isInitializeRequest(req.body)) { + // New initialization request - use JSON response mode + transport = new StreamableHTTPServerTransport({ + sessionIdGenerator: () => randomUUID(), + enableJsonResponse: true, // Enable JSON response mode + onsessioninitialized: (sessionId) => { + // Store the transport by session ID when session is initialized + // This avoids race conditions where requests might come in before the session is stored + console.log(`Session initialized with ID: ${sessionId}`); + transports[sessionId] = transport; + } + }); + // Connect the transport to the MCP server BEFORE handling the request + const server = getServer(); + await server.connect(transport); + await transport.handleRequest(req, res, req.body); + return; // Already handled + } + else { + // Invalid request - no session ID or not initialization request + res.status(400).json({ + jsonrpc: '2.0', + error: { + code: -32000, + message: 'Bad Request: No valid session ID provided', + }, + id: null, + }); + return; + } + // Handle the request with existing transport - no need to reconnect + await transport.handleRequest(req, res, req.body); + } + catch (error) { + console.error('Error handling MCP request:', error); + if (!res.headersSent) { + res.status(500).json({ + jsonrpc: '2.0', + error: { + code: -32603, + message: 'Internal server error', + }, + id: null, + }); + } + } +}); +// Handle GET requests for SSE streams according to spec +app.get('/mcp', async (req, res) => { + // Since this is a very simple example, we don't support GET requests for this server + // The spec requires returning 405 Method Not Allowed in this case + res.status(405).set('Allow', 'POST').send('Method Not Allowed'); +}); +// Start the server +const PORT = 3000; +app.listen(PORT, () => { + console.log(`MCP Streamable HTTP Server listening on port ${PORT}`); +}); +// Handle server shutdown +process.on('SIGINT', async () => { + console.log('Shutting down server...'); + process.exit(0); +}); +//# sourceMappingURL=jsonResponseStreamableHttp.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/jsonResponseStreamableHttp.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/jsonResponseStreamableHttp.js.map new file mode 100644 index 0000000000..81eba72a7b --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/jsonResponseStreamableHttp.js.map @@ -0,0 +1 @@ +{"version":3,"file":"jsonResponseStreamableHttp.js","sourceRoot":"","sources":["../../../../src/examples/server/jsonResponseStreamableHttp.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAkB,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAGrE,mDAAmD;AACnD,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC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AC,MAAM,EAAE,KAAK,EAAE,GAAY,EAAE,GAAa,EAAE,EAAE;IACpD,qFAAqF;IACrF,kEAAkE;IAClE,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;AAClE,CAAC,CAAC,CAAC;AAEH,mBAAmB;AACnB,MAAM,IAAI,GAAG,IAAI,CAAC;AAClB,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE;IACpB,OAAO,CAAC,GAAG,CAAC,gDAAgD,IAAI,EAAE,CAAC,CAAC;AACtE,CAAC,CAAC,CAAC;AAEH,yBAAyB;AACzB,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;IAC9B,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;IACvC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/mcpServerOutputSchema.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/mcpServerOutputSchema.d.ts new file mode 100644 index 0000000000..a6cb497473 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/mcpServerOutputSchema.d.ts @@ -0,0 +1,7 @@ +#!/usr/bin/env node +/** + * Example MCP server using the high-level McpServer API with outputSchema + * This demonstrates how to easily create tools with structured output + */ +export {}; +//# sourceMappingURL=mcpServerOutputSchema.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/mcpServerOutputSchema.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/mcpServerOutputSchema.d.ts.map new file mode 100644 index 0000000000..bd3abdcc26 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/mcpServerOutputSchema.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"mcpServerOutputSchema.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/mcpServerOutputSchema.ts"],"names":[],"mappings":";AACA;;;GAGG"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/mcpServerOutputSchema.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/mcpServerOutputSchema.js new file mode 100644 index 0000000000..afae6560d6 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/mcpServerOutputSchema.js @@ -0,0 +1,68 @@ +#!/usr/bin/env node +/** + * Example MCP server using the high-level McpServer API with outputSchema + * This demonstrates how to easily create tools with structured output + */ +import { McpServer } from "../../server/mcp.js"; +import { StdioServerTransport } from "../../server/stdio.js"; +import { z } from "zod"; +const server = new McpServer({ + name: "mcp-output-schema-high-level-example", + version: "1.0.0", +}); +// Define a tool with structured output - Weather data +server.registerTool("get_weather", { + description: "Get weather information for a city", + inputSchema: { + city: z.string().describe("City name"), + country: z.string().describe("Country code (e.g., US, UK)") + }, + outputSchema: { + temperature: z.object({ + celsius: z.number(), + fahrenheit: z.number() + }), + conditions: z.enum(["sunny", "cloudy", "rainy", "stormy", "snowy"]), + humidity: z.number().min(0).max(100), + wind: z.object({ + speed_kmh: z.number(), + direction: z.string() + }) + }, +}, async ({ city, country }) => { + // Parameters are available but not used in this example + void city; + void country; + // Simulate weather API call + const temp_c = Math.round((Math.random() * 35 - 5) * 10) / 10; + const conditions = ["sunny", "cloudy", "rainy", "stormy", "snowy"][Math.floor(Math.random() * 5)]; + const structuredContent = { + temperature: { + celsius: temp_c, + fahrenheit: Math.round((temp_c * 9 / 5 + 32) * 10) / 10 + }, + conditions, + humidity: Math.round(Math.random() * 100), + wind: { + speed_kmh: Math.round(Math.random() * 50), + direction: ["N", "NE", "E", "SE", "S", "SW", "W", "NW"][Math.floor(Math.random() * 8)] + } + }; + return { + content: [{ + type: "text", + text: JSON.stringify(structuredContent, null, 2) + }], + structuredContent + }; +}); +async function main() { + const transport = new StdioServerTransport(); + await server.connect(transport); + console.error("High-level Output Schema Example Server running on stdio"); +} +main().catch((error) => { + console.error("Server error:", error); + process.exit(1); +}); +//# sourceMappingURL=mcpServerOutputSchema.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/mcpServerOutputSchema.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/mcpServerOutputSchema.js.map new file mode 100644 index 0000000000..054f4552d9 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/mcpServerOutputSchema.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mcpServerOutputSchema.js","sourceRoot":"","sources":["../../../../src/examples/server/mcpServerOutputSchema.ts"],"names":[],"mappings":";AACA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,MAAM,GAAG,IAAI,SAAS,CAC1B;IACE,IAAI,EAAE,sCAAsC;IAC5C,OAAO,EAAE,OAAO;CACjB,CACF,CAAC;AAEF,sDAAsD;AACtD,MAAM,CAAC,YAAY,CACjB,aAAa,EACb;IACE,WAAW,EAAE,oCAAoC;IACjD,WAAW,EAAE;QACX,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC;QACtC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;KAC5D;IACD,YAAY,EAAE;QACZ,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACpB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;YACnB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;SACvB,CAAC;QACF,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,CAA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AE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;SACvF;KACF,CAAC;IAEF,OAAO;QACL,OAAO,EAAE,CAAC;gBACR,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC;aACjD,CAAC;QACF,iBAAiB;KAClB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,0DAA0D,CAAC,CAAC;AAC5E,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;IACtC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleSseServer.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleSseServer.d.ts new file mode 100644 index 0000000000..4269b7814f --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleSseServer.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=simpleSseServer.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleSseServer.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleSseServer.d.ts.map new file mode 100644 index 0000000000..08a1b45021 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleSseServer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"simpleSseServer.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/simpleSseServer.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleSseServer.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleSseServer.js new file mode 100644 index 0000000000..c54393cf15 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleSseServer.js @@ -0,0 +1,143 @@ +import express from 'express'; +import { McpServer } from '../../server/mcp.js'; +import { SSEServerTransport } from '../../server/sse.js'; +import { z } from 'zod'; +/** + * This example server demonstrates the deprecated HTTP+SSE transport + * (protocol version 2024-11-05). It mainly used for testing backward compatible clients. + * + * The server exposes two endpoints: + * - /mcp: For establishing the SSE stream (GET) + * - /messages: For receiving client messages (POST) + * + */ +// Create an MCP server instance +const getServer = () => { + const server = new McpServer({ + name: 'simple-sse-server', + version: '1.0.0', + }, { capabilities: { logging: {} } }); + server.tool('start-notification-stream', 'Starts sending periodic notifications', { + interval: z.number().describe('Interval in milliseconds between notifications').default(1000), + count: z.number().describe('Number of notifications to send').default(10), + }, async ({ interval, count }, { sendNotification }) => { + const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)); + let counter = 0; + // Send the initial notification + await sendNotification({ + method: "notifications/message", + params: { + level: "info", + data: `Starting notification stream with ${count} messages every ${interval}ms` + } + }); + // Send periodic notifications + while (counter < count) { + counter++; + await sleep(interval); + try { + await sendNotification({ + method: "notifications/message", + params: { + level: "info", + data: `Notification #${counter} at ${new Date().toISOString()}` + } + }); + } + catch (error) { + console.error("Error sending notification:", error); + } + } + return { + content: [ + { + type: 'text', + text: `Completed sending ${count} notifications every ${interval}ms`, + } + ], + }; + }); + return server; +}; +const app = express(); +app.use(express.json()); +// Store transports by session ID +const transports = {}; +// SSE endpoint for establishing the stream +app.get('/mcp', async (req, res) => { + console.log('Received GET request to /sse (establishing SSE stream)'); + try { + // Create a new SSE transport for the client + // The endpoint for POST messages is '/messages' + const transport = new SSEServerTransport('/messages', res); + // Store the transport by session ID + const sessionId = transport.sessionId; + transports[sessionId] = transport; + // Set up onclose handler to clean up transport when closed + transport.onclose = () => { + console.log(`SSE transport closed for session ${sessionId}`); + delete transports[sessionId]; + }; + // Connect the transport to the MCP server + const server = getServer(); + await server.connect(transport); + console.log(`Established SSE stream with session ID: ${sessionId}`); + } + catch (error) { + console.error('Error establishing SSE stream:', error); + if (!res.headersSent) { + res.status(500).send('Error establishing SSE stream'); + } + } +}); +// Messages endpoint for receiving client JSON-RPC requests +app.post('/messages', async (req, res) => { + console.log('Received POST request to /messages'); + // Extract session ID from URL query parameter + // In the SSE protocol, this is added by the client based on the endpoint event + const sessionId = req.query.sessionId; + if (!sessionId) { + console.error('No session ID provided in request URL'); + res.status(400).send('Missing sessionId parameter'); + return; + } + const transport = transports[sessionId]; + if (!transport) { + console.error(`No active transport found for session ID: ${sessionId}`); + res.status(404).send('Session not found'); + return; + } + try { + // Handle the POST message with the transport + await transport.handlePostMessage(req, res, req.body); + } + catch (error) { + console.error('Error handling request:', error); + if (!res.headersSent) { + res.status(500).send('Error handling request'); + } + } +}); +// Start the server +const PORT = 3000; +app.listen(PORT, () => { + console.log(`Simple SSE Server (deprecated protocol version 2024-11-05) listening on port ${PORT}`); +}); +// Handle server shutdown +process.on('SIGINT', async () => { + console.log('Shutting down server...'); + // Close all active transports to properly clean up resources + for (const sessionId in transports) { + try { + console.log(`Closing transport for session ${sessionId}`); + await transports[sessionId].close(); + delete transports[sessionId]; + } + catch (error) { + console.error(`Error closing transport for session ${sessionId}:`, error); + } + } + console.log('Server shutdown complete'); + process.exit(0); +}); +//# sourceMappingURL=simpleSseServer.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleSseServer.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleSseServer.js.map new file mode 100644 index 0000000000..97a4d6b4bd --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleSseServer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"simpleSseServer.js","sourceRoot":"","sources":["../../../../src/examples/server/simpleSseServer.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;;;;GAQG;AAEH,gCAAgC;AAChC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;QAC3B,IAAI,EAAE,mBAAmB;QACzB,OAAO,EAAE,OAAO;KACjB,EAAE,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAEtC,MAAM,CAAC,IAAI,CACT,2BAA2B,EAC3B,uCAAuC,EACvC;QACE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gDAAgD,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;QAC7F,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iCAAiC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;KAC1E,EACD,KAAK,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE,gBAAgB,EAAE,EAA2B,EAAE;QAC3E,MAAM,KAAK,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;QAC9E,IAAI,OAAO,GAAG,CAAC,CAAC;QAEhB,gCAAgC;QAChC,MAAM,gBAAgB,CAAC;YACrB,MAAM,EAAE,uBAAuB;Y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AK,CAAC,uCAAuC,SAAS,GAAG,EAAE,KAAK,CAAC,CAAC;QAC5E,CAAC;IACH,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;IACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleStatelessStreamableHttp.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleStatelessStreamableHttp.d.ts new file mode 100644 index 0000000000..0aa4ad2439 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleStatelessStreamableHttp.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=simpleStatelessStreamableHttp.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleStatelessStreamableHttp.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleStatelessStreamableHttp.d.ts.map new file mode 100644 index 0000000000..92deb06ecb --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleStatelessStreamableHttp.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"simpleStatelessStreamableHttp.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/simpleStatelessStreamableHttp.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleStatelessStreamableHttp.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleStatelessStreamableHttp.js new file mode 100644 index 0000000000..06d3c56bbe --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleStatelessStreamableHttp.js @@ -0,0 +1,135 @@ +import express from 'express'; +import { McpServer } from '../../server/mcp.js'; +import { StreamableHTTPServerTransport } from '../../server/streamableHttp.js'; +import { z } from 'zod'; +const getServer = () => { + // Create an MCP server with implementation details + const server = new McpServer({ + name: 'stateless-streamable-http-server', + version: '1.0.0', + }, { capabilities: { logging: {} } }); + // Register a simple prompt + server.prompt('greeting-template', 'A simple greeting prompt template', { + name: z.string().describe('Name to include in greeting'), + }, async ({ name }) => { + return { + messages: [ + { + role: 'user', + content: { + type: 'text', + text: `Please greet ${name} in a friendly manner.`, + }, + }, + ], + }; + }); + // Register a tool specifically for testing resumability + server.tool('start-notification-stream', 'Starts sending periodic notifications for testing resumability', { + interval: z.number().describe('Interval in milliseconds between notifications').default(100), + count: z.number().describe('Number of notifications to send (0 for 100)').default(10), + }, async ({ interval, count }, { sendNotification }) => { + const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)); + let counter = 0; + while (count === 0 || counter < count) { + counter++; + try { + await sendNotification({ + method: "notifications/message", + params: { + level: "info", + data: `Periodic notification #${counter} at ${new Date().toISOString()}` + } + }); + } + catch (error) { + console.error("Error sending notification:", error); + } + // Wait for the specified interval + await sleep(interval); + } + return { + content: [ + { + type: 'text', + text: `Started sending periodic notifications every ${interval}ms`, + } + ], + }; + }); + // Create a simple resource at a fixed URI + server.resource('greeting-resource', 'https://example.com/greetings/default', { mimeType: 'text/plain' }, async () => { + return { + contents: [ + { + uri: 'https://example.com/greetings/default', + text: 'Hello, world!', + }, + ], + }; + }); + return server; +}; +const app = express(); +app.use(express.json()); +app.post('/mcp', async (req, res) => { + const server = getServer(); + try { + const transport = new StreamableHTTPServerTransport({ + sessionIdGenerator: undefined, + }); + await server.connect(transport); + await transport.handleRequest(req, res, req.body); + res.on('close', () => { + console.log('Request closed'); + transport.close(); + server.close(); + }); + } + catch (error) { + console.error('Error handling MCP request:', error); + if (!res.headersSent) { + res.status(500).json({ + jsonrpc: '2.0', + error: { + code: -32603, + message: 'Internal server error', + }, + id: null, + }); + } + } +}); +app.get('/mcp', async (req, res) => { + console.log('Received GET MCP request'); + res.writeHead(405).end(JSON.stringify({ + jsonrpc: "2.0", + error: { + code: -32000, + message: "Method not allowed." + }, + id: null + })); +}); +app.delete('/mcp', async (req, res) => { + console.log('Received DELETE MCP request'); + res.writeHead(405).end(JSON.stringify({ + jsonrpc: "2.0", + error: { + code: -32000, + message: "Method not allowed." + }, + id: null + })); +}); +// Start the server +const PORT = 3000; +app.listen(PORT, () => { + console.log(`MCP Stateless Streamable HTTP Server listening on port ${PORT}`); +}); +// Handle server shutdown +process.on('SIGINT', async () => { + console.log('Shutting down server...'); + process.exit(0); +}); +//# sourceMappingURL=simpleStatelessStreamableHttp.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleStatelessStreamableHttp.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleStatelessStreamableHttp.js.map new file mode 100644 index 0000000000..d989c892da --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleStatelessStreamableHttp.js.map @@ -0,0 +1 @@ +{"version":3,"file":"simpleStatelessStreamableHttp.js","sourceRoot":"","sources":["../../../../src/examples/server/simpleStatelessStreamableHttp.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,mDAAmD;IACnD,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;QAC3B,IAAI,EAAE,kCAAkC;QACxC,OAAO,EAAE,OAAO;KACjB,EAAE,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAEtC,2BAA2B;IAC3B,MAAM,CAAC,MAAM,CACX,mBAAmB,EACnB,mCAAmC,EACnC;QACE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6BAA6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C;AAClB,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE;IACpB,OAAO,CAAC,GAAG,CAAC,0DAA0D,IAAI,EAAE,CAAC,CAAC;AAChF,CAAC,CAAC,CAAC;AAEH,yBAAyB;AACzB,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;IAC9B,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;IACvC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleStreamableHttp.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleStreamableHttp.d.ts new file mode 100644 index 0000000000..a20be42ca4 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleStreamableHttp.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=simpleStreamableHttp.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleStreamableHttp.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleStreamableHttp.d.ts.map new file mode 100644 index 0000000000..e3cf042241 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleStreamableHttp.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"simpleStreamableHttp.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/simpleStreamableHttp.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleStreamableHttp.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleStreamableHttp.js new file mode 100644 index 0000000000..a71c4007ea --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleStreamableHttp.js @@ -0,0 +1,333 @@ +import express from 'express'; +import { randomUUID } from 'node:crypto'; +import { z } from 'zod'; +import { McpServer } from '../../server/mcp.js'; +import { StreamableHTTPServerTransport } from '../../server/streamableHttp.js'; +import { getOAuthProtectedResourceMetadataUrl, mcpAuthMetadataRouter } from '../../server/auth/router.js'; +import { requireBearerAuth } from '../../server/auth/middleware/bearerAuth.js'; +import { isInitializeRequest } from '../../types.js'; +import { InMemoryEventStore } from '../shared/inMemoryEventStore.js'; +import { setupAuthServer } from './demoInMemoryOAuthProvider.js'; +// Check for OAuth flag +const useOAuth = process.argv.includes('--oauth'); +// Create an MCP server with implementation details +const getServer = () => { + const server = new McpServer({ + name: 'simple-streamable-http-server', + version: '1.0.0', + }, { capabilities: { logging: {} } }); + // Register a simple tool that returns a greeting + server.tool('greet', 'A simple greeting tool', { + name: z.string().describe('Name to greet'), + }, async ({ name }) => { + return { + content: [ + { + type: 'text', + text: `Hello, ${name}!`, + }, + ], + }; + }); + // Register a tool that sends multiple greetings with notifications (with annotations) + server.tool('multi-greet', 'A tool that sends different greetings with delays between them', { + name: z.string().describe('Name to greet'), + }, { + title: 'Multiple Greeting Tool', + readOnlyHint: true, + openWorldHint: false + }, async ({ name }, { sendNotification }) => { + const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)); + await sendNotification({ + method: "notifications/message", + params: { level: "debug", data: `Starting multi-greet for ${name}` } + }); + await sleep(1000); // Wait 1 second before first greeting + await sendNotification({ + method: "notifications/message", + params: { level: "info", data: `Sending first greeting to ${name}` } + }); + await sleep(1000); // Wait another second before second greeting + await sendNotification({ + method: "notifications/message", + params: { level: "info", data: `Sending second greeting to ${name}` } + }); + return { + content: [ + { + type: 'text', + text: `Good morning, ${name}!`, + } + ], + }; + }); + // Register a simple prompt + server.prompt('greeting-template', 'A simple greeting prompt template', { + name: z.string().describe('Name to include in greeting'), + }, async ({ name }) => { + return { + messages: [ + { + role: 'user', + content: { + type: 'text', + text: `Please greet ${name} in a friendly manner.`, + }, + }, + ], + }; + }); + // Register a tool specifically for testing resumability + server.tool('start-notification-stream', 'Starts sending periodic notifications for testing resumability', { + interval: z.number().describe('Interval in milliseconds between notifications').default(100), + count: z.number().describe('Number of notifications to send (0 for 100)').default(50), + }, async ({ interval, count }, { sendNotification }) => { + const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)); + let counter = 0; + while (count === 0 || counter < count) { + counter++; + try { + await sendNotification({ + method: "notifications/message", + params: { + level: "info", + data: `Periodic notification #${counter} at ${new Date().toISOString()}` + } + }); + } + catch (error) { + console.error("Error sending notification:", error); + } + // Wait for the specified interval + await sleep(interval); + } + return { + content: [ + { + type: 'text', + text: `Started sending periodic notifications every ${interval}ms`, + } + ], + }; + }); + // Create a simple resource at a fixed URI + server.resource('greeting-resource', 'https://example.com/greetings/default', { mimeType: 'text/plain' }, async () => { + return { + contents: [ + { + uri: 'https://example.com/greetings/default', + text: 'Hello, world!', + }, + ], + }; + }); + return server; +}; +const MCP_PORT = 3000; +const AUTH_PORT = 3001; +const app = express(); +app.use(express.json()); +// Set up OAuth if enabled +let authMiddleware = null; +if (useOAuth) { + // Create auth middleware for MCP endpoints + const mcpServerUrl = new URL(`http://localhost:${MCP_PORT}`); + const authServerUrl = new URL(`http://localhost:${AUTH_PORT}`); + const oauthMetadata = setupAuthServer(authServerUrl); + const tokenVerifier = { + verifyAccessToken: async (token) => { + const endpoint = oauthMetadata.introspection_endpoint; + if (!endpoint) { + throw new Error('No token verification endpoint available in metadata'); + } + const response = await fetch(endpoint, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: new URLSearchParams({ + token: token + }).toString() + }); + if (!response.ok) { + throw new Error(`Invalid or expired token: ${await response.text()}`); + } + const data = await response.json(); + // Convert the response to AuthInfo format + return { + token, + clientId: data.client_id, + scopes: data.scope ? data.scope.split(' ') : [], + expiresAt: data.exp, + }; + } + }; + // Add metadata routes to the main MCP server + app.use(mcpAuthMetadataRouter({ + oauthMetadata, + resourceServerUrl: mcpServerUrl, + scopesSupported: ['mcp:tools'], + resourceName: 'MCP Demo Server', + })); + authMiddleware = requireBearerAuth({ + verifier: tokenVerifier, + requiredScopes: ['mcp:tools'], + resourceMetadataUrl: getOAuthProtectedResourceMetadataUrl(mcpServerUrl), + }); +} +// Map to store transports by session ID +const transports = {}; +// MCP POST endpoint with optional auth +const mcpPostHandler = async (req, res) => { + console.log('Received MCP request:', req.body); + if (useOAuth && req.auth) { + console.log('Authenticated user:', req.auth); + } + try { + // Check for existing session ID + const sessionId = req.headers['mcp-session-id']; + let transport; + if (sessionId && transports[sessionId]) { + // Reuse existing transport + transport = transports[sessionId]; + } + else if (!sessionId && isInitializeRequest(req.body)) { + // New initialization request + const eventStore = new InMemoryEventStore(); + transport = new StreamableHTTPServerTransport({ + sessionIdGenerator: () => randomUUID(), + eventStore, // Enable resumability + onsessioninitialized: (sessionId) => { + // Store the transport by session ID when session is initialized + // This avoids race conditions where requests might come in before the session is stored + console.log(`Session initialized with ID: ${sessionId}`); + transports[sessionId] = transport; + } + }); + // Set up onclose handler to clean up transport when closed + transport.onclose = () => { + const sid = transport.sessionId; + if (sid && transports[sid]) { + console.log(`Transport closed for session ${sid}, removing from transports map`); + delete transports[sid]; + } + }; + // Connect the transport to the MCP server BEFORE handling the request + // so responses can flow back through the same transport + const server = getServer(); + await server.connect(transport); + await transport.handleRequest(req, res, req.body); + return; // Already handled + } + else { + // Invalid request - no session ID or not initialization request + res.status(400).json({ + jsonrpc: '2.0', + error: { + code: -32000, + message: 'Bad Request: No valid session ID provided', + }, + id: null, + }); + return; + } + // Handle the request with existing transport - no need to reconnect + // The existing transport is already connected to the server + await transport.handleRequest(req, res, req.body); + } + catch (error) { + console.error('Error handling MCP request:', error); + if (!res.headersSent) { + res.status(500).json({ + jsonrpc: '2.0', + error: { + code: -32603, + message: 'Internal server error', + }, + id: null, + }); + } + } +}; +// Set up routes with conditional auth middleware +if (useOAuth && authMiddleware) { + app.post('/mcp', authMiddleware, mcpPostHandler); +} +else { + app.post('/mcp', mcpPostHandler); +} +// Handle GET requests for SSE streams (using built-in support from StreamableHTTP) +const mcpGetHandler = async (req, res) => { + const sessionId = req.headers['mcp-session-id']; + if (!sessionId || !transports[sessionId]) { + res.status(400).send('Invalid or missing session ID'); + return; + } + if (useOAuth && req.auth) { + console.log('Authenticated SSE connection from user:', req.auth); + } + // Check for Last-Event-ID header for resumability + const lastEventId = req.headers['last-event-id']; + if (lastEventId) { + console.log(`Client reconnecting with Last-Event-ID: ${lastEventId}`); + } + else { + console.log(`Establishing new SSE stream for session ${sessionId}`); + } + const transport = transports[sessionId]; + await transport.handleRequest(req, res); +}; +// Set up GET route with conditional auth middleware +if (useOAuth && authMiddleware) { + app.get('/mcp', authMiddleware, mcpGetHandler); +} +else { + app.get('/mcp', mcpGetHandler); +} +// Handle DELETE requests for session termination (according to MCP spec) +const mcpDeleteHandler = async (req, res) => { + const sessionId = req.headers['mcp-session-id']; + if (!sessionId || !transports[sessionId]) { + res.status(400).send('Invalid or missing session ID'); + return; + } + console.log(`Received session termination request for session ${sessionId}`); + try { + const transport = transports[sessionId]; + await transport.handleRequest(req, res); + } + catch (error) { + console.error('Error handling session termination:', error); + if (!res.headersSent) { + res.status(500).send('Error processing session termination'); + } + } +}; +// Set up DELETE route with conditional auth middleware +if (useOAuth && authMiddleware) { + app.delete('/mcp', authMiddleware, mcpDeleteHandler); +} +else { + app.delete('/mcp', mcpDeleteHandler); +} +app.listen(MCP_PORT, () => { + console.log(`MCP Streamable HTTP Server listening on port ${MCP_PORT}`); +}); +// Handle server shutdown +process.on('SIGINT', async () => { + console.log('Shutting down server...'); + // Close all active transports to properly clean up resources + for (const sessionId in transports) { + try { + console.log(`Closing transport for session ${sessionId}`); + await transports[sessionId].close(); + delete transports[sessionId]; + } + catch (error) { + console.error(`Error closing transport for session ${sessionId}:`, error); + } + } + console.log('Server shutdown complete'); + process.exit(0); +}); +//# sourceMappingURL=simpleStreamableHttp.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleStreamableHttp.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleStreamableHttp.js.map new file mode 100644 index 0000000000..9d6d6b330d --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/simpleStreamableHttp.js.map @@ -0,0 +1 @@ +{"version":3,"file":"simpleStreamableHttp.js","sourceRoot":"","sources":["../../../../src/examples/server/simpleStreamableHttp.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAAE,oCAAoC,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAC1G,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAC/E,OAAO,EAAmC,mBAAmB,EAAsB,MAAM,gBAAgB,CAAC;AAC1G,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAGjE,uBAAuB;AACvB,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;AAElD,mDAAmD;AACnD,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;QAC3B,IAAI,EAAE,+BAA+B;QACrC,OAAO,EAAE,OAAO;KACjB,EAAE,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAEtC,iDAAiD;IACjD,MAAM,CAAC,IAAI,CACT,OAAO,EACP,wBAAwB,EACxB;QACE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,Q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KAAM,CAAC;IACN,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;AACvC,CAAC;AAED,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,GAAG,EAAE;IACxB,OAAO,CAAC,GAAG,CAAC,gDAAgD,QAAQ,EAAE,CAAC,CAAC;AAC1E,CAAC,CAAC,CAAC;AAEH,yBAAyB;AACzB,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;IAC9B,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;IAEvC,6DAA6D;IAC7D,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,IAAI,CAAC;YACH,OAAO,CAAC,GAAG,CAAC,iCAAiC,SAAS,EAAE,CAAC,CAAC;YAC1D,MAAM,UAAU,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,CAAC;YACpC,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC;QAC/B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,uCAAuC,SAAS,GAAG,EAAE,KAAK,CAAC,CAAC;QAC5E,CAAC;IACH,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;IACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/sseAndStreamableHttpCompatibleServer.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/sseAndStreamableHttpCompatibleServer.d.ts new file mode 100644 index 0000000000..c536d0c80e --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/sseAndStreamableHttpCompatibleServer.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=sseAndStreamableHttpCompatibleServer.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/sseAndStreamableHttpCompatibleServer.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/sseAndStreamableHttpCompatibleServer.d.ts.map new file mode 100644 index 0000000000..fb982c84a6 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/sseAndStreamableHttpCompatibleServer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"sseAndStreamableHttpCompatibleServer.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/sseAndStreamableHttpCompatibleServer.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/sseAndStreamableHttpCompatibleServer.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/sseAndStreamableHttpCompatibleServer.js new file mode 100644 index 0000000000..e5de96f607 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/sseAndStreamableHttpCompatibleServer.js @@ -0,0 +1,228 @@ +import express from 'express'; +import { randomUUID } from "node:crypto"; +import { McpServer } from '../../server/mcp.js'; +import { StreamableHTTPServerTransport } from '../../server/streamableHttp.js'; +import { SSEServerTransport } from '../../server/sse.js'; +import { z } from 'zod'; +import { isInitializeRequest } from '../../types.js'; +import { InMemoryEventStore } from '../shared/inMemoryEventStore.js'; +/** + * This example server demonstrates backwards compatibility with both: + * 1. The deprecated HTTP+SSE transport (protocol version 2024-11-05) + * 2. The Streamable HTTP transport (protocol version 2025-03-26) + * + * It maintains a single MCP server instance but exposes two transport options: + * - /mcp: The new Streamable HTTP endpoint (supports GET/POST/DELETE) + * - /sse: The deprecated SSE endpoint for older clients (GET to establish stream) + * - /messages: The deprecated POST endpoint for older clients (POST to send messages) + */ +const getServer = () => { + const server = new McpServer({ + name: 'backwards-compatible-server', + version: '1.0.0', + }, { capabilities: { logging: {} } }); + // Register a simple tool that sends notifications over time + server.tool('start-notification-stream', 'Starts sending periodic notifications for testing resumability', { + interval: z.number().describe('Interval in milliseconds between notifications').default(100), + count: z.number().describe('Number of notifications to send (0 for 100)').default(50), + }, async ({ interval, count }, { sendNotification }) => { + const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)); + let counter = 0; + while (count === 0 || counter < count) { + counter++; + try { + await sendNotification({ + method: "notifications/message", + params: { + level: "info", + data: `Periodic notification #${counter} at ${new Date().toISOString()}` + } + }); + } + catch (error) { + console.error("Error sending notification:", error); + } + // Wait for the specified interval + await sleep(interval); + } + return { + content: [ + { + type: 'text', + text: `Started sending periodic notifications every ${interval}ms`, + } + ], + }; + }); + return server; +}; +// Create Express application +const app = express(); +app.use(express.json()); +// Store transports by session ID +const transports = {}; +//============================================================================= +// STREAMABLE HTTP TRANSPORT (PROTOCOL VERSION 2025-03-26) +//============================================================================= +// Handle all MCP Streamable HTTP requests (GET, POST, DELETE) on a single endpoint +app.all('/mcp', async (req, res) => { + console.log(`Received ${req.method} request to /mcp`); + try { + // Check for existing session ID + const sessionId = req.headers['mcp-session-id']; + let transport; + if (sessionId && transports[sessionId]) { + // Check if the transport is of the correct type + const existingTransport = transports[sessionId]; + if (existingTransport instanceof StreamableHTTPServerTransport) { + // Reuse existing transport + transport = existingTransport; + } + else { + // Transport exists but is not a StreamableHTTPServerTransport (could be SSEServerTransport) + res.status(400).json({ + jsonrpc: '2.0', + error: { + code: -32000, + message: 'Bad Request: Session exists but uses a different transport protocol', + }, + id: null, + }); + return; + } + } + else if (!sessionId && req.method === 'POST' && isInitializeRequest(req.body)) { + const eventStore = new InMemoryEventStore(); + transport = new StreamableHTTPServerTransport({ + sessionIdGenerator: () => randomUUID(), + eventStore, // Enable resumability + onsessioninitialized: (sessionId) => { + // Store the transport by session ID when session is initialized + console.log(`StreamableHTTP session initialized with ID: ${sessionId}`); + transports[sessionId] = transport; + } + }); + // Set up onclose handler to clean up transport when closed + transport.onclose = () => { + const sid = transport.sessionId; + if (sid && transports[sid]) { + console.log(`Transport closed for session ${sid}, removing from transports map`); + delete transports[sid]; + } + }; + // Connect the transport to the MCP server + const server = getServer(); + await server.connect(transport); + } + else { + // Invalid request - no session ID or not initialization request + res.status(400).json({ + jsonrpc: '2.0', + error: { + code: -32000, + message: 'Bad Request: No valid session ID provided', + }, + id: null, + }); + return; + } + // Handle the request with the transport + await transport.handleRequest(req, res, req.body); + } + catch (error) { + console.error('Error handling MCP request:', error); + if (!res.headersSent) { + res.status(500).json({ + jsonrpc: '2.0', + error: { + code: -32603, + message: 'Internal server error', + }, + id: null, + }); + } + } +}); +//============================================================================= +// DEPRECATED HTTP+SSE TRANSPORT (PROTOCOL VERSION 2024-11-05) +//============================================================================= +app.get('/sse', async (req, res) => { + console.log('Received GET request to /sse (deprecated SSE transport)'); + const transport = new SSEServerTransport('/messages', res); + transports[transport.sessionId] = transport; + res.on("close", () => { + delete transports[transport.sessionId]; + }); + const server = getServer(); + await server.connect(transport); +}); +app.post("/messages", async (req, res) => { + const sessionId = req.query.sessionId; + let transport; + const existingTransport = transports[sessionId]; + if (existingTransport instanceof SSEServerTransport) { + // Reuse existing transport + transport = existingTransport; + } + else { + // Transport exists but is not a SSEServerTransport (could be StreamableHTTPServerTransport) + res.status(400).json({ + jsonrpc: '2.0', + error: { + code: -32000, + message: 'Bad Request: Session exists but uses a different transport protocol', + }, + id: null, + }); + return; + } + if (transport) { + await transport.handlePostMessage(req, res, req.body); + } + else { + res.status(400).send('No transport found for sessionId'); + } +}); +// Start the server +const PORT = 3000; +app.listen(PORT, () => { + console.log(`Backwards compatible MCP server listening on port ${PORT}`); + console.log(` +============================================== +SUPPORTED TRANSPORT OPTIONS: + +1. Streamable Http(Protocol version: 2025-03-26) + Endpoint: /mcp + Methods: GET, POST, DELETE + Usage: + - Initialize with POST to /mcp + - Establish SSE stream with GET to /mcp + - Send requests with POST to /mcp + - Terminate session with DELETE to /mcp + +2. Http + SSE (Protocol version: 2024-11-05) + Endpoints: /sse (GET) and /messages (POST) + Usage: + - Establish SSE stream with GET to /sse + - Send requests with POST to /messages?sessionId= +============================================== +`); +}); +// Handle server shutdown +process.on('SIGINT', async () => { + console.log('Shutting down server...'); + // Close all active transports to properly clean up resources + for (const sessionId in transports) { + try { + console.log(`Closing transport for session ${sessionId}`); + await transports[sessionId].close(); + delete transports[sessionId]; + } + catch (error) { + console.error(`Error closing transport for session ${sessionId}:`, error); + } + } + console.log('Server shutdown complete'); + process.exit(0); +}); +//# sourceMappingURL=sseAndStreamableHttpCompatibleServer.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/sseAndStreamableHttpCompatibleServer.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/sseAndStreamableHttpCompatibleServer.js.map new file mode 100644 index 0000000000..05a693627b --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/sseAndStreamableHttpCompatibleServer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sseAndStreamableHttpCompatibleServer.js","sourceRoot":"","sources":["../../../../src/examples/server/sseAndStreamableHttpCompatibleServer.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAkB,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE;;;;;;;;;GASG;AAEH,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;QAC3B,IAAI,EAAE,6BAA6B;QACnC,OAAO,EAAE,OAAO;KACjB,EAAE,EAAE,YAAY,EAAE,EAAE,OAA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AS,GAAG,EAAE,KAAK,CAAC,CAAC;QAC5E,CAAC;IACH,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;IACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/standaloneSseWithGetStreamableHttp.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/standaloneSseWithGetStreamableHttp.d.ts new file mode 100644 index 0000000000..4df17831b7 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/standaloneSseWithGetStreamableHttp.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=standaloneSseWithGetStreamableHttp.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/standaloneSseWithGetStreamableHttp.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/standaloneSseWithGetStreamableHttp.d.ts.map new file mode 100644 index 0000000000..df60dc51b0 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/standaloneSseWithGetStreamableHttp.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"standaloneSseWithGetStreamableHttp.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/standaloneSseWithGetStreamableHttp.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/standaloneSseWithGetStreamableHttp.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/standaloneSseWithGetStreamableHttp.js new file mode 100644 index 0000000000..166a98c33e --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/standaloneSseWithGetStreamableHttp.js @@ -0,0 +1,107 @@ +import express from 'express'; +import { randomUUID } from 'node:crypto'; +import { McpServer } from '../../server/mcp.js'; +import { StreamableHTTPServerTransport } from '../../server/streamableHttp.js'; +import { isInitializeRequest } from '../../types.js'; +// Create an MCP server with implementation details +const server = new McpServer({ + name: 'resource-list-changed-notification-server', + version: '1.0.0', +}); +// Store transports by session ID to send notifications +const transports = {}; +const addResource = (name, content) => { + const uri = `https://mcp-example.com/dynamic/${encodeURIComponent(name)}`; + server.resource(name, uri, { mimeType: 'text/plain', description: `Dynamic resource: ${name}` }, async () => { + return { + contents: [{ uri, text: content }], + }; + }); +}; +addResource('example-resource', 'Initial content for example-resource'); +const resourceChangeInterval = setInterval(() => { + const name = randomUUID(); + addResource(name, `Content for ${name}`); +}, 5000); // Change resources every 5 seconds for testing +const app = express(); +app.use(express.json()); +app.post('/mcp', async (req, res) => { + console.log('Received MCP request:', req.body); + try { + // Check for existing session ID + const sessionId = req.headers['mcp-session-id']; + let transport; + if (sessionId && transports[sessionId]) { + // Reuse existing transport + transport = transports[sessionId]; + } + else if (!sessionId && isInitializeRequest(req.body)) { + // New initialization request + transport = new StreamableHTTPServerTransport({ + sessionIdGenerator: () => randomUUID(), + onsessioninitialized: (sessionId) => { + // Store the transport by session ID when session is initialized + // This avoids race conditions where requests might come in before the session is stored + console.log(`Session initialized with ID: ${sessionId}`); + transports[sessionId] = transport; + } + }); + // Connect the transport to the MCP server + await server.connect(transport); + // Handle the request - the onsessioninitialized callback will store the transport + await transport.handleRequest(req, res, req.body); + return; // Already handled + } + else { + // Invalid request - no session ID or not initialization request + res.status(400).json({ + jsonrpc: '2.0', + error: { + code: -32000, + message: 'Bad Request: No valid session ID provided', + }, + id: null, + }); + return; + } + // Handle the request with existing transport + await transport.handleRequest(req, res, req.body); + } + catch (error) { + console.error('Error handling MCP request:', error); + if (!res.headersSent) { + res.status(500).json({ + jsonrpc: '2.0', + error: { + code: -32603, + message: 'Internal server error', + }, + id: null, + }); + } + } +}); +// Handle GET requests for SSE streams (now using built-in support from StreamableHTTP) +app.get('/mcp', async (req, res) => { + const sessionId = req.headers['mcp-session-id']; + if (!sessionId || !transports[sessionId]) { + res.status(400).send('Invalid or missing session ID'); + return; + } + console.log(`Establishing SSE stream for session ${sessionId}`); + const transport = transports[sessionId]; + await transport.handleRequest(req, res); +}); +// Start the server +const PORT = 3000; +app.listen(PORT, () => { + console.log(`Server listening on port ${PORT}`); +}); +// Handle server shutdown +process.on('SIGINT', async () => { + console.log('Shutting down server...'); + clearInterval(resourceChangeInterval); + await server.close(); + process.exit(0); +}); +//# sourceMappingURL=standaloneSseWithGetStreamableHttp.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/standaloneSseWithGetStreamableHttp.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/standaloneSseWithGetStreamableHttp.js.map new file mode 100644 index 0000000000..2635dcc526 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/server/standaloneSseWithGetStreamableHttp.js.map @@ -0,0 +1 @@ +{"version":3,"file":"standaloneSseWithGetStreamableHttp.js","sourceRoot":"","sources":["../../../../src/examples/server/standaloneSseWithGetStreamableHttp.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAsB,MAAM,gBAAgB,CAAC;AAEzE,mDAAmD;AACnD,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;IAC3B,IAAI,EAAE,2CAA2C;IACjD,OAAO,EAAE,OAAO;CACjB,CAAC,CAAC;AAEH,uDAAuD;AACvD,MAAM,UAAU,GAA2D,EAAE,CAAC;AAE9E,MAAM,WAAW,GAAG,CAAC,IAAY,EAAE,OAAe,EAAE,EAAE;IACpD,MAAM,GAAG,GAAG,mCAAmC,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC;IAC1E,MAA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,uFAAuF;AACvF,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,GAAY,EAAE,GAAa,EAAE,EAAE;IACpD,MAAM,SAAS,GAAG,GAAG,CAAC,OAAO,CAAC,gBAAgB,CAAuB,CAAC;IACtE,IAAI,CAAC,SAAS,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QACzC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC;QACtD,OAAO;IACT,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,uCAAuC,SAAS,EAAE,CAAC,CAAC;IAChE,MAAM,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;IACxC,MAAM,SAAS,CAAC,aAAa,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAC1C,CAAC,CAAC,CAAC;AAGH,mBAAmB;AACnB,MAAM,IAAI,GAAG,IAAI,CAAC;AAClB,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE;IACpB,OAAO,CAAC,GAAG,CAAC,4BAA4B,IAAI,EAAE,CAAC,CAAC;AAClD,CAAC,CAAC,CAAC;AAEH,yBAAyB;AACzB,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;IAC9B,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;IACvC,aAAa,CAAC,sBAAsB,CAAC,CAAC;IACtC,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;IACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/shared/inMemoryEventStore.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/shared/inMemoryEventStore.d.ts new file mode 100644 index 0000000000..26ff38cf93 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/shared/inMemoryEventStore.d.ts @@ -0,0 +1,31 @@ +import { JSONRPCMessage } from '../../types.js'; +import { EventStore } from '../../server/streamableHttp.js'; +/** + * Simple in-memory implementation of the EventStore interface for resumability + * This is primarily intended for examples and testing, not for production use + * where a persistent storage solution would be more appropriate. + */ +export declare class InMemoryEventStore implements EventStore { + private events; + /** + * Generates a unique event ID for a given stream ID + */ + private generateEventId; + /** + * Extracts the stream ID from an event ID + */ + private getStreamIdFromEventId; + /** + * Stores an event with a generated event ID + * Implements EventStore.storeEvent + */ + storeEvent(streamId: string, message: JSONRPCMessage): Promise; + /** + * Replays events that occurred after a specific event ID + * Implements EventStore.replayEventsAfter + */ + replayEventsAfter(lastEventId: string, { send }: { + send: (eventId: string, message: JSONRPCMessage) => Promise; + }): Promise; +} +//# sourceMappingURL=inMemoryEventStore.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/shared/inMemoryEventStore.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/shared/inMemoryEventStore.d.ts.map new file mode 100644 index 0000000000..b7d1ba4b79 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/shared/inMemoryEventStore.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inMemoryEventStore.d.ts","sourceRoot":"","sources":["../../../../src/examples/shared/inMemoryEventStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAE5D;;;;GAIG;AACH,qBAAa,kBAAmB,YAAW,UAAU;IACnD,OAAO,CAAC,MAAM,CAAyE;IAEvF;;OAEG;IACH,OAAO,CAAC,eAAe;IAIvB;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAK9B;;;OAGG;IACG,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;IAM5E;;;OAGG;IACG,iBAAiB,CAAC,WAAW,EAAE,MAAM,EACzC,EAAE,IAAI,EAAE,EAAE;QAAE,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;KAAE,GAC9E,OAAO,CAAC,MAAM,CAAC;CAkCnB"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/shared/inMemoryEventStore.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/shared/inMemoryEventStore.js new file mode 100644 index 0000000000..35f6dbb7c3 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/shared/inMemoryEventStore.js @@ -0,0 +1,65 @@ +/** + * Simple in-memory implementation of the EventStore interface for resumability + * This is primarily intended for examples and testing, not for production use + * where a persistent storage solution would be more appropriate. + */ +export class InMemoryEventStore { + constructor() { + this.events = new Map(); + } + /** + * Generates a unique event ID for a given stream ID + */ + generateEventId(streamId) { + return `${streamId}_${Date.now()}_${Math.random().toString(36).substring(2, 10)}`; + } + /** + * Extracts the stream ID from an event ID + */ + getStreamIdFromEventId(eventId) { + const parts = eventId.split('_'); + return parts.length > 0 ? parts[0] : ''; + } + /** + * Stores an event with a generated event ID + * Implements EventStore.storeEvent + */ + async storeEvent(streamId, message) { + const eventId = this.generateEventId(streamId); + this.events.set(eventId, { streamId, message }); + return eventId; + } + /** + * Replays events that occurred after a specific event ID + * Implements EventStore.replayEventsAfter + */ + async replayEventsAfter(lastEventId, { send }) { + if (!lastEventId || !this.events.has(lastEventId)) { + return ''; + } + // Extract the stream ID from the event ID + const streamId = this.getStreamIdFromEventId(lastEventId); + if (!streamId) { + return ''; + } + let foundLastEvent = false; + // Sort events by eventId for chronological ordering + const sortedEvents = [...this.events.entries()].sort((a, b) => a[0].localeCompare(b[0])); + for (const [eventId, { streamId: eventStreamId, message }] of sortedEvents) { + // Only include events from the same stream + if (eventStreamId !== streamId) { + continue; + } + // Start sending events after we find the lastEventId + if (eventId === lastEventId) { + foundLastEvent = true; + continue; + } + if (foundLastEvent) { + await send(eventId, message); + } + } + return streamId; + } +} +//# sourceMappingURL=inMemoryEventStore.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/shared/inMemoryEventStore.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/shared/inMemoryEventStore.js.map new file mode 100644 index 0000000000..78118f8c55 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/examples/shared/inMemoryEventStore.js.map @@ -0,0 +1 @@ +{"version":3,"file":"inMemoryEventStore.js","sourceRoot":"","sources":["../../../../src/examples/shared/inMemoryEventStore.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,MAAM,OAAO,kBAAkB;IAA/B;QACU,WAAM,GAA+D,IAAI,GAAG,EAAE,CAAC;IAmEzF,CAAC;IAjEC;;OAEG;IACK,eAAe,CAAC,QAAgB;QACtC,OAAO,GAAG,QAAQ,IAAI,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;IACpF,CAAC;IAED;;OAEG;IACK,sBAAsB,CAAC,OAAe;QAC5C,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACjC,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1C,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,UAAU,CAAC,QAAgB,EAAE,OAAuB;QACxD,MAAM,OAAO,GAAG,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;QAC/C,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EA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/ajv/dist/esm/inMemory.d.ts new file mode 100644 index 0000000000..2f5ab40576 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/inMemory.d.ts @@ -0,0 +1,31 @@ +import { Transport } from "./shared/transport.js"; +import { JSONRPCMessage, RequestId } from "./types.js"; +import { AuthInfo } from "./server/auth/types.js"; +/** + * In-memory transport for creating clients and servers that talk to each other within the same process. + */ +export declare class InMemoryTransport implements Transport { + private _otherTransport?; + private _messageQueue; + onclose?: () => void; + onerror?: (error: Error) => void; + onmessage?: (message: JSONRPCMessage, extra?: { + authInfo?: AuthInfo; + }) => void; + sessionId?: string; + /** + * Creates a pair of linked in-memory transports that can communicate with each other. One should be passed to a Client and one to a Server. + */ + static createLinkedPair(): [InMemoryTransport, InMemoryTransport]; + start(): Promise; + close(): Promise; + /** + * Sends a message with optional auth info. + * This is useful for testing authentication scenarios. + */ + send(message: JSONRPCMessage, options?: { + relatedRequestId?: RequestId; + authInfo?: AuthInfo; + }): Promise; +} +//# sourceMappingURL=inMemory.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/inMemory.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/inMemory.d.ts.map new file mode 100644 index 0000000000..e5685527de --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/inMemory.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inMemory.d.ts","sourceRoot":"","sources":["../../src/inMemory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAOlD;;GAEG;AACH,qBAAa,iBAAkB,YAAW,SAAS;IACjD,OAAO,CAAC,eAAe,CAAC,CAAoB;IAC5C,OAAO,CAAC,aAAa,CAAuB;IAE5C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,QAAQ,CAAA;KAAE,KAAK,IAAI,CAAC;IAC/E,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,MAAM,CAAC,gBAAgB,IAAI,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAQ3D,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAQtB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAO5B;;;OAGG;IACG,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE;QAAE,gBAAgB,CAAC,EAAE,SAAS,CAAC;QAAC,QAAQ,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAWpH"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/inMemory.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/inMemory.js new file mode 100644 index 0000000000..df6c3c67d2 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/inMemory.js @@ -0,0 +1,49 @@ +/** + * In-memory transport for creating clients and servers that talk to each other within the same process. + */ +export class InMemoryTransport { + constructor() { + this._messageQueue = []; + } + /** + * Creates a pair of linked in-memory transports that can communicate with each other. One should be passed to a Client and one to a Server. + */ + static createLinkedPair() { + const clientTransport = new InMemoryTransport(); + const serverTransport = new InMemoryTransport(); + clientTransport._otherTransport = serverTransport; + serverTransport._otherTransport = clientTransport; + return [clientTransport, serverTransport]; + } + async start() { + var _a; + // Process any messages that were queued before start was called + while (this._messageQueue.length > 0) { + const queuedMessage = this._messageQueue.shift(); + (_a = this.onmessage) === null || _a === void 0 ? void 0 : _a.call(this, queuedMessage.message, queuedMessage.extra); + } + } + async close() { + var _a; + const other = this._otherTransport; + this._otherTransport = undefined; + await (other === null || other === void 0 ? void 0 : other.close()); + (_a = this.onclose) === null || _a === void 0 ? void 0 : _a.call(this); + } + /** + * Sends a message with optional auth info. + * This is useful for testing authentication scenarios. + */ + async send(message, options) { + if (!this._otherTransport) { + throw new Error("Not connected"); + } + if (this._otherTransport.onmessage) { + this._otherTransport.onmessage(message, { authInfo: options === null || options === void 0 ? void 0 : options.authInfo }); + } + else { + this._otherTransport._messageQueue.push({ message, extra: { authInfo: options === null || options === void 0 ? void 0 : options.authInfo } }); + } + } +} +//# sourceMappingURL=inMemory.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/inMemory.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/inMemory.js.map new file mode 100644 index 0000000000..001ce4168c --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/inMemory.js.map @@ -0,0 +1 @@ +{"version":3,"file":"inMemory.js","sourceRoot":"","sources":["../../src/inMemory.ts"],"names":[],"mappings":"AASA;;GAEG;AACH,MAAM,OAAO,iBAAiB;IAA9B;QAEU,kBAAa,GAAoB,EAAE,CAAC;IAgD9C,CAAC;IAzCC;;OAEG;IACH,MAAM,CAAC,gBAAgB;QACrB,MAAM,eAAe,GAAG,IAAI,iBAAiB,EAAE,CAAC;QAChD,MAAM,eAAe,GAAG,IAAI,iBAAiB,EAAE,CAAC;QAChD,eAAe,CAAC,eAAe,GAAG,eAAe,CAAC;QAClD,eAAe,CAAC,eAAe,GAAG,eAAe,CAAC;QAClD,OAAO,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,KAAK;;QACT,gEAAgE;QAChE,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACrC,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,EAAG,CAAC;YAClD,MAAA,IAAI,CAAC,SAAS,qDAAG,aAAa,CAAC,OAAO,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;QAC/D,CAAC;IACH,CAAC;IAED,KAAK,CAAC,KAAK;;QACT,MAAM,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC;QACnC,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC;QACjC,MAAM,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK,EAAE,CAAA,CAAC;QACrB,MAAA,IAAI,CAAC,OAAO,oDAAI,CAAC;IACnB,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,IAAI,CAAC,OAAuB,EAAE,OAA+D;QACjG,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;QACnC,CAAC;QAED,IAAI,IAAI,CAAC,eAAe,CAAC,SAAS,EAAE,CAAC;YACnC,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,EAAE,CAAC,CAAC;QAC3E,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;QAC/F,CAAC;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/package.json b/front_end/third_party/mcp-sdk/ajv/dist/esm/package.json new file mode 100644 index 0000000000..6990891ff3 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/package.json @@ -0,0 +1 @@ +{"type": "module"} diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/clients.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/clients.d.ts new file mode 100644 index 0000000000..a5f1357fea --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/clients.d.ts @@ -0,0 +1,19 @@ +import { OAuthClientInformationFull } from "../../shared/auth.js"; +/** + * Stores information about registered OAuth clients for this server. + */ +export interface OAuthRegisteredClientsStore { + /** + * Returns information about a registered client, based on its ID. + */ + getClient(clientId: string): OAuthClientInformationFull | undefined | Promise; + /** + * Registers a new client with the server. The client ID and secret will be automatically generated by the library. A modified version of the client information can be returned to reflect specific values enforced by the server. + * + * NOTE: Implementations should NOT delete expired client secrets in-place. Auth middleware provided by this library will automatically check the `client_secret_expires_at` field and reject requests with expired secrets. Any custom logic for authenticating clients should check the `client_secret_expires_at` field as well. + * + * If unimplemented, dynamic client registration is unsupported. + */ + registerClient?(client: OAuthClientInformationFull): OAuthClientInformationFull | Promise; +} +//# sourceMappingURL=clients.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/clients.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/clients.d.ts.map new file mode 100644 index 0000000000..6f0ba788f7 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/clients.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"clients.d.ts","sourceRoot":"","sources":["../../../../src/server/auth/clients.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;OAEG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,0BAA0B,GAAG,SAAS,GAAG,OAAO,CAAC,0BAA0B,GAAG,SAAS,CAAC,CAAC;IAEtH;;;;;;OAMG;IACH,cAAc,CAAC,CAAC,MAAM,EAAE,0BAA0B,GAAG,0BAA0B,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;CACvH"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/clients.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/clients.js new file mode 100644 index 0000000000..6181a5709d --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/clients.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=clients.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/clients.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/clients.js.map new file mode 100644 index 0000000000..0210104422 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/clients.js.map @@ -0,0 +1 @@ +{"version":3,"file":"clients.js","sourceRoot":"","sources":["../../../../src/server/auth/clients.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/errors.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/errors.d.ts new file mode 100644 index 0000000000..7290363f9b --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/errors.d.ts @@ -0,0 +1,126 @@ +import { OAuthErrorResponse } from "../../shared/auth.js"; +/** + * Base class for all OAuth errors + */ +export declare class OAuthError extends Error { + readonly errorCode: string; + readonly errorUri?: string | undefined; + constructor(errorCode: string, message: string, errorUri?: string | undefined); + /** + * Converts the error to a standard OAuth error response object + */ + toResponseObject(): OAuthErrorResponse; +} +/** + * Invalid request error - The request is missing a required parameter, + * includes an invalid parameter value, includes a parameter more than once, + * or is otherwise malformed. + */ +export declare class InvalidRequestError extends OAuthError { + constructor(message: string, errorUri?: string); +} +/** + * Invalid client error - Client authentication failed (e.g., unknown client, no client + * authentication included, or unsupported authentication method). + */ +export declare class InvalidClientError extends OAuthError { + constructor(message: string, errorUri?: string); +} +/** + * Invalid grant error - The provided authorization grant or refresh token is + * invalid, expired, revoked, does not match the redirection URI used in the + * authorization request, or was issued to another client. + */ +export declare class InvalidGrantError extends OAuthError { + constructor(message: string, errorUri?: string); +} +/** + * Unauthorized client error - The authenticated client is not authorized to use + * this authorization grant type. + */ +export declare class UnauthorizedClientError extends OAuthError { + constructor(message: string, errorUri?: string); +} +/** + * Unsupported grant type error - The authorization grant type is not supported + * by the authorization server. + */ +export declare class UnsupportedGrantTypeError extends OAuthError { + constructor(message: string, errorUri?: string); +} +/** + * Invalid scope error - The requested scope is invalid, unknown, malformed, or + * exceeds the scope granted by the resource owner. + */ +export declare class InvalidScopeError extends OAuthError { + constructor(message: string, errorUri?: string); +} +/** + * Access denied error - The resource owner or authorization server denied the request. + */ +export declare class AccessDeniedError extends OAuthError { + constructor(message: string, errorUri?: string); +} +/** + * Server error - The authorization server encountered an unexpected condition + * that prevented it from fulfilling the request. + */ +export declare class ServerError extends OAuthError { + constructor(message: string, errorUri?: string); +} +/** + * Temporarily unavailable error - The authorization server is currently unable to + * handle the request due to a temporary overloading or maintenance of the server. + */ +export declare class TemporarilyUnavailableError extends OAuthError { + constructor(message: string, errorUri?: string); +} +/** + * Unsupported response type error - The authorization server does not support + * obtaining an authorization code using this method. + */ +export declare class UnsupportedResponseTypeError extends OAuthError { + constructor(message: string, errorUri?: string); +} +/** + * Unsupported token type error - The authorization server does not support + * the requested token type. + */ +export declare class UnsupportedTokenTypeError extends OAuthError { + constructor(message: string, errorUri?: string); +} +/** + * Invalid token error - The access token provided is expired, revoked, malformed, + * or invalid for other reasons. + */ +export declare class InvalidTokenError extends OAuthError { + constructor(message: string, errorUri?: string); +} +/** + * Method not allowed error - The HTTP method used is not allowed for this endpoint. + * (Custom, non-standard error) + */ +export declare class MethodNotAllowedError extends OAuthError { + constructor(message: string, errorUri?: string); +} +/** + * Too many requests error - Rate limit exceeded. + * (Custom, non-standard error based on RFC 6585) + */ +export declare class TooManyRequestsError extends OAuthError { + constructor(message: string, errorUri?: string); +} +/** + * Invalid client metadata error - The client metadata is invalid. + * (Custom error for dynamic client registration - RFC 7591) + */ +export declare class InvalidClientMetadataError extends OAuthError { + constructor(message: string, errorUri?: string); +} +/** + * Insufficient scope error - The request requires higher privileges than provided by the access token. + */ +export declare class InsufficientScopeError extends OAuthError { + constructor(message: string, errorUri?: string); +} +//# sourceMappingURL=errors.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/errors.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/errors.d.ts.map new file mode 100644 index 0000000000..e522108008 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/errors.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/server/auth/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK;aAEjB,SAAS,EAAE,MAAM;aAEjB,QAAQ,CAAC,EAAE,MAAM;gBAFjB,SAAS,EAAE,MAAM,EACjC,OAAO,EAAE,MAAM,EACC,QAAQ,CAAC,EAAE,MAAM,YAAA;IAMnC;;OAEG;IACH,gBAAgB,IAAI,kBAAkB;CAYvC;AAED;;;;GAIG;AACH,qBAAa,mBAAoB,SAAQ,UAAU;gBACrC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM;CAG/C;AAED;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,UAAU;gBACpC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM;CAG/C;AAED;;;;GAIG;AACH,qBAAa,iBAAkB,SAAQ,UAAU;gBACnC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM;CAG/C;AAED;;;GAGG;AACH,qBAAa,uBAAwB,SAAQ,UAAU;gBACzC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM;CAG/C;AAED;;;GAGG;AACH,qBAAa,yBAA0B,SAAQ,UAAU;gBAC3C,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAA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C"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/errors.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/errors.js new file mode 100644 index 0000000000..8058acd35c --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/errors.js @@ -0,0 +1,169 @@ +/** + * Base class for all OAuth errors + */ +export class OAuthError extends Error { + constructor(errorCode, message, errorUri) { + super(message); + this.errorCode = errorCode; + this.errorUri = errorUri; + this.name = this.constructor.name; + } + /** + * Converts the error to a standard OAuth error response object + */ + toResponseObject() { + const response = { + error: this.errorCode, + error_description: this.message + }; + if (this.errorUri) { + response.error_uri = this.errorUri; + } + return response; + } +} +/** + * Invalid request error - The request is missing a required parameter, + * includes an invalid parameter value, includes a parameter more than once, + * or is otherwise malformed. + */ +export class InvalidRequestError extends OAuthError { + constructor(message, errorUri) { + super("invalid_request", message, errorUri); + } +} +/** + * Invalid client error - Client authentication failed (e.g., unknown client, no client + * authentication included, or unsupported authentication method). + */ +export class InvalidClientError extends OAuthError { + constructor(message, errorUri) { + super("invalid_client", message, errorUri); + } +} +/** + * Invalid grant error - The provided authorization grant or refresh token is + * invalid, expired, revoked, does not match the redirection URI used in the + * authorization request, or was issued to another client. + */ +export class InvalidGrantError extends OAuthError { + constructor(message, errorUri) { + super("invalid_grant", message, errorUri); + } +} +/** + * Unauthorized client error - The authenticated client is not authorized to use + * this authorization grant type. + */ +export class UnauthorizedClientError extends OAuthError { + constructor(message, errorUri) { + super("unauthorized_client", message, errorUri); + } +} +/** + * Unsupported grant type error - The authorization grant type is not supported + * by the authorization server. + */ +export class UnsupportedGrantTypeError extends OAuthError { + constructor(message, errorUri) { + super("unsupported_grant_type", message, errorUri); + } +} +/** + * Invalid scope error - The requested scope is invalid, unknown, malformed, or + * exceeds the scope granted by the resource owner. + */ +export class InvalidScopeError extends OAuthError { + constructor(message, errorUri) { + super("invalid_scope", message, errorUri); + } +} +/** + * Access denied error - The resource owner or authorization server denied the request. + */ +export class AccessDeniedError extends OAuthError { + constructor(message, errorUri) { + super("access_denied", message, errorUri); + } +} +/** + * Server error - The authorization server encountered an unexpected condition + * that prevented it from fulfilling the request. + */ +export class ServerError extends OAuthError { + constructor(message, errorUri) { + super("server_error", message, errorUri); + } +} +/** + * Temporarily unavailable error - The authorization server is currently unable to + * handle the request due to a temporary overloading or maintenance of the server. + */ +export class TemporarilyUnavailableError extends OAuthError { + constructor(message, errorUri) { + super("temporarily_unavailable", message, errorUri); + } +} +/** + * Unsupported response type error - The authorization server does not support + * obtaining an authorization code using this method. + */ +export class UnsupportedResponseTypeError extends OAuthError { + constructor(message, errorUri) { + super("unsupported_response_type", message, errorUri); + } +} +/** + * Unsupported token type error - The authorization server does not support + * the requested token type. + */ +export class UnsupportedTokenTypeError extends OAuthError { + constructor(message, errorUri) { + super("unsupported_token_type", message, errorUri); + } +} +/** + * Invalid token error - The access token provided is expired, revoked, malformed, + * or invalid for other reasons. + */ +export class InvalidTokenError extends OAuthError { + constructor(message, errorUri) { + super("invalid_token", message, errorUri); + } +} +/** + * Method not allowed error - The HTTP method used is not allowed for this endpoint. + * (Custom, non-standard error) + */ +export class MethodNotAllowedError extends OAuthError { + constructor(message, errorUri) { + super("method_not_allowed", message, errorUri); + } +} +/** + * Too many requests error - Rate limit exceeded. + * (Custom, non-standard error based on RFC 6585) + */ +export class TooManyRequestsError extends OAuthError { + constructor(message, errorUri) { + super("too_many_requests", message, errorUri); + } +} +/** + * Invalid client metadata error - The client metadata is invalid. + * (Custom error for dynamic client registration - RFC 7591) + */ +export class InvalidClientMetadataError extends OAuthError { + constructor(message, errorUri) { + super("invalid_client_metadata", message, errorUri); + } +} +/** + * Insufficient scope error - The request requires higher privileges than provided by the access token. + */ +export class InsufficientScopeError extends OAuthError { + constructor(message, errorUri) { + super("insufficient_scope", message, errorUri); + } +} +//# sourceMappingURL=errors.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/errors.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/errors.js.map new file mode 100644 index 0000000000..4c980c6aa2 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/errors.js.map @@ -0,0 +1 @@ +{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../src/server/auth/errors.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,KAAK;IACnC,YACkB,SAAiB,EACjC,OAAe,EACC,QAAiB;QAEjC,KAAK,CAAC,OAAO,CAAC,CAAC;QAJC,cAAS,GAAT,SAAS,CAAQ;QAEjB,aAAQ,GAAR,QAAQ,CAAS;QAGjC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IACpC,CAAC;IAED;;OAEG;IACH,gBAAgB;QACd,MAAM,QAAQ,GAAuB;YACnC,KAAK,EAAE,IAAI,CAAC,SAAS;YACrB,iBAAiB,EAAE,IAAI,CAAC,OAAO;SAChC,CAAC;QAEF,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,QAAQ,CAAC,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC;QACrC,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,OAAO,mBAAoB,SAAQ,UAAU;IACjD,YAAY,OAAe,EAAE,QAAiB;QAC5C,KAAK,CAAC,iBAAiB,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC9C,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,kBAAmB,SAAQ,UAAU;IAChD,YAAY,OAAe,EAAE,QAAiB;QAC5C,KAAK,CAAC,gBAAgB,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC7C,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,OAAO,iBAAkB,SAAQ,UAAU;IAC/C,YAAY,OAAe,EAAE,QAAiB;QAC5C,KAAK,CAAC,eAAe,E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O,yBAA0B,SAAQ,UAAU;IACvD,YAAY,OAAe,EAAE,QAAiB;QAC5C,KAAK,CAAC,wBAAwB,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IACrD,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,iBAAkB,SAAQ,UAAU;IAC/C,YAAY,OAAe,EAAE,QAAiB;QAC5C,KAAK,CAAC,eAAe,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC5C,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,qBAAsB,SAAQ,UAAU;IACnD,YAAY,OAAe,EAAE,QAAiB;QAC5C,KAAK,CAAC,oBAAoB,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IACjD,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,oBAAqB,SAAQ,UAAU;IAClD,YAAY,OAAe,EAAE,QAAiB;QAC5C,KAAK,CAAC,mBAAmB,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IAChD,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,0BAA2B,SAAQ,UAAU;IACxD,YAAY,OAAe,EAAE,QAAiB;QAC5C,KAAK,CAAC,yBAAyB,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IACtD,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,sBAAuB,SAAQ,UAAU;IACpD,YAAY,OAAe,EAAE,QAAiB;QAC5C,KAAK,CAAC,oBAAoB,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IACjD,CAAC;CACF"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/authorize.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/authorize.d.ts new file mode 100644 index 0000000000..5b3264df72 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/authorize.d.ts @@ -0,0 +1,13 @@ +import { RequestHandler } from "express"; +import { OAuthServerProvider } from "../provider.js"; +import { Options as RateLimitOptions } from "express-rate-limit"; +export type AuthorizationHandlerOptions = { + provider: OAuthServerProvider; + /** + * Rate limiting configuration for the authorization endpoint. + * Set to false to disable rate limiting for this endpoint. + */ + rateLimit?: Partial | false; +}; +export declare function authorizationHandler({ provider, rateLimit: rateLimitConfig }: AuthorizationHandlerOptions): RequestHandler; +//# sourceMappingURL=authorize.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/authorize.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/authorize.d.ts.map new file mode 100644 index 0000000000..01876056dc --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/authorize.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"authorize.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/authorize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAa,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAW5E,MAAM,MAAM,2BAA2B,GAAG;IACxC,QAAQ,EAAE,mBAAmB,CAAC;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,KAAK,CAAC;CAC/C,CAAC;AAiBF,wBAAgB,oBAAoB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,EAAE,2BAA2B,GAAG,cAAc,CAmH1H"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/authorize.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/authorize.js new file mode 100644 index 0000000000..c491291b38 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/authorize.js @@ -0,0 +1,143 @@ +import { z } from "zod"; +import express from "express"; +import { rateLimit } from "express-rate-limit"; +import { allowedMethods } from "../middleware/allowedMethods.js"; +import { InvalidRequestError, InvalidClientError, InvalidScopeError, ServerError, TooManyRequestsError, OAuthError } from "../errors.js"; +// Parameters that must be validated in order to issue redirects. +const ClientAuthorizationParamsSchema = z.object({ + client_id: z.string(), + redirect_uri: z.string().optional().refine((value) => value === undefined || URL.canParse(value), { message: "redirect_uri must be a valid URL" }), +}); +// Parameters that must be validated for a successful authorization request. Failure can be reported to the redirect URI. +const RequestAuthorizationParamsSchema = z.object({ + response_type: z.literal("code"), + code_challenge: z.string(), + code_challenge_method: z.literal("S256"), + scope: z.string().optional(), + state: z.string().optional(), +}); +export function authorizationHandler({ provider, rateLimit: rateLimitConfig }) { + // Create a router to apply middleware + const router = express.Router(); + router.use(allowedMethods(["GET", "POST"])); + router.use(express.urlencoded({ extended: false })); + // Apply rate limiting unless explicitly disabled + if (rateLimitConfig !== false) { + router.use(rateLimit({ + windowMs: 15 * 60 * 1000, // 15 minutes + max: 100, // 100 requests per windowMs + standardHeaders: true, + legacyHeaders: false, + message: new TooManyRequestsError('You have exceeded the rate limit for authorization requests').toResponseObject(), + ...rateLimitConfig + })); + } + router.all("/", async (req, res) => { + var _a; + res.setHeader('Cache-Control', 'no-store'); + // In the authorization flow, errors are split into two categories: + // 1. Pre-redirect errors (direct response with 400) + // 2. Post-redirect errors (redirect with error parameters) + // Phase 1: Validate client_id and redirect_uri. Any errors here must be direct responses. + let client_id, redirect_uri, client; + try { + const result = ClientAuthorizationParamsSchema.safeParse(req.method === 'POST' ? req.body : req.query); + if (!result.success) { + throw new InvalidRequestError(result.error.message); + } + client_id = result.data.client_id; + redirect_uri = result.data.redirect_uri; + client = await provider.clientsStore.getClient(client_id); + if (!client) { + throw new InvalidClientError("Invalid client_id"); + } + if (redirect_uri !== undefined) { + if (!client.redirect_uris.includes(redirect_uri)) { + throw new InvalidRequestError("Unregistered redirect_uri"); + } + } + else if (client.redirect_uris.length === 1) { + redirect_uri = client.redirect_uris[0]; + } + else { + throw new InvalidRequestError("redirect_uri must be specified when client has multiple registered URIs"); + } + } + catch (error) { + // Pre-redirect errors - return direct response + // + // These don't need to be JSON encoded, as they'll be displayed in a user + // agent, but OTOH they all represent exceptional situations (arguably, + // "programmer error"), so presenting a nice HTML page doesn't help the + // user anyway. + if (error instanceof OAuthError) { + const status = error instanceof ServerError ? 500 : 400; + res.status(status).json(error.toResponseObject()); + } + else { + console.error("Unexpected error looking up client:", error); + const serverError = new ServerError("Internal Server Error"); + res.status(500).json(serverError.toResponseObject()); + } + return; + } + // Phase 2: Validate other parameters. Any errors here should go into redirect responses. + let state; + try { + // Parse and validate authorization parameters + const parseResult = RequestAuthorizationParamsSchema.safeParse(req.method === 'POST' ? req.body : req.query); + if (!parseResult.success) { + throw new InvalidRequestError(parseResult.error.message); + } + const { scope, code_challenge } = parseResult.data; + state = parseResult.data.state; + // Validate scopes + let requestedScopes = []; + if (scope !== undefined) { + requestedScopes = scope.split(" "); + const allowedScopes = new Set((_a = client.scope) === null || _a === void 0 ? void 0 : _a.split(" ")); + // Check each requested scope against allowed scopes + for (const scope of requestedScopes) { + if (!allowedScopes.has(scope)) { + throw new InvalidScopeError(`Client was not registered with scope ${scope}`); + } + } + } + // All validation passed, proceed with authorization + await provider.authorize(client, { + state, + scopes: requestedScopes, + redirectUri: redirect_uri, + codeChallenge: code_challenge, + }, res); + } + catch (error) { + // Post-redirect errors - redirect with error parameters + if (error instanceof OAuthError) { + res.redirect(302, createErrorRedirect(redirect_uri, error, state)); + } + else { + console.error("Unexpected error during authorization:", error); + const serverError = new ServerError("Internal Server Error"); + res.redirect(302, createErrorRedirect(redirect_uri, serverError, state)); + } + } + }); + return router; +} +/** + * Helper function to create redirect URL with error parameters + */ +function createErrorRedirect(redirectUri, error, state) { + const errorUrl = new URL(redirectUri); + errorUrl.searchParams.set("error", error.errorCode); + errorUrl.searchParams.set("error_description", error.message); + if (error.errorUri) { + errorUrl.searchParams.set("error_uri", error.errorUri); + } + if (state) { + errorUrl.searchParams.set("state", state); + } + return errorUrl.href; +} +//# sourceMappingURL=authorize.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/authorize.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/authorize.js.map new file mode 100644 index 0000000000..d89ce4c7d8 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/authorize.js.map @@ -0,0 +1 @@ +{"version":3,"file":"authorize.js","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/authorize.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAE,SAAS,EAA+B,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,WAAW,EACX,oBAAoB,EACpB,UAAU,EACX,MAAM,cAAc,CAAC;AAWtB,iEAAiE;AACjE,MAAM,+BAA+B,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,IAAI,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,kCAAkC,EAAE,CAAC;CACnJ,CAAC,CAAC;AAEH,yHAAyH;AACzH,MAAM,gCAAgC,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;IAChC,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;IAC1B,qBAAqB,EAAE,C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Y,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;IACzD,CAAC;IACD,IAAI,KAAK,EAAE,CAAC;QACV,QAAQ,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC5C,CAAC;IACD,OAAO,QAAQ,CAAC,IAAI,CAAC;AACvB,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/metadata.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/metadata.d.ts new file mode 100644 index 0000000000..f2a4c87f93 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/metadata.d.ts @@ -0,0 +1,4 @@ +import { RequestHandler } from "express"; +import { OAuthMetadata, OAuthProtectedResourceMetadata } from "../../../shared/auth.js"; +export declare function metadataHandler(metadata: OAuthMetadata | OAuthProtectedResourceMetadata): RequestHandler; +//# sourceMappingURL=metadata.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/metadata.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/metadata.d.ts.map new file mode 100644 index 0000000000..55e3a50dc1 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/metadata.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/metadata.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,8BAA8B,EAAE,MAAM,yBAAyB,CAAC;AAIxF,wBAAgB,eAAe,CAAC,QAAQ,EAAE,aAAa,GAAG,8BAA8B,GAAG,cAAc,CAaxG"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/metadata.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/metadata.js new file mode 100644 index 0000000000..2dbefe89ff --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/metadata.js @@ -0,0 +1,15 @@ +import express from "express"; +import cors from 'cors'; +import { allowedMethods } from "../middleware/allowedMethods.js"; +export function metadataHandler(metadata) { + // Nested router so we can configure middleware and restrict HTTP method + const router = express.Router(); + // Configure CORS to allow any origin, to make accessible to web-based MCP clients + router.use(cors()); + router.use(allowedMethods(['GET'])); + router.get("/", (req, res) => { + res.status(200).json(metadata); + }); + return router; +} +//# sourceMappingURL=metadata.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/metadata.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/metadata.js.map new file mode 100644 index 0000000000..9b49927c04 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/metadata.js.map @@ -0,0 +1 @@ +{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/metadata.ts"],"names":[],"mappings":"AAAA,OAAO,OAA2B,MAAM,SAAS,CAAC;AAElD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjE,MAAM,UAAU,eAAe,CAAC,QAAwD;IACtF,wEAAwE;IACxE,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAEhC,kFAAkF;IAClF,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IAEnB,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACpC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QAC3B,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACjC,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/register.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/register.d.ts new file mode 100644 index 0000000000..75af4dad8e --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/register.d.ts @@ -0,0 +1,23 @@ +import { RequestHandler } from "express"; +import { OAuthRegisteredClientsStore } from "../clients.js"; +import { Options as RateLimitOptions } from "express-rate-limit"; +export type ClientRegistrationHandlerOptions = { + /** + * A store used to save information about dynamically registered OAuth clients. + */ + clientsStore: OAuthRegisteredClientsStore; + /** + * The number of seconds after which to expire issued client secrets, or 0 to prevent expiration of client secrets (not recommended). + * + * If not set, defaults to 30 days. + */ + clientSecretExpirySeconds?: number; + /** + * Rate limiting configuration for the client registration endpoint. + * Set to false to disable rate limiting for this endpoint. + * Registration endpoints are particularly sensitive to abuse and should be rate limited. + */ + rateLimit?: Partial | false; +}; +export declare function clientRegistrationHandler({ clientsStore, clientSecretExpirySeconds, rateLimit: rateLimitConfig }: ClientRegistrationHandlerOptions): RequestHandler; +//# sourceMappingURL=register.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/register.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/register.d.ts.map new file mode 100644 index 0000000000..833b1fb5fc --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/register.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/register.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAIlD,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAa,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAS5E,MAAM,MAAM,gCAAgC,GAAG;IAC7C;;OAEG;IACH,YAAY,EAAE,2BAA2B,CAAC;IAE1C;;;;OAIG;IACH,yBAAyB,CAAC,EAAE,MAAM,CAAC;IAEnC;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,KAAK,CAAC;CAC/C,CAAC;AAIF,wBAAgB,yBAAyB,CAAC,EACxC,YAAY,EACZ,yBAAgE,EAChE,SAAS,EAAE,eAAe,EAC3B,EAAE,gCAAgC,GAAG,cAAc,CAyEnD"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/register.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/register.js new file mode 100644 index 0000000000..2a95aa38fa --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/register.js @@ -0,0 +1,73 @@ +import express from "express"; +import { OAuthClientMetadataSchema } from "../../../shared/auth.js"; +import crypto from 'node:crypto'; +import cors from 'cors'; +import { rateLimit } from "express-rate-limit"; +import { allowedMethods } from "../middleware/allowedMethods.js"; +import { InvalidClientMetadataError, ServerError, TooManyRequestsError, OAuthError } from "../errors.js"; +const DEFAULT_CLIENT_SECRET_EXPIRY_SECONDS = 30 * 24 * 60 * 60; // 30 days +export function clientRegistrationHandler({ clientsStore, clientSecretExpirySeconds = DEFAULT_CLIENT_SECRET_EXPIRY_SECONDS, rateLimit: rateLimitConfig }) { + if (!clientsStore.registerClient) { + throw new Error("Client registration store does not support registering clients"); + } + // Nested router so we can configure middleware and restrict HTTP method + const router = express.Router(); + // Configure CORS to allow any origin, to make accessible to web-based MCP clients + router.use(cors()); + router.use(allowedMethods(["POST"])); + router.use(express.json()); + // Apply rate limiting unless explicitly disabled - stricter limits for registration + if (rateLimitConfig !== false) { + router.use(rateLimit({ + windowMs: 60 * 60 * 1000, // 1 hour + max: 20, // 20 requests per hour - stricter as registration is sensitive + standardHeaders: true, + legacyHeaders: false, + message: new TooManyRequestsError('You have exceeded the rate limit for client registration requests').toResponseObject(), + ...rateLimitConfig + })); + } + router.post("/", async (req, res) => { + res.setHeader('Cache-Control', 'no-store'); + try { + const parseResult = OAuthClientMetadataSchema.safeParse(req.body); + if (!parseResult.success) { + throw new InvalidClientMetadataError(parseResult.error.message); + } + const clientMetadata = parseResult.data; + const isPublicClient = clientMetadata.token_endpoint_auth_method === 'none'; + // Generate client credentials + const clientId = crypto.randomUUID(); + const clientSecret = isPublicClient + ? undefined + : crypto.randomBytes(32).toString('hex'); + const clientIdIssuedAt = Math.floor(Date.now() / 1000); + // Calculate client secret expiry time + const clientsDoExpire = clientSecretExpirySeconds > 0; + const secretExpiryTime = clientsDoExpire ? clientIdIssuedAt + clientSecretExpirySeconds : 0; + const clientSecretExpiresAt = isPublicClient ? undefined : secretExpiryTime; + let clientInfo = { + ...clientMetadata, + client_id: clientId, + client_secret: clientSecret, + client_id_issued_at: clientIdIssuedAt, + client_secret_expires_at: clientSecretExpiresAt, + }; + clientInfo = await clientsStore.registerClient(clientInfo); + res.status(201).json(clientInfo); + } + catch (error) { + if (error instanceof OAuthError) { + const status = error instanceof ServerError ? 500 : 400; + res.status(status).json(error.toResponseObject()); + } + else { + console.error("Unexpected error registering client:", error); + const serverError = new ServerError("Internal Server Error"); + res.status(500).json(serverError.toResponseObject()); + } + } + }); + return router; +} +//# sourceMappingURL=register.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/register.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/register.js.map new file mode 100644 index 0000000000..af9f7d78c3 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/register.js.map @@ -0,0 +1 @@ +{"version":3,"file":"register.js","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/register.ts"],"names":[],"mappings":"AAAA,OAAO,OAA2B,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C3B,mBAAmB,EAAE,gBAAgB;gBACrC,wBAAwB,EAAE,qBAAqB;aAChD,CAAC;YAEF,UAAU,GAAG,MAAM,YAAY,CAAC,cAAe,CAAC,UAAU,CAAC,CAAC;YAC5D,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACnC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,KAAK,YAAY,UAAU,EAAE,CAAC;gBAChC,MAAM,MAAM,GAAG,KAAK,YAAY,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;gBACxD,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACpD,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,KAAK,CAAC,sCAAsC,EAAE,KAAK,CAAC,CAAC;gBAC7D,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC,uBAAuB,CAAC,CAAC;gBAC7D,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACvD,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/revoke.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/revoke.d.ts new file mode 100644 index 0000000000..37b26ccf87 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/revoke.d.ts @@ -0,0 +1,13 @@ +import { OAuthServerProvider } from "../provider.js"; +import { RequestHandler } from "express"; +import { Options as RateLimitOptions } from "express-rate-limit"; +export type RevocationHandlerOptions = { + provider: OAuthServerProvider; + /** + * Rate limiting configuration for the token revocation endpoint. + * Set to false to disable rate limiting for this endpoint. + */ + rateLimit?: Partial | false; +}; +export declare function revocationHandler({ provider, rateLimit: rateLimitConfig }: RevocationHandlerOptions): RequestHandler; +//# sourceMappingURL=revoke.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/revoke.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/revoke.d.ts.map new file mode 100644 index 0000000000..ab5f228127 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/revoke.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"revoke.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/revoke.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAIlD,OAAO,EAAa,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAS5E,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,EAAE,mBAAmB,CAAC;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,KAAK,CAAC;CAC/C,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,EAAE,wBAAwB,GAAG,cAAc,CA4DpH"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/revoke.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/revoke.js new file mode 100644 index 0000000000..ae88983b8d --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/revoke.js @@ -0,0 +1,61 @@ +import express from "express"; +import cors from "cors"; +import { authenticateClient } from "../middleware/clientAuth.js"; +import { OAuthTokenRevocationRequestSchema } from "../../../shared/auth.js"; +import { rateLimit } from "express-rate-limit"; +import { allowedMethods } from "../middleware/allowedMethods.js"; +import { InvalidRequestError, ServerError, TooManyRequestsError, OAuthError } from "../errors.js"; +export function revocationHandler({ provider, rateLimit: rateLimitConfig }) { + if (!provider.revokeToken) { + throw new Error("Auth provider does not support revoking tokens"); + } + // Nested router so we can configure middleware and restrict HTTP method + const router = express.Router(); + // Configure CORS to allow any origin, to make accessible to web-based MCP clients + router.use(cors()); + router.use(allowedMethods(["POST"])); + router.use(express.urlencoded({ extended: false })); + // Apply rate limiting unless explicitly disabled + if (rateLimitConfig !== false) { + router.use(rateLimit({ + windowMs: 15 * 60 * 1000, // 15 minutes + max: 50, // 50 requests per windowMs + standardHeaders: true, + legacyHeaders: false, + message: new TooManyRequestsError('You have exceeded the rate limit for token revocation requests').toResponseObject(), + ...rateLimitConfig + })); + } + // Authenticate and extract client details + router.use(authenticateClient({ clientsStore: provider.clientsStore })); + router.post("/", async (req, res) => { + res.setHeader('Cache-Control', 'no-store'); + try { + const parseResult = OAuthTokenRevocationRequestSchema.safeParse(req.body); + if (!parseResult.success) { + throw new InvalidRequestError(parseResult.error.message); + } + const client = req.client; + if (!client) { + // This should never happen + console.error("Missing client information after authentication"); + throw new ServerError("Internal Server Error"); + } + await provider.revokeToken(client, parseResult.data); + res.status(200).json({}); + } + catch (error) { + if (error instanceof OAuthError) { + const status = error instanceof ServerError ? 500 : 400; + res.status(status).json(error.toResponseObject()); + } + else { + console.error("Unexpected error revoking token:", error); + const serverError = new ServerError("Internal Server Error"); + res.status(500).json(serverError.toResponseObject()); + } + } + }); + return router; +} +//# sourceMappingURL=revoke.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/revoke.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/revoke.js.map new file mode 100644 index 0000000000..bc5d8f2a52 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/revoke.js.map @@ -0,0 +1 @@ +{"version":3,"file":"revoke.js","sour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C;YACpD,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,KAAK,CAAC,kCAAkC,EAAE,KAAK,CAAC,CAAC;gBACzD,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC,uBAAuB,CAAC,CAAC;gBAC7D,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACvD,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/token.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/token.d.ts new file mode 100644 index 0000000000..ce8eb64af4 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/token.d.ts @@ -0,0 +1,13 @@ +import { RequestHandler } from "express"; +import { OAuthServerProvider } from "../provider.js"; +import { Options as RateLimitOptions } from "express-rate-limit"; +export type TokenHandlerOptions = { + provider: OAuthServerProvider; + /** + * Rate limiting configuration for the token endpoint. + * Set to false to disable rate limiting for this endpoint. + */ + rateLimit?: Partial | false; +}; +export declare function tokenHandler({ provider, rateLimit: rateLimitConfig }: TokenHandlerOptions): RequestHandler; +//# sourceMappingURL=token.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/token.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/token.d.ts.map new file mode 100644 index 0000000000..1358ed8c8f --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/token.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/token.ts"],"names":[],"mappings":"AACA,OAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAIrD,OAAO,EAAa,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAW5E,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,mBAAmB,CAAC;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,KAAK,CAAC;CAC/C,CAAC;AAiBF,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,EAAE,mBAAmB,GAAG,cAAc,CA6G1G"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/token.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/token.js new file mode 100644 index 0000000000..4b2f0ce090 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/token.js @@ -0,0 +1,107 @@ +import { z } from "zod"; +import express from "express"; +import cors from "cors"; +import { verifyChallenge } from "pkce-challenge"; +import { authenticateClient } from "../middleware/clientAuth.js"; +import { rateLimit } from "express-rate-limit"; +import { allowedMethods } from "../middleware/allowedMethods.js"; +import { InvalidRequestError, InvalidGrantError, UnsupportedGrantTypeError, ServerError, TooManyRequestsError, OAuthError } from "../errors.js"; +const TokenRequestSchema = z.object({ + grant_type: z.string(), +}); +const AuthorizationCodeGrantSchema = z.object({ + code: z.string(), + code_verifier: z.string(), + redirect_uri: z.string().optional(), +}); +const RefreshTokenGrantSchema = z.object({ + refresh_token: z.string(), + scope: z.string().optional(), +}); +export function tokenHandler({ provider, rateLimit: rateLimitConfig }) { + // Nested router so we can configure middleware and restrict HTTP method + const router = express.Router(); + // Configure CORS to allow any origin, to make accessible to web-based MCP clients + router.use(cors()); + router.use(allowedMethods(["POST"])); + router.use(express.urlencoded({ extended: false })); + // Apply rate limiting unless explicitly disabled + if (rateLimitConfig !== false) { + router.use(rateLimit({ + windowMs: 15 * 60 * 1000, // 15 minutes + max: 50, // 50 requests per windowMs + standardHeaders: true, + legacyHeaders: false, + message: new TooManyRequestsError('You have exceeded the rate limit for token requests').toResponseObject(), + ...rateLimitConfig + })); + } + // Authenticate and extract client details + router.use(authenticateClient({ clientsStore: provider.clientsStore })); + router.post("/", async (req, res) => { + res.setHeader('Cache-Control', 'no-store'); + try { + const parseResult = TokenRequestSchema.safeParse(req.body); + if (!parseResult.success) { + throw new InvalidRequestError(parseResult.error.message); + } + const { grant_type } = parseResult.data; + const client = req.client; + if (!client) { + // This should never happen + console.error("Missing client information after authentication"); + throw new ServerError("Internal Server Error"); + } + switch (grant_type) { + case "authorization_code": { + const parseResult = AuthorizationCodeGrantSchema.safeParse(req.body); + if (!parseResult.success) { + throw new InvalidRequestError(parseResult.error.message); + } + const { code, code_verifier, redirect_uri } = parseResult.data; + const skipLocalPkceValidation = provider.skipLocalPkceValidation; + // Perform local PKCE validation unless explicitly skipped + // (e.g. to validate code_verifier in upstream server) + if (!skipLocalPkceValidation) { + const codeChallenge = await provider.challengeForAuthorizationCode(client, code); + if (!(await verifyChallenge(code_verifier, codeChallenge))) { + throw new InvalidGrantError("code_verifier does not match the challenge"); + } + } + // Passes the code_verifier to the provider if PKCE validation didn't occur locally + const tokens = await provider.exchangeAuthorizationCode(client, code, skipLocalPkceValidation ? code_verifier : undefined, redirect_uri); + res.status(200).json(tokens); + break; + } + case "refresh_token": { + const parseResult = RefreshTokenGrantSchema.safeParse(req.body); + if (!parseResult.success) { + throw new InvalidRequestError(parseResult.error.message); + } + const { refresh_token, scope } = parseResult.data; + const scopes = scope === null || scope === void 0 ? void 0 : scope.split(" "); + const tokens = await provider.exchangeRefreshToken(client, refresh_token, scopes); + res.status(200).json(tokens); + break; + } + // Not supported right now + //case "client_credentials": + default: + throw new UnsupportedGrantTypeError("The grant type is not supported by this authorization server."); + } + } + catch (error) { + if (error instanceof OAuthError) { + const status = error instanceof ServerError ? 500 : 400; + res.status(status).json(error.toResponseObject()); + } + else { + console.error("Unexpected error exchanging token:", error); + const serverError = new ServerError("Internal Server Error"); + res.status(500).json(serverError.toResponseObject()); + } + } + }); + return router; +} +//# sourceMappingURL=token.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/token.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/token.js.map new file mode 100644 index 0000000000..d783fb7d92 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/handlers/token.js.map @@ -0,0 +1 @@ +{"version":3,"file":"token.js","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/token.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,OAA2B,MAAM,SAAS,CAAC;AAElD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,SAAS,EAA+B,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,yBAAyB,EACzB,WAAW,EACX,oBAAoB,EACpB,UAAU,EACX,MAAM,cAAc,CAAC;AAWtB,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;CACvB,CAAC,CAAC;AAEH,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;IACzB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACpC,CAAC,CAAC;AAEH,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,aAAa,EAAE,CA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,CAAC,CAAC;YACpD,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,KAAK,CAAC,oCAAoC,EAAE,KAAK,CAAC,CAAC;gBAC3D,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC,uBAAuB,CAAC,CAAC;gBAC7D,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACvD,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/allowedMethods.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/allowedMethods.d.ts new file mode 100644 index 0000000000..9583d3a1d1 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/allowedMethods.d.ts @@ -0,0 +1,9 @@ +import { RequestHandler } from "express"; +/** + * Middleware to handle unsupported HTTP methods with a 405 Method Not Allowed response. + * + * @param allowedMethods Array of allowed HTTP methods for this endpoint (e.g., ['GET', 'POST']) + * @returns Express middleware that returns a 405 error if method not in allowed list + */ +export declare function allowedMethods(allowedMethods: string[]): RequestHandler; +//# sourceMappingURL=allowedMethods.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/allowedMethods.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/allowedMethods.d.ts.map new file mode 100644 index 0000000000..45528c7ec6 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/allowedMethods.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"allowedMethods.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/middleware/allowedMethods.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGzC;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,cAAc,EAAE,MAAM,EAAE,GAAG,cAAc,CAYvE"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/allowedMethods.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/allowedMethods.js new file mode 100644 index 0000000000..319695845c --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/allowedMethods.js @@ -0,0 +1,20 @@ +import { MethodNotAllowedError } from "../errors.js"; +/** + * Middleware to handle unsupported HTTP methods with a 405 Method Not Allowed response. + * + * @param allowedMethods Array of allowed HTTP methods for this endpoint (e.g., ['GET', 'POST']) + * @returns Express middleware that returns a 405 error if method not in allowed list + */ +export function allowedMethods(allowedMethods) { + return (req, res, next) => { + if (allowedMethods.includes(req.method)) { + next(); + return; + } + const error = new MethodNotAllowedError(`The method ${req.method} is not allowed for this endpoint`); + res.status(405) + .set('Allow', allowedMethods.join(', ')) + .json(error.toResponseObject()); + }; +} +//# sourceMappingURL=allowedMethods.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/allowedMethods.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/allowedMethods.js.map new file mode 100644 index 0000000000..eee4c939be --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/allowedMethods.js.map @@ -0,0 +1 @@ +{"version":3,"file":"allowedMethods.js","sourceRoot":"","sources":["../../../../../src/server/auth/middleware/allowedMethods.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAErD;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,cAAwB;IACrD,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QACxB,IAAI,cAAc,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YACxC,IAAI,EAAE,CAAC;YACP,OAAO;QACT,CAAC;QAED,MAAM,KAAK,GAAG,IAAI,qBAAqB,CAAC,cAAc,GAAG,CAAC,MAAM,mCAAmC,CAAC,CAAC;QACrG,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC;aACZ,GAAG,CAAC,OAAO,EAAE,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aACvC,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC;IACpC,CAAC,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/bearerAuth.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/bearerAuth.d.ts new file mode 100644 index 0000000000..282068602a --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/bearerAuth.d.ts @@ -0,0 +1,35 @@ +import { RequestHandler } from "express"; +import { OAuthTokenVerifier } from "../provider.js"; +import { AuthInfo } from "../types.js"; +export type BearerAuthMiddlewareOptions = { + /** + * A provider used to verify tokens. + */ + verifier: OAuthTokenVerifier; + /** + * Optional scopes that the token must have. + */ + requiredScopes?: string[]; + /** + * Optional resource metadata URL to include in WWW-Authenticate header. + */ + resourceMetadataUrl?: string; +}; +declare module "express-serve-static-core" { + interface Request { + /** + * Information about the validated access token, if the `requireBearerAuth` middleware was used. + */ + auth?: AuthInfo; + } +} +/** + * Middleware that requires a valid Bearer token in the Authorization header. + * + * This will validate the token with the auth provider and add the resulting auth info to the request object. + * + * If resourceMetadataUrl is provided, it will be included in the WWW-Authenticate header + * for 401 responses as per the OAuth 2.0 Protected Resource Metadata spec. + */ +export declare function requireBearerAuth({ verifier, requiredScopes, resourceMetadataUrl }: BearerAuthMiddlewareOptions): RequestHandler; +//# sourceMappingURL=bearerAuth.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/bearerAuth.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/bearerAuth.d.ts.map new file mode 100644 index 0000000000..eeefa1996f --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/bearerAuth.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"bearerAuth.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/middleware/bearerAuth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,MAAM,2BAA2B,GAAG;IACxC;;OAEG;IACH,QAAQ,EAAE,kBAAkB,CAAC;IAE7B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAE1B;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,OAAO,QAAQ,2BAA2B,CAAC;IACzC,UAAU,OAAO;QACf;;WAEG;QACH,IAAI,CAAC,EAAE,QAAQ,CAAC;KACjB;CACF;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,cAAmB,EAAE,mBAAmB,EAAE,EAAE,2BAA2B,GAAG,cAAc,CAyDrI"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/bearerAuth.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/bearerAuth.js new file mode 100644 index 0000000000..7b774ff150 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/bearerAuth.js @@ -0,0 +1,65 @@ +import { InsufficientScopeError, InvalidTokenError, OAuthError, ServerError } from "../errors.js"; +/** + * Middleware that requires a valid Bearer token in the Authorization header. + * + * This will validate the token with the auth provider and add the resulting auth info to the request object. + * + * If resourceMetadataUrl is provided, it will be included in the WWW-Authenticate header + * for 401 responses as per the OAuth 2.0 Protected Resource Metadata spec. + */ +export function requireBearerAuth({ verifier, requiredScopes = [], resourceMetadataUrl }) { + return async (req, res, next) => { + try { + const authHeader = req.headers.authorization; + if (!authHeader) { + throw new InvalidTokenError("Missing Authorization header"); + } + const [type, token] = authHeader.split(' '); + if (type.toLowerCase() !== 'bearer' || !token) { + throw new InvalidTokenError("Invalid Authorization header format, expected 'Bearer TOKEN'"); + } + const authInfo = await verifier.verifyAccessToken(token); + // Check if token has the required scopes (if any) + if (requiredScopes.length > 0) { + const hasAllScopes = requiredScopes.every(scope => authInfo.scopes.includes(scope)); + if (!hasAllScopes) { + throw new InsufficientScopeError("Insufficient scope"); + } + } + // Check if the token is expired + if (!!authInfo.expiresAt && authInfo.expiresAt < Date.now() / 1000) { + throw new InvalidTokenError("Token has expired"); + } + req.auth = authInfo; + next(); + } + catch (error) { + if (error instanceof InvalidTokenError) { + const wwwAuthValue = resourceMetadataUrl + ? `Bearer error="${error.errorCode}", error_description="${error.message}", resource_metadata="${resourceMetadataUrl}"` + : `Bearer error="${error.errorCode}", error_description="${error.message}"`; + res.set("WWW-Authenticate", wwwAuthValue); + res.status(401).json(error.toResponseObject()); + } + else if (error instanceof InsufficientScopeError) { + const wwwAuthValue = resourceMetadataUrl + ? `Bearer error="${error.errorCode}", error_description="${error.message}", resource_metadata="${resourceMetadataUrl}"` + : `Bearer error="${error.errorCode}", error_description="${error.message}"`; + res.set("WWW-Authenticate", wwwAuthValue); + res.status(403).json(error.toResponseObject()); + } + else if (error instanceof ServerError) { + res.status(500).json(error.toResponseObject()); + } + else if (error instanceof OAuthError) { + res.status(400).json(error.toResponseObject()); + } + else { + console.error("Unexpected error authenticating bearer token:", error); + const serverError = new ServerError("Internal Server Error"); + res.status(500).json(serverError.toResponseObject()); + } + } + }; +} +//# sourceMappingURL=bearerAuth.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/bearerAuth.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/bearerAuth.js.map new file mode 100644 index 0000000000..f577e9dd0d --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/bearerAuth.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bearerAuth.js","sourceRoot":"","sources":["../../../../../src/server/auth/middleware/bearerAuth.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AA8BlG;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAAE,QAAQ,EAAE,cAAc,GAAG,EAAE,EAAE,mBAAmB,EAA+B;IACnH,OAAO,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QAC9B,IAAI,CAAC;YACH,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC;YAC7C,IAAI,CAAC,UAAU,EAAE,CAAC;gBAChB,MAAM,IAAI,iBAAiB,CAAC,8BAA8B,CAAC,CAAC;YAC9D,CAAC;YAED,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC5C,IAAI,IAAI,CAAC,WAAW,EAAE,KAAK,QAAQ,IAAI,CAAC,KAAK,EAAE,CAAC;gBAC9C,MAAM,IAAI,iBAAiB,CAAC,8DAA8D,CAAC,CAAC;YAC9F,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAEzD,kDAAkD;YAClD,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC9B,MAAM,YAAY,GAAG,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAChD,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAChC,CAAC;gBAEF,I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AAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACjD,CAAC;iBAAM,IAAI,KAAK,YAAY,WAAW,EAAE,CAAC;gBACxC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACjD,CAAC;iBAAM,IAAI,KAAK,YAAY,UAAU,EAAE,CAAC;gBACvC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACjD,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,KAAK,CAAC,+CAA+C,EAAE,KAAK,CAAC,CAAC;gBACtE,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC,uBAAuB,CAAC,CAAC;gBAC7D,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACvD,CAAC;QACH,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/clientAuth.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/clientAuth.d.ts new file mode 100644 index 0000000000..4a7cd370d8 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/clientAuth.d.ts @@ -0,0 +1,19 @@ +import { RequestHandler } from "express"; +import { OAuthRegisteredClientsStore } from "../clients.js"; +import { OAuthClientInformationFull } from "../../../shared/auth.js"; +export type ClientAuthenticationMiddlewareOptions = { + /** + * A store used to read information about registered OAuth clients. + */ + clientsStore: OAuthRegisteredClientsStore; +}; +declare module "express-serve-static-core" { + interface Request { + /** + * The authenticated client for this request, if the `authenticateClient` middleware was used. + */ + client?: OAuthClientInformationFull; + } +} +export declare function authenticateClient({ clientsStore }: ClientAuthenticationMiddlewareOptions): RequestHandler; +//# sourceMappingURL=clientAuth.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/clientAuth.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/clientAuth.d.ts.map new file mode 100644 index 0000000000..a2f6c79cfb --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/clientAuth.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"clientAuth.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/middleware/clientAuth.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAGrE,MAAM,MAAM,qCAAqC,GAAG;IAClD;;OAEG;IACH,YAAY,EAAE,2BAA2B,CAAC;CAC3C,CAAA;AAOD,OAAO,QAAQ,2BAA2B,CAAC;IACzC,UAAU,OAAO;QACf;;WAEG;QACH,MAAM,CAAC,EAAE,0BAA0B,CAAC;KACrC;CACF;AAED,wBAAgB,kBAAkB,CAAC,EAAE,YAAY,EAAE,EAAE,qCAAqC,GAAG,cAAc,CA6C1G"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/clientAuth.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/clientAuth.js new file mode 100644 index 0000000000..e473b91e9a --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/clientAuth.js @@ -0,0 +1,50 @@ +import { z } from "zod"; +import { InvalidRequestError, InvalidClientError, ServerError, OAuthError } from "../errors.js"; +const ClientAuthenticatedRequestSchema = z.object({ + client_id: z.string(), + client_secret: z.string().optional(), +}); +export function authenticateClient({ clientsStore }) { + return async (req, res, next) => { + try { + const result = ClientAuthenticatedRequestSchema.safeParse(req.body); + if (!result.success) { + throw new InvalidRequestError(String(result.error)); + } + const { client_id, client_secret } = result.data; + const client = await clientsStore.getClient(client_id); + if (!client) { + throw new InvalidClientError("Invalid client_id"); + } + // If client has a secret, validate it + if (client.client_secret) { + // Check if client_secret is required but not provided + if (!client_secret) { + throw new InvalidClientError("Client secret is required"); + } + // Check if client_secret matches + if (client.client_secret !== client_secret) { + throw new InvalidClientError("Invalid client_secret"); + } + // Check if client_secret has expired + if (client.client_secret_expires_at && client.client_secret_expires_at < Math.floor(Date.now() / 1000)) { + throw new InvalidClientError("Client secret has expired"); + } + } + req.client = client; + next(); + } + catch (error) { + if (error instanceof OAuthError) { + const status = error instanceof ServerError ? 500 : 400; + res.status(status).json(error.toResponseObject()); + } + else { + console.error("Unexpected error authenticating client:", error); + const serverError = new ServerError("Internal Server Error"); + res.status(500).json(serverError.toResponseObject()); + } + } + }; +} +//# sourceMappingURL=clientAuth.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/clientAuth.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/clientAuth.js.map new file mode 100644 index 0000000000..98f5e24f45 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/middleware/clientAuth.js.map @@ -0,0 +1 @@ +{"version":3,"file":"clientAuth.js","sourceRoot":"","sources":["../../../../../src/server/auth/middleware/clientAuth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAShG,MAAM,gCAAgC,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACrC,CAAC,CAAC;AAWH,MAAM,UAAU,kBAAkB,CAAC,EAAE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AAI,KAAK,YAAY,UAAU,EAAE,CAAC;gBAChC,MAAM,MAAM,GAAG,KAAK,YAAY,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;gBACxD,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACpD,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,KAAK,CAAC,yCAAyC,EAAE,KAAK,CAAC,CAAC;gBAChE,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC,uBAAuB,CAAC,CAAC;gBAC7D,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACvD,CAAC;QACH,CAAC;IACH,CAAC,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/provider.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/provider.d.ts new file mode 100644 index 0000000000..07e735bf4f --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/provider.d.ts @@ -0,0 +1,67 @@ +import { Response } from "express"; +import { OAuthRegisteredClientsStore } from "./clients.js"; +import { OAuthClientInformationFull, OAuthTokenRevocationRequest, OAuthTokens } from "../../shared/auth.js"; +import { AuthInfo } from "./types.js"; +export type AuthorizationParams = { + state?: string; + scopes?: string[]; + codeChallenge: string; + redirectUri: string; +}; +/** + * Implements an end-to-end OAuth server. + */ +export interface OAuthServerProvider { + /** + * A store used to read information about registered OAuth clients. + */ + get clientsStore(): OAuthRegisteredClientsStore; + /** + * Begins the authorization flow, which can either be implemented by this server itself or via redirection to a separate authorization server. + * + * This server must eventually issue a redirect with an authorization response or an error response to the given redirect URI. Per OAuth 2.1: + * - In the successful case, the redirect MUST include the `code` and `state` (if present) query parameters. + * - In the error case, the redirect MUST include the `error` query parameter, and MAY include an optional `error_description` query parameter. + */ + authorize(client: OAuthClientInformationFull, params: AuthorizationParams, res: Response): Promise; + /** + * Returns the `codeChallenge` that was used when the indicated authorization began. + */ + challengeForAuthorizationCode(client: OAuthClientInformationFull, authorizationCode: string): Promise; + /** + * Exchanges an authorization code for an access token. + */ + exchangeAuthorizationCode(client: OAuthClientInformationFull, authorizationCode: string, codeVerifier?: string, redirectUri?: string): Promise; + /** + * Exchanges a refresh token for an access token. + */ + exchangeRefreshToken(client: OAuthClientInformationFull, refreshToken: string, scopes?: string[]): Promise; + /** + * Verifies an access token and returns information about it. + */ + verifyAccessToken(token: string): Promise; + /** + * Revokes an access or refresh token. If unimplemented, token revocation is not supported (not recommended). + * + * If the given token is invalid or already revoked, this method should do nothing. + */ + revokeToken?(client: OAuthClientInformationFull, request: OAuthTokenRevocationRequest): Promise; + /** + * Whether to skip local PKCE validation. + * + * If true, the server will not perform PKCE validation locally and will pass the code_verifier to the upstream server. + * + * NOTE: This should only be true if the upstream server is performing the actual PKCE validation. + */ + skipLocalPkceValidation?: boolean; +} +/** + * Slim implementation useful for token verification + */ +export interface OAuthTokenVerifier { + /** + * Verifies an access token and returns information about it. + */ + verifyAccessToken(token: string): Promise; +} +//# sourceMappingURL=provider.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/provider.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/provider.d.ts.map new file mode 100644 index 0000000000..8762b37be3 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/provider.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../../src/server/auth/provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,WAAW,EAAE,MAAM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AkB;IACjC;;OAEG;IACH,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;CACrD"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/provider.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/provider.js new file mode 100644 index 0000000000..be31058cd5 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/provider.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=provider.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/provider.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/provider.js.map new file mode 100644 index 0000000000..b968414aa9 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/provider.js.map @@ -0,0 +1 @@ +{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../../../src/server/auth/provider.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/providers/proxyProvider.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/providers/proxyProvider.d.ts new file mode 100644 index 0000000000..270d1da6da --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/providers/proxyProvider.d.ts @@ -0,0 +1,43 @@ +import { Response } from "express"; +import { OAuthRegisteredClientsStore } from "../clients.js"; +import { OAuthClientInformationFull, OAuthTokenRevocationRequest, OAuthTokens } from "../../../shared/auth.js"; +import { AuthInfo } from "../types.js"; +import { AuthorizationParams, OAuthServerProvider } from "../provider.js"; +export type ProxyEndpoints = { + authorizationUrl: string; + tokenUrl: string; + revocationUrl?: string; + registrationUrl?: string; +}; +export type ProxyOptions = { + /** + * Individual endpoint URLs for proxying specific OAuth operations + */ + endpoints: ProxyEndpoints; + /** + * Function to verify access tokens and return auth info + */ + verifyAccessToken: (token: string) => Promise; + /** + * Function to fetch client information from the upstream server + */ + getClient: (clientId: string) => Promise; +}; +/** + * Implements an OAuth server that proxies requests to another OAuth server. + */ +export declare class ProxyOAuthServerProvider implements OAuthServerProvider { + protected readonly _endpoints: ProxyEndpoints; + protected readonly _verifyAccessToken: (token: string) => Promise; + protected readonly _getClient: (clientId: string) => Promise; + skipLocalPkceValidation: boolean; + revokeToken?: (client: OAuthClientInformationFull, request: OAuthTokenRevocationRequest) => Promise; + constructor(options: ProxyOptions); + get clientsStore(): OAuthRegisteredClientsStore; + authorize(client: OAuthClientInformationFull, params: AuthorizationParams, res: Response): Promise; + challengeForAuthorizationCode(_client: OAuthClientInformationFull, _authorizationCode: string): Promise; + exchangeAuthorizationCode(client: OAuthClientInformationFull, authorizationCode: string, codeVerifier?: string, redirectUri?: string): Promise; + exchangeRefreshToken(client: OAuthClientInformationFull, refreshToken: string, scopes?: string[]): Promise; + verifyAccessToken(token: string): Promise; +} +//# sourceMappingURL=proxyProvider.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/providers/proxyProvider.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/providers/proxyProvider.d.ts.map new file mode 100644 index 0000000000..84d4d80755 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/providers/proxyProvider.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"proxyProvider.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/providers/proxyProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EACL,0BAA0B,EAE1B,2BAA2B,EAC3B,WAAW,EAEZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAA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yBAAyB,CAC7B,MAAM,EAAE,0BAA0B,EAClC,iBAAiB,EAAE,MAAM,EACzB,YAAY,CAAC,EAAE,MAAM,EACrB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,WAAW,CAAC;IAoCjB,oBAAoB,CACxB,MAAM,EAAE,0BAA0B,EAClC,YAAY,EAAE,MAAM,EACpB,MAAM,CAAC,EAAE,MAAM,EAAE,GAChB,OAAO,CAAC,WAAW,CAAC;IAgCjB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;CAG1D"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/providers/proxyProvider.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/providers/proxyProvider.js new file mode 100644 index 0000000000..b9f78f77d2 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/providers/proxyProvider.js @@ -0,0 +1,144 @@ +import { OAuthClientInformationFullSchema, OAuthTokensSchema, } from "../../../shared/auth.js"; +import { ServerError } from "../errors.js"; +/** + * Implements an OAuth server that proxies requests to another OAuth server. + */ +export class ProxyOAuthServerProvider { + constructor(options) { + var _a; + this.skipLocalPkceValidation = true; + this._endpoints = options.endpoints; + this._verifyAccessToken = options.verifyAccessToken; + this._getClient = options.getClient; + if ((_a = options.endpoints) === null || _a === void 0 ? void 0 : _a.revocationUrl) { + this.revokeToken = async (client, request) => { + const revocationUrl = this._endpoints.revocationUrl; + if (!revocationUrl) { + throw new Error("No revocation endpoint configured"); + } + const params = new URLSearchParams(); + params.set("token", request.token); + params.set("client_id", client.client_id); + if (client.client_secret) { + params.set("client_secret", client.client_secret); + } + if (request.token_type_hint) { + params.set("token_type_hint", request.token_type_hint); + } + const response = await fetch(revocationUrl, { + method: "POST", + headers: { + "Content-Type": "application/x-www-form-urlencoded", + }, + body: params.toString(), + }); + if (!response.ok) { + throw new ServerError(`Token revocation failed: ${response.status}`); + } + }; + } + } + get clientsStore() { + const registrationUrl = this._endpoints.registrationUrl; + return { + getClient: this._getClient, + ...(registrationUrl && { + registerClient: async (client) => { + const response = await fetch(registrationUrl, { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(client), + }); + if (!response.ok) { + throw new ServerError(`Client registration failed: ${response.status}`); + } + const data = await response.json(); + return OAuthClientInformationFullSchema.parse(data); + } + }) + }; + } + async authorize(client, params, res) { + var _a; + // Start with required OAuth parameters + const targetUrl = new URL(this._endpoints.authorizationUrl); + const searchParams = new URLSearchParams({ + client_id: client.client_id, + response_type: "code", + redirect_uri: params.redirectUri, + code_challenge: params.codeChallenge, + code_challenge_method: "S256" + }); + // Add optional standard OAuth parameters + if (params.state) + searchParams.set("state", params.state); + if ((_a = params.scopes) === null || _a === void 0 ? void 0 : _a.length) + searchParams.set("scope", params.scopes.join(" ")); + targetUrl.search = searchParams.toString(); + res.redirect(targetUrl.toString()); + } + async challengeForAuthorizationCode(_client, _authorizationCode) { + // In a proxy setup, we don't store the code challenge ourselves + // Instead, we proxy the token request and let the upstream server validate it + return ""; + } + async exchangeAuthorizationCode(client, authorizationCode, codeVerifier, redirectUri) { + const params = new URLSearchParams({ + grant_type: "authorization_code", + client_id: client.client_id, + code: authorizationCode, + }); + if (client.client_secret) { + params.append("client_secret", client.client_secret); + } + if (codeVerifier) { + params.append("code_verifier", codeVerifier); + } + if (redirectUri) { + params.append("redirect_uri", redirectUri); + } + const response = await fetch(this._endpoints.tokenUrl, { + method: "POST", + headers: { + "Content-Type": "application/x-www-form-urlencoded", + }, + body: params.toString(), + }); + if (!response.ok) { + throw new ServerError(`Token exchange failed: ${response.status}`); + } + const data = await response.json(); + return OAuthTokensSchema.parse(data); + } + async exchangeRefreshToken(client, refreshToken, scopes) { + const params = new URLSearchParams({ + grant_type: "refresh_token", + client_id: client.client_id, + refresh_token: refreshToken, + }); + if (client.client_secret) { + params.set("client_secret", client.client_secret); + } + if (scopes === null || scopes === void 0 ? void 0 : scopes.length) { + params.set("scope", scopes.join(" ")); + } + const response = await fetch(this._endpoints.tokenUrl, { + method: "POST", + headers: { + "Content-Type": "application/x-www-form-urlencoded", + }, + body: params.toString(), + }); + if (!response.ok) { + throw new ServerError(`Token refresh failed: ${response.status}`); + } + const data = await response.json(); + return OAuthTokensSchema.parse(data); + } + async verifyAccessToken(token) { + return this._verifyAccessToken(token); + } +} +//# sourceMappingURL=proxyProvider.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/providers/proxyProvider.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/providers/proxyProvider.js.map new file mode 100644 index 0000000000..9fa932b1ec --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/providers/proxyProvider.js.map @@ -0,0 +1 @@ +{"version":3,"file":"proxyProvider.js","sourceRoot":"","sources":["../../../../../src/server/auth/providers/proxyProvider.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,gCAAgC,EAGhC,iBAAiB,GAClB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AA2B3C;;GAEG;AACH,MAAM,OAAO,wBAAwB;IAYnC,YAAY,OAAqB;;QAPjC,4BAAuB,GAAG,IAAI,CAAC;QAQ7B,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC;QACpC,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC;QACpD,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC;QACpC,IAAI,MAAA,OAAO,CAAC,SAAS,0CAAE,aAAa,EAAE,CAAC;YACrC,IAAI,CAAC,WAAW,GAAG,KAAK,EACtB,MAAkC,EAClC,OAAoC,EACpC,EAAE;gBACF,MAAM,aAAa,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;gBAEpD,IAAI,CAAC,aAAa,EAAE,CAAC;oBACnB,MAAM,IAAI,KAAK,CAA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AS,EAAE,MAAM,CAAC,SAAS;YAC3B,aAAa,EAAE,YAAY;SAC5B,CAAC,CAAC;QAEH,IAAI,MAAM,CAAC,aAAa,EAAE,CAAC;YACzB,MAAM,CAAC,GAAG,CAAC,eAAe,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC;QACpD,CAAC;QAED,IAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,EAAE,CAAC;YACnB,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QACxC,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE;YACrD,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,cAAc,EAAE,mCAAmC;aACpD;YACD,IAAI,EAAE,MAAM,CAAC,QAAQ,EAAE;SACxB,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,MAAM,IAAI,WAAW,CAAC,yBAAyB,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;QACpE,CAAC;QAED,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QACnC,OAAO,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,KAAa;QACnC,OAAO,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;CACF"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/router.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/router.d.ts new file mode 100644 index 0000000000..55b2e743f4 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/router.d.ts @@ -0,0 +1,96 @@ +import { RequestHandler } from "express"; +import { ClientRegistrationHandlerOptions } from "./handlers/register.js"; +import { TokenHandlerOptions } from "./handlers/token.js"; +import { AuthorizationHandlerOptions } from "./handlers/authorize.js"; +import { RevocationHandlerOptions } from "./handlers/revoke.js"; +import { OAuthServerProvider } from "./provider.js"; +import { OAuthMetadata } from "../../shared/auth.js"; +export type AuthRouterOptions = { + /** + * A provider implementing the actual authorization logic for this router. + */ + provider: OAuthServerProvider; + /** + * The authorization server's issuer identifier, which is a URL that uses the "https" scheme and has no query or fragment components. + */ + issuerUrl: URL; + /** + * The base URL of the authorization server to use for the metadata endpoints. + * + * If not provided, the issuer URL will be used as the base URL. + */ + baseUrl?: URL; + /** + * An optional URL of a page containing human-readable information that developers might want or need to know when using the authorization server. + */ + serviceDocumentationUrl?: URL; + /** + * An optional list of scopes supported by this authorization server + */ + scopesSupported?: string[]; + /** + * The resource name to be displayed in protected resource metadata + */ + resourceName?: string; + authorizationOptions?: Omit; + clientRegistrationOptions?: Omit; + revocationOptions?: Omit; + tokenOptions?: Omit; +}; +export declare const createOAuthMetadata: (options: { + provider: OAuthServerProvider; + issuerUrl: URL; + baseUrl?: URL; + serviceDocumentationUrl?: URL; + scopesSupported?: string[]; +}) => OAuthMetadata; +/** + * Installs standard MCP authorization server endpoints, including dynamic client registration and token revocation (if supported). + * Also advertises standard authorization server metadata, for easier discovery of supported configurations by clients. + * Note: if your MCP server is only a resource server and not an authorization server, use mcpAuthMetadataRouter instead. + * + * By default, rate limiting is applied to all endpoints to prevent abuse. + * + * This router MUST be installed at the application root, like so: + * + * const app = express(); + * app.use(mcpAuthRouter(...)); + */ +export declare function mcpAuthRouter(options: AuthRouterOptions): RequestHandler; +export type AuthMetadataOptions = { + /** + * OAuth Metadata as would be returned from the authorization server + * this MCP server relies on + */ + oauthMetadata: OAuthMetadata; + /** + * The url of the MCP server, for use in protected resource metadata + */ + resourceServerUrl: URL; + /** + * The url for documentation for the MCP server + */ + serviceDocumentationUrl?: URL; + /** + * An optional list of scopes supported by this MCP server + */ + scopesSupported?: string[]; + /** + * An optional resource name to display in resource metadata + */ + resourceName?: string; +}; +export declare function mcpAuthMetadataRouter(options: AuthMetadataOptions): import("express-serve-static-core").Router; +/** + * Helper function to construct the OAuth 2.0 Protected Resource Metadata URL + * from a given server URL. This replaces the path with the standard metadata endpoint. + * + * @param serverUrl - The base URL of the protected resource server + * @returns The URL for the OAuth protected resource metadata endpoint + * + * @example + * getOAuthProtectedResourceMetadataUrl(new URL('https://api.example.com/mcp')) + * // Returns: 'https://api.example.com/.well-known/oauth-protected-resource' + */ +export declare function getOAuthProtectedResourceMetadataUrl(serverUrl: URL): string; +//# sourceMappingURL=router.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/router.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/router.d.ts.map new file mode 100644 index 0000000000..0434374c4f --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/router.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../../src/server/auth/router.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAA6B,gCAAgC,EAAE,MAAM,wBAAwB,CAAC;AACrG,OAAO,EAAgB,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAwB,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAC5F,OAAO,EAAqB,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAEnF,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,aAAa,EAAkC,MAAM,sBAAsB,CAAC;AAErF,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,QAAQ,EAAE,mBAAmB,CAAC;IAE9B;;OAEG;IACH,SAAS,EAAE,GAAG,CAAC;IAEf;;;;OAIG;IACH,OAAO,CAAC,EAAE,GAAG,CAAC;IAEd;;OAEG;IACH,uBAAuB,CAA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m/server/auth/router.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/router.js new file mode 100644 index 0000000000..49f5c9dbe1 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/router.js @@ -0,0 +1,112 @@ +import express from "express"; +import { clientRegistrationHandler } from "./handlers/register.js"; +import { tokenHandler } from "./handlers/token.js"; +import { authorizationHandler } from "./handlers/authorize.js"; +import { revocationHandler } from "./handlers/revoke.js"; +import { metadataHandler } from "./handlers/metadata.js"; +const checkIssuerUrl = (issuer) => { + // Technically RFC 8414 does not permit a localhost HTTPS exemption, but this will be necessary for ease of testing + if (issuer.protocol !== "https:" && issuer.hostname !== "localhost" && issuer.hostname !== "127.0.0.1") { + throw new Error("Issuer URL must be HTTPS"); + } + if (issuer.hash) { + throw new Error(`Issuer URL must not have a fragment: ${issuer}`); + } + if (issuer.search) { + throw new Error(`Issuer URL must not have a query string: ${issuer}`); + } +}; +export const createOAuthMetadata = (options) => { + var _a; + const issuer = options.issuerUrl; + const baseUrl = options.baseUrl; + checkIssuerUrl(issuer); + const authorization_endpoint = "/authorize"; + const token_endpoint = "/token"; + const registration_endpoint = options.provider.clientsStore.registerClient ? "/register" : undefined; + const revocation_endpoint = options.provider.revokeToken ? "/revoke" : undefined; + const metadata = { + issuer: issuer.href, + service_documentation: (_a = options.serviceDocumentationUrl) === null || _a === void 0 ? void 0 : _a.href, + authorization_endpoint: new URL(authorization_endpoint, baseUrl || issuer).href, + response_types_supported: ["code"], + code_challenge_methods_supported: ["S256"], + token_endpoint: new URL(token_endpoint, baseUrl || issuer).href, + token_endpoint_auth_methods_supported: ["client_secret_post"], + grant_types_supported: ["authorization_code", "refresh_token"], + scopes_supported: options.scopesSupported, + revocation_endpoint: revocation_endpoint ? new URL(revocation_endpoint, baseUrl || issuer).href : undefined, + revocation_endpoint_auth_methods_supported: revocation_endpoint ? ["client_secret_post"] : undefined, + registration_endpoint: registration_endpoint ? new URL(registration_endpoint, baseUrl || issuer).href : undefined, + }; + return metadata; +}; +/** + * Installs standard MCP authorization server endpoints, including dynamic client registration and token revocation (if supported). + * Also advertises standard authorization server metadata, for easier discovery of supported configurations by clients. + * Note: if your MCP server is only a resource server and not an authorization server, use mcpAuthMetadataRouter instead. + * + * By default, rate limiting is applied to all endpoints to prevent abuse. + * + * This router MUST be installed at the application root, like so: + * + * const app = express(); + * app.use(mcpAuthRouter(...)); + */ +export function mcpAuthRouter(options) { + const oauthMetadata = createOAuthMetadata(options); + const router = express.Router(); + router.use(new URL(oauthMetadata.authorization_endpoint).pathname, authorizationHandler({ provider: options.provider, ...options.authorizationOptions })); + router.use(new URL(oauthMetadata.token_endpoint).pathname, tokenHandler({ provider: options.provider, ...options.tokenOptions })); + router.use(mcpAuthMetadataRouter({ + oauthMetadata, + // This router is used for AS+RS combo's, so the issuer is also the resource server + resourceServerUrl: new URL(oauthMetadata.issuer), + serviceDocumentationUrl: options.serviceDocumentationUrl, + scopesSupported: options.scopesSupported, + resourceName: options.resourceName + })); + if (oauthMetadata.registration_endpoint) { + router.use(new URL(oauthMetadata.registration_endpoint).pathname, clientRegistrationHandler({ + clientsStore: options.provider.clientsStore, + ...options, + })); + } + if (oauthMetadata.revocation_endpoint) { + router.use(new URL(oauthMetadata.revocation_endpoint).pathname, revocationHandler({ provider: options.provider, ...options.revocationOptions })); + } + return router; +} +export function mcpAuthMetadataRouter(options) { + var _a; + checkIssuerUrl(new URL(options.oauthMetadata.issuer)); + const router = express.Router(); + const protectedResourceMetadata = { + resource: options.resourceServerUrl.href, + authorization_servers: [ + options.oauthMetadata.issuer + ], + scopes_supported: options.scopesSupported, + resource_name: options.resourceName, + resource_documentation: (_a = options.serviceDocumentationUrl) === null || _a === void 0 ? void 0 : _a.href, + }; + router.use("/.well-known/oauth-protected-resource", metadataHandler(protectedResourceMetadata)); + // Always add this for backwards compatibility + router.use("/.well-known/oauth-authorization-server", metadataHandler(options.oauthMetadata)); + return router; +} +/** + * Helper function to construct the OAuth 2.0 Protected Resource Metadata URL + * from a given server URL. This replaces the path with the standard metadata endpoint. + * + * @param serverUrl - The base URL of the protected resource server + * @returns The URL for the OAuth protected resource metadata endpoint + * + * @example + * getOAuthProtectedResourceMetadataUrl(new URL('https://api.example.com/mcp')) + * // Returns: 'https://api.example.com/.well-known/oauth-protected-resource' + */ +export function getOAuthProtectedResourceMetadataUrl(serverUrl) { + return new URL('/.well-known/oauth-protected-resource', serverUrl).href; +} +//# sourceMappingURL=router.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/router.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/router.js.map new file mode 100644 index 0000000000..20eff41ec3 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/router.js.map @@ -0,0 +1 @@ +{"version":3,"file":"router.js","sourceRoot":"","sources":["../../../../src/server/auth/router.ts"],"names":[],"mappings":"AAAA,OAAO,OAA2B,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,yBAAyB,EAAoC,MAAM,wBAAwB,CAAC;AACrG,OAAO,EAAE,YAAY,EAAuB,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAA+B,MAAM,yBAAyB,CAAC;AAC5F,OAAO,EAAE,iBAAiB,EAA4B,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AA6CzD,MAAM,cAAc,GAAG,CAAC,MAAW,EAAQ,EAAE;IAC3C,mHAAmH;IACnH,IAAI,MAAM,CAAC,QAAQ,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,KAAK,WAAW,IAAI,MAAM,CAAC,QAAQ,KAAK,WAAW,EAAE,CAAC;QACvG,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAC9C,CAAC;IACD,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,wCAAwC,MAAM,EAAE,CAAC,CAAC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ED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,oCAAoC,CAAC,SAAc;IACjE,OAAO,IAAI,GAAG,CAAC,uCAAuC,EAAE,SAAS,CAAC,CAAC,IAAI,CAAC;AAC1E,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/types.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/types.d.ts new file mode 100644 index 0000000000..08e55f38b9 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/types.d.ts @@ -0,0 +1,27 @@ +/** + * Information about a validated access token, provided to request handlers. + */ +export interface AuthInfo { + /** + * The access token. + */ + token: string; + /** + * The client ID associated with this token. + */ + clientId: string; + /** + * Scopes associated with this token. + */ + scopes: string[]; + /** + * When the token expires (in seconds since epoch). + */ + expiresAt?: number; + /** + * Additional data associated with the token. + * This field should be used for any additional data that needs to be attached to the auth info. + */ + extra?: Record; +} +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/types.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/types.d.ts.map new file mode 100644 index 0000000000..6ccb8ceb29 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/server/auth/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,MAAM,EAAE,MAAM,EAAE,CAAC;IAEjB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;MAGE;IACF,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/types.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/types.js new file mode 100644 index 0000000000..718fd38ae4 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/types.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/types.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/types.js.map new file mode 100644 index 0000000000..0d8063dee4 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/auth/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/server/auth/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/completable.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/completable.d.ts new file mode 100644 index 0000000000..b75be29a44 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/completable.d.ts @@ -0,0 +1,22 @@ +import { ZodTypeAny, ZodTypeDef, ZodType, ParseInput, ParseReturnType, RawCreateParams } from "zod"; +export declare enum McpZodTypeKind { + Completable = "McpCompletable" +} +export type CompleteCallback = (value: T["_input"]) => T["_input"][] | Promise; +export interface CompletableDef extends ZodTypeDef { + type: T; + complete: CompleteCallback; + typeName: McpZodTypeKind.Completable; +} +export declare class Completable extends ZodType, T["_input"]> { + _parse(input: ParseInput): ParseReturnType; + unwrap(): T; + static create: (type: T_1, params: RawCreateParams & { + complete: CompleteCallback; + }) => Completable; +} +/** + * Wraps a Zod type to provide autocompletion capabilities. Useful for, e.g., prompt arguments in MCP. + */ +export declare function completable(schema: T, complete: CompleteCallback): Completable; +//# sourceMappingURL=completable.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/completable.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/completable.d.ts.map new file mode 100644 index 0000000000..f026d670ae --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/completable.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"completable.d.ts","sourceRoot":"","sources":["../../../src/server/completable.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,UAAU,EACV,OAAO,EACP,UAAU,EACV,eAAe,EACf,eAAe,EAGhB,MAAM,KAAK,CAAC;AAEb,oBAAY,cAAc;IACxB,WAAW,mBAAmB;CAC/B;AAED,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,UAAU,GAAG,UAAU,IAAI,CAChE,KAAK,EAAE,CAAC,CAAC,QAAQ,CAAC,KACf,CAAC,CAAC,QAAQ,CAAC,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AAE5C,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,UAAU,GAAG,UAAU,CAC/D,SAAQ,UAAU;IAClB,IAAI,EAAE,CAAC,CAAC;IACR,QAAQ,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAC9B,QAAQ,EAAE,cAAc,CAAC,WAAW,CAAC;CACtC;AAED,qBAAa,WAAW,CAAC,CAAC,SAAS,UAAU,CAAE,SAAQ,OAAO,CAC5D,CAAC,CAAC,SAAS,CAAC,EACZ,cAAc,CAAC,CAAC,CAAC,EACjB,CAAC,CAAC,QAAQ,CAAC,CACZ;IACC,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,eAAe,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAU3D,MAAM;IAIN,MAAM,CAAC,MAAM,eAAc,UAAU,QAC7B,GAAC,UACC,eAAe,GAAG;QACxB,QAAQ,EAAE,gBAAgB,CAAC,GAAC,CAAC,CAAC;KAC/B,KACA,WAAW,CAAC,GAAC,CAAC,CAOf;CACH;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,UAAU,EAC9C,MAAM,EAAE,CAAC,EACT,QAAQ,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAC5B,WAAW,CAAC,CAAC,CAAC,CAEhB"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/completable.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/completable.js new file mode 100644 index 0000000000..d7ee3ac295 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/completable.js @@ -0,0 +1,60 @@ +import { ZodType, } from "zod"; +export var McpZodTypeKind; +(function (McpZodTypeKind) { + McpZodTypeKind["Completable"] = "McpCompletable"; +})(McpZodTypeKind || (McpZodTypeKind = {})); +export class Completable extends ZodType { + _parse(input) { + const { ctx } = this._processInputParams(input); + const data = ctx.data; + return this._def.type._parse({ + data, + path: ctx.path, + parent: ctx, + }); + } + unwrap() { + return this._def.type; + } +} +Completable.create = (type, params) => { + return new Completable({ + type, + typeName: McpZodTypeKind.Completable, + complete: params.complete, + ...processCreateParams(params), + }); +}; +/** + * Wraps a Zod type to provide autocompletion capabilities. Useful for, e.g., prompt arguments in MCP. + */ +export function completable(schema, complete) { + return Completable.create(schema, { ...schema._def, complete }); +} +// Not sure why this isn't exported from Zod: +// https://github.com/colinhacks/zod/blob/f7ad26147ba291cb3fb257545972a8e00e767470/src/types.ts#L130 +function processCreateParams(params) { + if (!params) + return {}; + const { errorMap, invalid_type_error, required_error, description } = params; + if (errorMap && (invalid_type_error || required_error)) { + throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`); + } + if (errorMap) + return { errorMap: errorMap, description }; + const customMap = (iss, ctx) => { + var _a, _b; + const { message } = params; + if (iss.code === "invalid_enum_value") { + return { message: message !== null && message !== void 0 ? message : ctx.defaultError }; + } + if (typeof ctx.data === "undefined") { + return { message: (_a = message !== null && message !== void 0 ? message : required_error) !== null && _a !== void 0 ? _a : ctx.defaultError }; + } + if (iss.code !== "invalid_type") + return { message: ctx.defaultError }; + return { message: (_b = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _b !== void 0 ? _b : ctx.defaultError }; + }; + return { errorMap: customMap, description }; +} +//# sourceMappingURL=completable.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/completable.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/completable.js.map new file mode 100644 index 0000000000..a87d66dec1 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/completable.js.map @@ -0,0 +1 @@ +{"version":3,"file":"completable.js","sourceRoot":"","sources":["../../../src/server/completable.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,OAAO,GAMR,MAAM,KAAK,CAAC;AAEb,MAAM,CAAN,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,gDAA8B,CAAA;AAChC,CAAC,EAFW,cAAc,KAAd,cAAc,QAEzB;AAaD,MAAM,OAAO,WAAkC,SAAQ,OAItD;IACC,MAAM,CAAC,KAAiB;QACtB,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;QAChD,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;QACtB,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;YAC3B,IAAI;YACJ,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,MAAM,EAAE,GAAG;SACZ,CAAC,CAAC;IACL,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;IACxB,CAAC;;AAEM,kBAAM,GAAG,CACd,IAAO,EACP,MAEC,EACe,EAAE;IAClB,OAAO,IAAI,WAAW,CAAC;QACrB,IAAI;QACJ,QAAQ,EAAE,cAAc,CAAC,WAAW;QACpC,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,GAAG,mBAAmB,CAAC,MAAM,CAAC;KAC/B,CAAC,CAAC;AACL,CAAC,CAAC;AAGJ;;GAEG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AAI,GAAG,CAAC,YAAY,EAAE,CAAC;IACxE,CAAC,CAAC;IACF,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;AAC9C,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/index.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/index.d.ts new file mode 100644 index 0000000000..c322ed600e --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/index.d.ts @@ -0,0 +1,135 @@ +import { Protocol, ProtocolOptions, RequestOptions } from "../shared/protocol.js"; +import { ClientCapabilities, CreateMessageRequest, Implementation, ListRootsRequest, LoggingMessageNotification, Notification, Request, ResourceUpdatedNotification, Result, ServerCapabilities, ServerNotification, ServerRequest, ServerResult } from "../types.js"; +export type ServerOptions = ProtocolOptions & { + /** + * Capabilities to advertise as being supported by this server. + */ + capabilities?: ServerCapabilities; + /** + * Optional instructions describing how to use the server and its features. + */ + instructions?: string; +}; +/** + * An MCP server on top of a pluggable transport. + * + * This server will automatically respond to the initialization flow as initiated from the client. + * + * To use with custom types, extend the base Request/Notification/Result types and pass them as type parameters: + * + * ```typescript + * // Custom schemas + * const CustomRequestSchema = RequestSchema.extend({...}) + * const CustomNotificationSchema = NotificationSchema.extend({...}) + * const CustomResultSchema = ResultSchema.extend({...}) + * + * // Type aliases + * type CustomRequest = z.infer + * type CustomNotification = z.infer + * type CustomResult = z.infer + * + * // Create typed server + * const server = new Server({ + * name: "CustomServer", + * version: "1.0.0" + * }) + * ``` + */ +export declare class Server extends Protocol { + private _serverInfo; + private _clientCapabilities?; + private _clientVersion?; + private _capabilities; + private _instructions?; + /** + * Callback for when initialization has fully completed (i.e., the client has sent an `initialized` notification). + */ + oninitialized?: () => void; + /** + * Initializes this server with the given name and version information. + */ + constructor(_serverInfo: Implementation, options?: ServerOptions); + /** + * Registers new capabilities. This can only be called before connecting to a transport. + * + * The new capabilities will be merged with any existing capabilities previously given (e.g., at initialization). + */ + registerCapabilities(capabilities: ServerCapabilities): void; + protected assertCapabilityForMethod(method: RequestT["method"]): void; + protected assertNotificationCapability(method: (ServerNotification | NotificationT)["method"]): void; + protected assertRequestHandlerCapability(method: string): void; + private _oninitialize; + /** + * After initialization has completed, this will be populated with the client's reported capabilities. + */ + getClientCapabilities(): ClientCapabilities | undefined; + /** + * After initialization has completed, this will be populated with information about the client's name and version. + */ + getClientVersion(): Implementation | undefined; + private getCapabilities; + ping(): Promise<{ + _meta?: import("zod").objectOutputType<{}, import("zod").ZodTypeAny, "passthrough"> | undefined; + }>; + createMessage(params: CreateMessageRequest["params"], options?: RequestOptions): Promise, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + model: import("zod").ZodString; + stopReason: import("zod").ZodOptional, import("zod").ZodString]>>; + role: import("zod").ZodEnum<["user", "assistant"]>; + content: import("zod").ZodDiscriminatedUnion<"type", [import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"audio">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"audio">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"audio">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>]>; + }>, import("zod").ZodTypeAny, "passthrough">>; + listRoots(params?: ListRootsRequest["params"], options?: RequestOptions): Promise, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + roots: import("zod").ZodArray; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + uri: import("zod").ZodString; + name: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + uri: import("zod").ZodString; + name: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">>, "many">; + }>, import("zod").ZodTypeAny, "passthrough">>; + sendLoggingMessage(params: LoggingMessageNotification["params"]): Promise; + sendResourceUpdated(params: ResourceUpdatedNotification["params"]): Promise; + sendResourceListChanged(): Promise; + sendToolListChanged(): Promise; + sendPromptListChanged(): Promise; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/index.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/index.d.ts.map new file mode 100644 index 0000000000..810ca16bd5 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EACR,eAAe,EACf,cAAc,EACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EAGpB,cAAc,EAMd,gBAAgB,EAEhB,0BAA0B,EAC1B,YAAY,EACZ,OAAO,EACP,2BAA2B,EAC3B,MAAM,E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AAG,SAAS;IAI9C,OAAO,CAAC,eAAe;IAIjB,IAAI;;;IAIJ,aAAa,CACjB,MAAM,EAAE,oBAAoB,CAAC,QAAQ,CAAC,EACtC,OAAO,CAAC,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IASpB,SAAS,CACb,MAAM,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,EACnC,OAAO,CAAC,EAAE,cAAc;;;;;;;;;;;;;;IASpB,kBAAkB,CAAC,MAAM,EAAE,0BAA0B,CAAC,QAAQ,CAAC;IAI/D,mBAAmB,CAAC,MAAM,EAAE,2BAA2B,CAAC,QAAQ,CAAC;IAOjE,uBAAuB;IAMvB,mBAAmB;IAInB,qBAAqB;CAG5B"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/index.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/index.js new file mode 100644 index 0000000000..4c575d4afb --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/index.js @@ -0,0 +1,196 @@ +import { mergeCapabilities, Protocol, } from "../shared/protocol.js"; +import { CreateMessageResultSchema, EmptyResultSchema, InitializedNotificationSchema, InitializeRequestSchema, LATEST_PROTOCOL_VERSION, ListRootsResultSchema, SUPPORTED_PROTOCOL_VERSIONS, } from "../types.js"; +/** + * An MCP server on top of a pluggable transport. + * + * This server will automatically respond to the initialization flow as initiated from the client. + * + * To use with custom types, extend the base Request/Notification/Result types and pass them as type parameters: + * + * ```typescript + * // Custom schemas + * const CustomRequestSchema = RequestSchema.extend({...}) + * const CustomNotificationSchema = NotificationSchema.extend({...}) + * const CustomResultSchema = ResultSchema.extend({...}) + * + * // Type aliases + * type CustomRequest = z.infer + * type CustomNotification = z.infer + * type CustomResult = z.infer + * + * // Create typed server + * const server = new Server({ + * name: "CustomServer", + * version: "1.0.0" + * }) + * ``` + */ +export class Server extends Protocol { + /** + * Initializes this server with the given name and version information. + */ + constructor(_serverInfo, options) { + var _a; + super(options); + this._serverInfo = _serverInfo; + this._capabilities = (_a = options === null || options === void 0 ? void 0 : options.capabilities) !== null && _a !== void 0 ? _a : {}; + this._instructions = options === null || options === void 0 ? void 0 : options.instructions; + this.setRequestHandler(InitializeRequestSchema, (request) => this._oninitialize(request)); + this.setNotificationHandler(InitializedNotificationSchema, () => { var _a; return (_a = this.oninitialized) === null || _a === void 0 ? void 0 : _a.call(this); }); + } + /** + * Registers new capabilities. This can only be called before connecting to a transport. + * + * The new capabilities will be merged with any existing capabilities previously given (e.g., at initialization). + */ + registerCapabilities(capabilities) { + if (this.transport) { + throw new Error("Cannot register capabilities after connecting to transport"); + } + this._capabilities = mergeCapabilities(this._capabilities, capabilities); + } + assertCapabilityForMethod(method) { + var _a, _b; + switch (method) { + case "sampling/createMessage": + if (!((_a = this._clientCapabilities) === null || _a === void 0 ? void 0 : _a.sampling)) { + throw new Error(`Client does not support sampling (required for ${method})`); + } + break; + case "roots/list": + if (!((_b = this._clientCapabilities) === null || _b === void 0 ? void 0 : _b.roots)) { + throw new Error(`Client does not support listing roots (required for ${method})`); + } + break; + case "ping": + // No specific capability required for ping + break; + } + } + assertNotificationCapability(method) { + switch (method) { + case "notifications/message": + if (!this._capabilities.logging) { + throw new Error(`Server does not support logging (required for ${method})`); + } + break; + case "notifications/resources/updated": + case "notifications/resources/list_changed": + if (!this._capabilities.resources) { + throw new Error(`Server does not support notifying about resources (required for ${method})`); + } + break; + case "notifications/tools/list_changed": + if (!this._capabilities.tools) { + throw new Error(`Server does not support notifying of tool list changes (required for ${method})`); + } + break; + case "notifications/prompts/list_changed": + if (!this._capabilities.prompts) { + throw new Error(`Server does not support notifying of prompt list changes (required for ${method})`); + } + break; + case "notifications/cancelled": + // Cancellation notifications are always allowed + break; + case "notifications/progress": + // Progress notifications are always allowed + break; + } + } + assertRequestHandlerCapability(method) { + switch (method) { + case "sampling/createMessage": + if (!this._capabilities.sampling) { + throw new Error(`Server does not support sampling (required for ${method})`); + } + break; + case "logging/setLevel": + if (!this._capabilities.logging) { + throw new Error(`Server does not support logging (required for ${method})`); + } + break; + case "prompts/get": + case "prompts/list": + if (!this._capabilities.prompts) { + throw new Error(`Server does not support prompts (required for ${method})`); + } + break; + case "resources/list": + case "resources/templates/list": + case "resources/read": + if (!this._capabilities.resources) { + throw new Error(`Server does not support resources (required for ${method})`); + } + break; + case "tools/call": + case "tools/list": + if (!this._capabilities.tools) { + throw new Error(`Server does not support tools (required for ${method})`); + } + break; + case "ping": + case "initialize": + // No specific capability required for these methods + break; + } + } + async _oninitialize(request) { + const requestedVersion = request.params.protocolVersion; + this._clientCapabilities = request.params.capabilities; + this._clientVersion = request.params.clientInfo; + return { + protocolVersion: SUPPORTED_PROTOCOL_VERSIONS.includes(requestedVersion) + ? requestedVersion + : LATEST_PROTOCOL_VERSION, + capabilities: this.getCapabilities(), + serverInfo: this._serverInfo, + ...(this._instructions && { instructions: this._instructions }), + }; + } + /** + * After initialization has completed, this will be populated with the client's reported capabilities. + */ + getClientCapabilities() { + return this._clientCapabilities; + } + /** + * After initialization has completed, this will be populated with information about the client's name and version. + */ + getClientVersion() { + return this._clientVersion; + } + getCapabilities() { + return this._capabilities; + } + async ping() { + return this.request({ method: "ping" }, EmptyResultSchema); + } + async createMessage(params, options) { + return this.request({ method: "sampling/createMessage", params }, CreateMessageResultSchema, options); + } + async listRoots(params, options) { + return this.request({ method: "roots/list", params }, ListRootsResultSchema, options); + } + async sendLoggingMessage(params) { + return this.notification({ method: "notifications/message", params }); + } + async sendResourceUpdated(params) { + return this.notification({ + method: "notifications/resources/updated", + params, + }); + } + async sendResourceListChanged() { + return this.notification({ + method: "notifications/resources/list_changed", + }); + } + async sendToolListChanged() { + return this.notification({ method: "notifications/tools/list_changed" }); + } + async sendPromptListChanged() { + return this.notification({ method: "notifications/prompts/list_changed" }); + } +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/index.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/index.js.map new file mode 100644 index 0000000000..51db340fd4 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,QAAQ,GAGT,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAGL,yBAAyB,EACzB,iBAAiB,EAEjB,6BAA6B,EAE7B,uBAAuB,EAEvB,uBAAuB,EAEvB,qBAAqB,EAUrB,2BAA2B,GAC5B,MAAM,aAAa,CAAC;AAcrB;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,OAAO,MAIX,SAAQ,QAIT;IAWC;;OAEG;IACH,YACU,WAA2B,EACnC,OAAuB;;QAEvB,KAAK,CAAC,OAAO,CAAC,CAAC;QAHP,gBAAW,GAAX,WAAW,CAAgB;QAInC,IAAI,CAAC,aAAa,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,YAAY,mCAAI,EAAE,CAAC;QACjD,IAAI,CAAC,aAAa,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,YAAY,CAAC;QAE3C,IAAI,CAAC,iBAAiB,CAAC,uBAAuB,EAAE,CAAC,OAAO,EAAE,EAAE,CAC1D,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAC5B,CAAC;QACF,IAAI,CAAC,sBAAsB,CAAC,6BAA6B,EAAE,GAAG,EAAE,WAC9D,OAAA,MAAA,IAAI,CAAC,aAAa,oDAAI,CAAA,EAAA,CACvB,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACI,oBAAoB,CAAC,YAAgC;QAC1D,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CACb,4DAA4D,CAC7D,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,aAAa,GAAG,iBAAiB,CAAC,IAAI,CA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ACjB,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,EAChC,qBAAqB,EACrB,OAAO,CACR,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,MAA4C;QACnE,OAAO,IAAI,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,uBAAuB,EAAE,MAAM,EAAE,CAAC,CAAC;IACxE,CAAC;IAED,KAAK,CAAC,mBAAmB,CAAC,MAA6C;QACrE,OAAO,IAAI,CAAC,YAAY,CAAC;YACvB,MAAM,EAAE,iCAAiC;YACzC,MAAM;SACP,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,uBAAuB;QAC3B,OAAO,IAAI,CAAC,YAAY,CAAC;YACvB,MAAM,EAAE,sCAAsC;SAC/C,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,mBAAmB;QACvB,OAAO,IAAI,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,kCAAkC,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED,KAAK,CAAC,qBAAqB;QACzB,OAAO,IAAI,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,oCAAoC,EAAE,CAAC,CAAC;IAC7E,CAAC;CACF"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/mcp.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/mcp.d.ts new file mode 100644 index 0000000000..525ec440b4 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/mcp.d.ts @@ -0,0 +1,271 @@ +import { Server, ServerOptions } from "./index.js"; +import { z, ZodRawShape, ZodObject, AnyZodObject, ZodTypeAny, ZodType, ZodTypeDef, ZodOptional } from "zod"; +import { Implementation, CallToolResult, Resource, ListResourcesResult, GetPromptResult, ReadResourceResult, ServerRequest, ServerNotification, ToolAnnotations } from "../types.js"; +import { UriTemplate, Variables } from "../shared/uriTemplate.js"; +import { RequestHandlerExtra } from "../shared/protocol.js"; +import { Transport } from "../shared/transport.js"; +/** + * High-level MCP server that provides a simpler API for working with resources, tools, and prompts. + * For advanced usage (like sending notifications or setting custom request handlers), use the underlying + * Server instance available via the `server` property. + */ +export declare class McpServer { + /** + * The underlying Server instance, useful for advanced operations like sending notifications. + */ + readonly server: Server; + private _registeredResources; + private _registeredResourceTemplates; + private _registeredTools; + private _registeredPrompts; + constructor(serverInfo: Implementation, options?: ServerOptions); + /** + * Attaches to the given transport, starts it, and starts listening for messages. + * + * The `server` object assumes ownership of the Transport, replacing any callbacks that have already been set, and expects that it is the only user of the Transport instance going forward. + */ + connect(transport: Transport): Promise; + /** + * Closes the connection. + */ + close(): Promise; + private _toolHandlersInitialized; + private setToolRequestHandlers; + private _completionHandlerInitialized; + private setCompletionRequestHandler; + private handlePromptCompletion; + private handleResourceCompletion; + private _resourceHandlersInitialized; + private setResourceRequestHandlers; + private _promptHandlersInitialized; + private setPromptRequestHandlers; + /** + * Registers a resource `name` at a fixed URI, which will use the given callback to respond to read requests. + */ + resource(name: string, uri: string, readCallback: ReadResourceCallback): RegisteredResource; + /** + * Registers a resource `name` at a fixed URI with metadata, which will use the given callback to respond to read requests. + */ + resource(name: string, uri: string, metadata: ResourceMetadata, readCallback: ReadResourceCallback): RegisteredResource; + /** + * Registers a resource `name` with a template pattern, which will use the given callback to respond to read requests. + */ + resource(name: string, template: ResourceTemplate, readCallback: ReadResourceTemplateCallback): RegisteredResourceTemplate; + /** + * Registers a resource `name` with a template pattern and metadata, which will use the given callback to respond to read requests. + */ + resource(name: string, template: ResourceTemplate, metadata: ResourceMetadata, readCallback: ReadResourceTemplateCallback): RegisteredResourceTemplate; + private _createRegisteredTool; + /** + * Registers a zero-argument tool `name`, which will run the given function when the client calls it. + */ + tool(name: string, cb: ToolCallback): RegisteredTool; + /** + * Registers a zero-argument tool `name` (with a description) which will run the given function when the client calls it. + */ + tool(name: string, description: string, cb: ToolCallback): RegisteredTool; + /** + * Registers a tool taking either a parameter schema for validation or annotations for additional metadata. + * This unified overload handles both `tool(name, paramsSchema, cb)` and `tool(name, annotations, cb)` cases. + * + * Note: We use a union type for the second parameter because TypeScript cannot reliably disambiguate + * between ToolAnnotations and ZodRawShape during overload resolution, as both are plain object types. + */ + tool(name: string, paramsSchemaOrAnnotations: Args | ToolAnnotations, cb: ToolCallback): RegisteredTool; + /** + * Registers a tool `name` (with a description) taking either parameter schema or annotations. + * This unified overload handles both `tool(name, description, paramsSchema, cb)` and + * `tool(name, description, annotations, cb)` cases. + * + * Note: We use a union type for the third parameter because TypeScript cannot reliably disambiguate + * between ToolAnnotations and ZodRawShape during overload resolution, as both are plain object types. + */ + tool(name: string, description: string, paramsSchemaOrAnnotations: Args | ToolAnnotations, cb: ToolCallback): RegisteredTool; + /** + * Registers a tool with both parameter schema and annotations. + */ + tool(name: string, paramsSchema: Args, annotations: ToolAnnotations, cb: ToolCallback): RegisteredTool; + /** + * Registers a tool with description, parameter schema, and annotations. + */ + tool(name: string, description: string, paramsSchema: Args, annotations: ToolAnnotations, cb: ToolCallback): RegisteredTool; + /** + * Registers a tool with a config object and callback. + */ + registerTool(name: string, config: { + description?: string; + inputSchema?: InputArgs; + outputSchema?: OutputArgs; + annotations?: ToolAnnotations; + }, cb: ToolCallback): RegisteredTool; + /** + * Registers a zero-argument prompt `name`, which will run the given function when the client calls it. + */ + prompt(name: string, cb: PromptCallback): RegisteredPrompt; + /** + * Registers a zero-argument prompt `name` (with a description) which will run the given function when the client calls it. + */ + prompt(name: string, description: string, cb: PromptCallback): RegisteredPrompt; + /** + * Registers a prompt `name` accepting the given arguments, which must be an object containing named properties associated with Zod schemas. When the client calls it, the function will be run with the parsed and validated arguments. + */ + prompt(name: string, argsSchema: Args, cb: PromptCallback): RegisteredPrompt; + /** + * Registers a prompt `name` (with a description) accepting the given arguments, which must be an object containing named properties associated with Zod schemas. When the client calls it, the function will be run with the parsed and validated arguments. + */ + prompt(name: string, description: string, argsSchema: Args, cb: PromptCallback): RegisteredPrompt; + /** + * Checks if the server is connected to a transport. + * @returns True if the server is connected + */ + isConnected(): boolean; + /** + * Sends a resource list changed event to the client, if connected. + */ + sendResourceListChanged(): void; + /** + * Sends a tool list changed event to the client, if connected. + */ + sendToolListChanged(): void; + /** + * Sends a prompt list changed event to the client, if connected. + */ + sendPromptListChanged(): void; +} +/** + * A callback to complete one variable within a resource template's URI template. + */ +export type CompleteResourceTemplateCallback = (value: string) => string[] | Promise; +/** + * A resource template combines a URI pattern with optional functionality to enumerate + * all resources matching that pattern. + */ +export declare class ResourceTemplate { + private _callbacks; + private _uriTemplate; + constructor(uriTemplate: string | UriTemplate, _callbacks: { + /** + * A callback to list all resources matching this template. This is required to specified, even if `undefined`, to avoid accidentally forgetting resource listing. + */ + list: ListResourcesCallback | undefined; + /** + * An optional callback to autocomplete variables within the URI template. Useful for clients and users to discover possible values. + */ + complete?: { + [variable: string]: CompleteResourceTemplateCallback; + }; + }); + /** + * Gets the URI template pattern. + */ + get uriTemplate(): UriTemplate; + /** + * Gets the list callback, if one was provided. + */ + get listCallback(): ListResourcesCallback | undefined; + /** + * Gets the callback for completing a specific URI template variable, if one was provided. + */ + completeCallback(variable: string): CompleteResourceTemplateCallback | undefined; +} +/** + * Callback for a tool handler registered with Server.tool(). + * + * Parameters will include tool arguments, if applicable, as well as other request handler context. + * + * The callback should return: + * - `structuredContent` if the tool has an outputSchema defined + * - `content` if the tool does not have an outputSchema + * - Both fields are optional but typically one should be provided + */ +export type ToolCallback = Args extends ZodRawShape ? (args: z.objectOutputType, extra: RequestHandlerExtra) => CallToolResult | Promise : (extra: RequestHandlerExtra) => CallToolResult | Promise; +export type RegisteredTool = { + description?: string; + inputSchema?: AnyZodObject; + outputSchema?: AnyZodObject; + annotations?: ToolAnnotations; + callback: ToolCallback; + enabled: boolean; + enable(): void; + disable(): void; + update(updates: { + name?: string | null; + description?: string; + paramsSchema?: InputArgs; + outputSchema?: OutputArgs; + annotations?: ToolAnnotations; + callback?: ToolCallback; + enabled?: boolean; + }): void; + remove(): void; +}; +/** + * Additional, optional information for annotating a resource. + */ +export type ResourceMetadata = Omit; +/** + * Callback to list all resources matching a given template. + */ +export type ListResourcesCallback = (extra: RequestHandlerExtra) => ListResourcesResult | Promise; +/** + * Callback to read a resource at a given URI. + */ +export type ReadResourceCallback = (uri: URL, extra: RequestHandlerExtra) => ReadResourceResult | Promise; +export type RegisteredResource = { + name: string; + metadata?: ResourceMetadata; + readCallback: ReadResourceCallback; + enabled: boolean; + enable(): void; + disable(): void; + update(updates: { + name?: string; + uri?: string | null; + metadata?: ResourceMetadata; + callback?: ReadResourceCallback; + enabled?: boolean; + }): void; + remove(): void; +}; +/** + * Callback to read a resource at a given URI, following a filled-in URI template. + */ +export type ReadResourceTemplateCallback = (uri: URL, variables: Variables, extra: RequestHandlerExtra) => ReadResourceResult | Promise; +export type RegisteredResourceTemplate = { + resourceTemplate: ResourceTemplate; + metadata?: ResourceMetadata; + readCallback: ReadResourceTemplateCallback; + enabled: boolean; + enable(): void; + disable(): void; + update(updates: { + name?: string | null; + template?: ResourceTemplate; + metadata?: ResourceMetadata; + callback?: ReadResourceTemplateCallback; + enabled?: boolean; + }): void; + remove(): void; +}; +type PromptArgsRawShape = { + [k: string]: ZodType | ZodOptional>; +}; +export type PromptCallback = Args extends PromptArgsRawShape ? (args: z.objectOutputType, extra: RequestHandlerExtra) => GetPromptResult | Promise : (extra: RequestHandlerExtra) => GetPromptResult | Promise; +export type RegisteredPrompt = { + description?: string; + argsSchema?: ZodObject; + callback: PromptCallback; + enabled: boolean; + enable(): void; + disable(): void; + update(updates: { + name?: string | null; + description?: string; + argsSchema?: Args; + callback?: PromptCallback; + enabled?: boolean; + }): void; + remove(): void; +}; +export {}; +//# sourceMappingURL=mcp.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/mcp.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/mcp.d.ts.map new file mode 100644 index 0000000000..3a6627ee09 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/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AAC,OAAO,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;CACpD,CAAC;AAEF,MAAM,MAAM,cAAc,CACxB,IAAI,SAAS,SAAS,GAAG,kBAAkB,GAAG,SAAS,IACrD,IAAI,SAAS,kBAAkB,GAC/B,CACA,IAAI,EAAE,CAAC,CAAC,gBAAgB,CAAC,IAAI,EAAE,UAAU,CAAC,EAC1C,KAAK,EAAE,mBAAmB,CAAC,aAAa,EAAE,kBAAkB,CAAC,KAC1D,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,GAC7C,CAAC,KAAK,EAAE,mBAAmB,CAAC,aAAa,EAAE,kBAAkB,CAAC,KAAK,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AAElH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,SAAS,CAAC,kBAAkB,CAAC,CAAC;IAC3C,QAAQ,EAAE,cAAc,CAAC,SAAS,GAAG,kBAAkB,CAAC,CAAC;IACzD,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,IAAI,IAAI,CAAC;IACf,OAAO,IAAI,IAAI,CAAC;IAChB,MAAM,CAAC,IAAI,SAAS,kBAAkB,EAAE,OAAO,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,IAAI,CAAC;QAAC,QAAQ,CAAC,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAA;IAC7K,MAAM,IAAI,IAAI,CAAA;CACf,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/mcp.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/mcp.js new file mode 100644 index 0000000000..93a05c6b1e --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/mcp.js @@ -0,0 +1,603 @@ +import { Server } from "./index.js"; +import { zodToJsonSchema } from "zod-to-json-schema"; +import { z, } from "zod"; +import { McpError, ErrorCode, ListResourceTemplatesRequestSchema, ReadResourceRequestSchema, ListToolsRequestSchema, CallToolRequestSchema, ListResourcesRequestSchema, ListPromptsRequestSchema, GetPromptRequestSchema, CompleteRequestSchema, } from "../types.js"; +import { Completable } from "./completable.js"; +import { UriTemplate } from "../shared/uriTemplate.js"; +/** + * High-level MCP server that provides a simpler API for working with resources, tools, and prompts. + * For advanced usage (like sending notifications or setting custom request handlers), use the underlying + * Server instance available via the `server` property. + */ +export class McpServer { + constructor(serverInfo, options) { + this._registeredResources = {}; + this._registeredResourceTemplates = {}; + this._registeredTools = {}; + this._registeredPrompts = {}; + this._toolHandlersInitialized = false; + this._completionHandlerInitialized = false; + this._resourceHandlersInitialized = false; + this._promptHandlersInitialized = false; + this.server = new Server(serverInfo, options); + } + /** + * Attaches to the given transport, starts it, and starts listening for messages. + * + * The `server` object assumes ownership of the Transport, replacing any callbacks that have already been set, and expects that it is the only user of the Transport instance going forward. + */ + async connect(transport) { + return await this.server.connect(transport); + } + /** + * Closes the connection. + */ + async close() { + await this.server.close(); + } + setToolRequestHandlers() { + if (this._toolHandlersInitialized) { + return; + } + this.server.assertCanSetRequestHandler(ListToolsRequestSchema.shape.method.value); + this.server.assertCanSetRequestHandler(CallToolRequestSchema.shape.method.value); + this.server.registerCapabilities({ + tools: { + listChanged: true + } + }); + this.server.setRequestHandler(ListToolsRequestSchema, () => ({ + tools: Object.entries(this._registeredTools).filter(([, tool]) => tool.enabled).map(([name, tool]) => { + const toolDefinition = { + name, + description: tool.description, + inputSchema: tool.inputSchema + ? zodToJsonSchema(tool.inputSchema, { + strictUnions: true, + }) + : EMPTY_OBJECT_JSON_SCHEMA, + annotations: tool.annotations, + }; + if (tool.outputSchema) { + toolDefinition.outputSchema = zodToJsonSchema(tool.outputSchema, { strictUnions: true }); + } + return toolDefinition; + }), + })); + this.server.setRequestHandler(CallToolRequestSchema, async (request, extra) => { + const tool = this._registeredTools[request.params.name]; + if (!tool) { + throw new McpError(ErrorCode.InvalidParams, `Tool ${request.params.name} not found`); + } + if (!tool.enabled) { + throw new McpError(ErrorCode.InvalidParams, `Tool ${request.params.name} disabled`); + } + let result; + if (tool.inputSchema) { + const parseResult = await tool.inputSchema.safeParseAsync(request.params.arguments); + if (!parseResult.success) { + throw new McpError(ErrorCode.InvalidParams, `Invalid arguments for tool ${request.params.name}: ${parseResult.error.message}`); + } + const args = parseResult.data; + const cb = tool.callback; + try { + result = await Promise.resolve(cb(args, extra)); + } + catch (error) { + result = { + content: [ + { + type: "text", + text: error instanceof Error ? error.message : String(error), + }, + ], + isError: true, + }; + } + } + else { + const cb = tool.callback; + try { + result = await Promise.resolve(cb(extra)); + } + catch (error) { + result = { + content: [ + { + type: "text", + text: error instanceof Error ? error.message : String(error), + }, + ], + isError: true, + }; + } + } + if (tool.outputSchema) { + if (!result.structuredContent) { + throw new McpError(ErrorCode.InvalidParams, `Tool ${request.params.name} has an output schema but no structured content was provided`); + } + // if the tool has an output schema, validate structured content + const parseResult = await tool.outputSchema.safeParseAsync(result.structuredContent); + if (!parseResult.success) { + throw new McpError(ErrorCode.InvalidParams, `Invalid structured content for tool ${request.params.name}: ${parseResult.error.message}`); + } + } + return result; + }); + this._toolHandlersInitialized = true; + } + setCompletionRequestHandler() { + if (this._completionHandlerInitialized) { + return; + } + this.server.assertCanSetRequestHandler(CompleteRequestSchema.shape.method.value); + this.server.registerCapabilities({ + completions: {}, + }); + this.server.setRequestHandler(CompleteRequestSchema, async (request) => { + switch (request.params.ref.type) { + case "ref/prompt": + return this.handlePromptCompletion(request, request.params.ref); + case "ref/resource": + return this.handleResourceCompletion(request, request.params.ref); + default: + throw new McpError(ErrorCode.InvalidParams, `Invalid completion reference: ${request.params.ref}`); + } + }); + this._completionHandlerInitialized = true; + } + async handlePromptCompletion(request, ref) { + const prompt = this._registeredPrompts[ref.name]; + if (!prompt) { + throw new McpError(ErrorCode.InvalidParams, `Prompt ${ref.name} not found`); + } + if (!prompt.enabled) { + throw new McpError(ErrorCode.InvalidParams, `Prompt ${ref.name} disabled`); + } + if (!prompt.argsSchema) { + return EMPTY_COMPLETION_RESULT; + } + const field = prompt.argsSchema.shape[request.params.argument.name]; + if (!(field instanceof Completable)) { + return EMPTY_COMPLETION_RESULT; + } + const def = field._def; + const suggestions = await def.complete(request.params.argument.value); + return createCompletionResult(suggestions); + } + async handleResourceCompletion(request, ref) { + const template = Object.values(this._registeredResourceTemplates).find((t) => t.resourceTemplate.uriTemplate.toString() === ref.uri); + if (!template) { + if (this._registeredResources[ref.uri]) { + // Attempting to autocomplete a fixed resource URI is not an error in the spec (but probably should be). + return EMPTY_COMPLETION_RESULT; + } + throw new McpError(ErrorCode.InvalidParams, `Resource template ${request.params.ref.uri} not found`); + } + const completer = template.resourceTemplate.completeCallback(request.params.argument.name); + if (!completer) { + return EMPTY_COMPLETION_RESULT; + } + const suggestions = await completer(request.params.argument.value); + return createCompletionResult(suggestions); + } + setResourceRequestHandlers() { + if (this._resourceHandlersInitialized) { + return; + } + this.server.assertCanSetRequestHandler(ListResourcesRequestSchema.shape.method.value); + this.server.assertCanSetRequestHandler(ListResourceTemplatesRequestSchema.shape.method.value); + this.server.assertCanSetRequestHandler(ReadResourceRequestSchema.shape.method.value); + this.server.registerCapabilities({ + resources: { + listChanged: true + } + }); + this.server.setRequestHandler(ListResourcesRequestSchema, async (request, extra) => { + const resources = Object.entries(this._registeredResources).filter(([_, resource]) => resource.enabled).map(([uri, resource]) => ({ + uri, + name: resource.name, + ...resource.metadata, + })); + const templateResources = []; + for (const template of Object.values(this._registeredResourceTemplates)) { + if (!template.resourceTemplate.listCallback) { + continue; + } + const result = await template.resourceTemplate.listCallback(extra); + for (const resource of result.resources) { + templateResources.push({ + ...template.metadata, + // the defined resource metadata should override the template metadata if present + ...resource, + }); + } + } + return { resources: [...resources, ...templateResources] }; + }); + this.server.setRequestHandler(ListResourceTemplatesRequestSchema, async () => { + const resourceTemplates = Object.entries(this._registeredResourceTemplates).map(([name, template]) => ({ + name, + uriTemplate: template.resourceTemplate.uriTemplate.toString(), + ...template.metadata, + })); + return { resourceTemplates }; + }); + this.server.setRequestHandler(ReadResourceRequestSchema, async (request, extra) => { + const uri = new URL(request.params.uri); + // First check for exact resource match + const resource = this._registeredResources[uri.toString()]; + if (resource) { + if (!resource.enabled) { + throw new McpError(ErrorCode.InvalidParams, `Resource ${uri} disabled`); + } + return resource.readCallback(uri, extra); + } + // Then check templates + for (const template of Object.values(this._registeredResourceTemplates)) { + const variables = template.resourceTemplate.uriTemplate.match(uri.toString()); + if (variables) { + return template.readCallback(uri, variables, extra); + } + } + throw new McpError(ErrorCode.InvalidParams, `Resource ${uri} not found`); + }); + this.setCompletionRequestHandler(); + this._resourceHandlersInitialized = true; + } + setPromptRequestHandlers() { + if (this._promptHandlersInitialized) { + return; + } + this.server.assertCanSetRequestHandler(ListPromptsRequestSchema.shape.method.value); + this.server.assertCanSetRequestHandler(GetPromptRequestSchema.shape.method.value); + this.server.registerCapabilities({ + prompts: { + listChanged: true + } + }); + this.server.setRequestHandler(ListPromptsRequestSchema, () => ({ + prompts: Object.entries(this._registeredPrompts).filter(([, prompt]) => prompt.enabled).map(([name, prompt]) => { + return { + name, + description: prompt.description, + arguments: prompt.argsSchema + ? promptArgumentsFromSchema(prompt.argsSchema) + : undefined, + }; + }), + })); + this.server.setRequestHandler(GetPromptRequestSchema, async (request, extra) => { + const prompt = this._registeredPrompts[request.params.name]; + if (!prompt) { + throw new McpError(ErrorCode.InvalidParams, `Prompt ${request.params.name} not found`); + } + if (!prompt.enabled) { + throw new McpError(ErrorCode.InvalidParams, `Prompt ${request.params.name} disabled`); + } + if (prompt.argsSchema) { + const parseResult = await prompt.argsSchema.safeParseAsync(request.params.arguments); + if (!parseResult.success) { + throw new McpError(ErrorCode.InvalidParams, `Invalid arguments for prompt ${request.params.name}: ${parseResult.error.message}`); + } + const args = parseResult.data; + const cb = prompt.callback; + return await Promise.resolve(cb(args, extra)); + } + else { + const cb = prompt.callback; + return await Promise.resolve(cb(extra)); + } + }); + this.setCompletionRequestHandler(); + this._promptHandlersInitialized = true; + } + resource(name, uriOrTemplate, ...rest) { + let metadata; + if (typeof rest[0] === "object") { + metadata = rest.shift(); + } + const readCallback = rest[0]; + if (typeof uriOrTemplate === "string") { + if (this._registeredResources[uriOrTemplate]) { + throw new Error(`Resource ${uriOrTemplate} is already registered`); + } + const registeredResource = { + name, + metadata, + readCallback: readCallback, + enabled: true, + disable: () => registeredResource.update({ enabled: false }), + enable: () => registeredResource.update({ enabled: true }), + remove: () => registeredResource.update({ uri: null }), + update: (updates) => { + if (typeof updates.uri !== "undefined" && updates.uri !== uriOrTemplate) { + delete this._registeredResources[uriOrTemplate]; + if (updates.uri) + this._registeredResources[updates.uri] = registeredResource; + } + if (typeof updates.name !== "undefined") + registeredResource.name = updates.name; + if (typeof updates.metadata !== "undefined") + registeredResource.metadata = updates.metadata; + if (typeof updates.callback !== "undefined") + registeredResource.readCallback = updates.callback; + if (typeof updates.enabled !== "undefined") + registeredResource.enabled = updates.enabled; + this.sendResourceListChanged(); + }, + }; + this._registeredResources[uriOrTemplate] = registeredResource; + this.setResourceRequestHandlers(); + this.sendResourceListChanged(); + return registeredResource; + } + else { + if (this._registeredResourceTemplates[name]) { + throw new Error(`Resource template ${name} is already registered`); + } + const registeredResourceTemplate = { + resourceTemplate: uriOrTemplate, + metadata, + readCallback: readCallback, + enabled: true, + disable: () => registeredResourceTemplate.update({ enabled: false }), + enable: () => registeredResourceTemplate.update({ enabled: true }), + remove: () => registeredResourceTemplate.update({ name: null }), + update: (updates) => { + if (typeof updates.name !== "undefined" && updates.name !== name) { + delete this._registeredResourceTemplates[name]; + if (updates.name) + this._registeredResourceTemplates[updates.name] = registeredResourceTemplate; + } + if (typeof updates.template !== "undefined") + registeredResourceTemplate.resourceTemplate = updates.template; + if (typeof updates.metadata !== "undefined") + registeredResourceTemplate.metadata = updates.metadata; + if (typeof updates.callback !== "undefined") + registeredResourceTemplate.readCallback = updates.callback; + if (typeof updates.enabled !== "undefined") + registeredResourceTemplate.enabled = updates.enabled; + this.sendResourceListChanged(); + }, + }; + this._registeredResourceTemplates[name] = registeredResourceTemplate; + this.setResourceRequestHandlers(); + this.sendResourceListChanged(); + return registeredResourceTemplate; + } + } + _createRegisteredTool(name, description, inputSchema, outputSchema, annotations, callback) { + const registeredTool = { + description, + inputSchema: inputSchema === undefined ? undefined : z.object(inputSchema), + outputSchema: outputSchema === undefined ? undefined : z.object(outputSchema), + annotations, + callback, + enabled: true, + disable: () => registeredTool.update({ enabled: false }), + enable: () => registeredTool.update({ enabled: true }), + remove: () => registeredTool.update({ name: null }), + update: (updates) => { + if (typeof updates.name !== "undefined" && updates.name !== name) { + delete this._registeredTools[name]; + if (updates.name) + this._registeredTools[updates.name] = registeredTool; + } + if (typeof updates.description !== "undefined") + registeredTool.description = updates.description; + if (typeof updates.paramsSchema !== "undefined") + registeredTool.inputSchema = z.object(updates.paramsSchema); + if (typeof updates.callback !== "undefined") + registeredTool.callback = updates.callback; + if (typeof updates.annotations !== "undefined") + registeredTool.annotations = updates.annotations; + if (typeof updates.enabled !== "undefined") + registeredTool.enabled = updates.enabled; + this.sendToolListChanged(); + }, + }; + this._registeredTools[name] = registeredTool; + this.setToolRequestHandlers(); + this.sendToolListChanged(); + return registeredTool; + } + /** + * tool() implementation. Parses arguments passed to overrides defined above. + */ + tool(name, ...rest) { + if (this._registeredTools[name]) { + throw new Error(`Tool ${name} is already registered`); + } + let description; + let inputSchema; + let outputSchema; + let annotations; + // Tool properties are passed as separate arguments, with omissions allowed. + // Support for this style is frozen as of protocol version 2025-03-26. Future additions + // to tool definition should *NOT* be added. + if (typeof rest[0] === "string") { + description = rest.shift(); + } + // Handle the different overload combinations + if (rest.length > 1) { + // We have at least one more arg before the callback + const firstArg = rest[0]; + if (isZodRawShape(firstArg)) { + // We have a params schema as the first arg + inputSchema = rest.shift(); + // Check if the next arg is potentially annotations + if (rest.length > 1 && typeof rest[0] === "object" && rest[0] !== null && !(isZodRawShape(rest[0]))) { + // Case: tool(name, paramsSchema, annotations, cb) + // Or: tool(name, description, paramsSchema, annotations, cb) + annotations = rest.shift(); + } + } + else if (typeof firstArg === "object" && firstArg !== null) { + // Not a ZodRawShape, so must be annotations in this position + // Case: tool(name, annotations, cb) + // Or: tool(name, description, annotations, cb) + annotations = rest.shift(); + } + } + const callback = rest[0]; + return this._createRegisteredTool(name, description, inputSchema, outputSchema, annotations, callback); + } + /** + * Registers a tool with a config object and callback. + */ + registerTool(name, config, cb) { + if (this._registeredTools[name]) { + throw new Error(`Tool ${name} is already registered`); + } + const { description, inputSchema, outputSchema, annotations } = config; + return this._createRegisteredTool(name, description, inputSchema, outputSchema, annotations, cb); + } + prompt(name, ...rest) { + if (this._registeredPrompts[name]) { + throw new Error(`Prompt ${name} is already registered`); + } + let description; + if (typeof rest[0] === "string") { + description = rest.shift(); + } + let argsSchema; + if (rest.length > 1) { + argsSchema = rest.shift(); + } + const cb = rest[0]; + const registeredPrompt = { + description, + argsSchema: argsSchema === undefined ? undefined : z.object(argsSchema), + callback: cb, + enabled: true, + disable: () => registeredPrompt.update({ enabled: false }), + enable: () => registeredPrompt.update({ enabled: true }), + remove: () => registeredPrompt.update({ name: null }), + update: (updates) => { + if (typeof updates.name !== "undefined" && updates.name !== name) { + delete this._registeredPrompts[name]; + if (updates.name) + this._registeredPrompts[updates.name] = registeredPrompt; + } + if (typeof updates.description !== "undefined") + registeredPrompt.description = updates.description; + if (typeof updates.argsSchema !== "undefined") + registeredPrompt.argsSchema = z.object(updates.argsSchema); + if (typeof updates.callback !== "undefined") + registeredPrompt.callback = updates.callback; + if (typeof updates.enabled !== "undefined") + registeredPrompt.enabled = updates.enabled; + this.sendPromptListChanged(); + }, + }; + this._registeredPrompts[name] = registeredPrompt; + this.setPromptRequestHandlers(); + this.sendPromptListChanged(); + return registeredPrompt; + } + /** + * Checks if the server is connected to a transport. + * @returns True if the server is connected + */ + isConnected() { + return this.server.transport !== undefined; + } + /** + * Sends a resource list changed event to the client, if connected. + */ + sendResourceListChanged() { + if (this.isConnected()) { + this.server.sendResourceListChanged(); + } + } + /** + * Sends a tool list changed event to the client, if connected. + */ + sendToolListChanged() { + if (this.isConnected()) { + this.server.sendToolListChanged(); + } + } + /** + * Sends a prompt list changed event to the client, if connected. + */ + sendPromptListChanged() { + if (this.isConnected()) { + this.server.sendPromptListChanged(); + } + } +} +/** + * A resource template combines a URI pattern with optional functionality to enumerate + * all resources matching that pattern. + */ +export class ResourceTemplate { + constructor(uriTemplate, _callbacks) { + this._callbacks = _callbacks; + this._uriTemplate = + typeof uriTemplate === "string" + ? new UriTemplate(uriTemplate) + : uriTemplate; + } + /** + * Gets the URI template pattern. + */ + get uriTemplate() { + return this._uriTemplate; + } + /** + * Gets the list callback, if one was provided. + */ + get listCallback() { + return this._callbacks.list; + } + /** + * Gets the callback for completing a specific URI template variable, if one was provided. + */ + completeCallback(variable) { + var _a; + return (_a = this._callbacks.complete) === null || _a === void 0 ? void 0 : _a[variable]; + } +} +const EMPTY_OBJECT_JSON_SCHEMA = { + type: "object", +}; +// Helper to check if an object is a Zod schema (ZodRawShape) +function isZodRawShape(obj) { + if (typeof obj !== "object" || obj === null) + return false; + const isEmptyObject = Object.keys(obj).length === 0; + // Check if object is empty or at least one property is a ZodType instance + // Note: use heuristic check to avoid instanceof failure across different Zod versions + return isEmptyObject || Object.values(obj).some(isZodTypeLike); +} +function isZodTypeLike(value) { + return value !== null && + typeof value === 'object' && + 'parse' in value && typeof value.parse === 'function' && + 'safeParse' in value && typeof value.safeParse === 'function'; +} +function promptArgumentsFromSchema(schema) { + return Object.entries(schema.shape).map(([name, field]) => ({ + name, + description: field.description, + required: !field.isOptional(), + })); +} +function createCompletionResult(suggestions) { + return { + completion: { + values: suggestions.slice(0, 100), + total: suggestions.length, + hasMore: suggestions.length > 100, + }, + }; +} +const EMPTY_COMPLETION_RESULT = { + completion: { + values: [], + hasMore: false, + }, +}; +//# sourceMappingURL=mcp.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/mcp.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/mcp.js.map new file mode 100644 index 0000000000..6ac448c4ae --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/mcp.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../../src/server/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAiB,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EACL,CAAC,GASF,MAAM,KAAK,CAAC;AACb,OAAO,EAKL,QAAQ,EACR,SAAS,EAOT,kCAAkC,EAClC,yBAAyB,EACzB,sBAAsB,EACtB,qBAAqB,EACrB,0BAA0B,EAC1B,wBAAwB,EACxB,sBAAsB,EACtB,qBAAqB,GAStB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAkB,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAa,MAAM,0BAA0B,CAAC;AAIlE;;;;GAIG;AACH,MAAM,OAAO,SAAS;IAapB,YAAY,UAA0B,EAAE,OAAuB;QAPvD,yBAAoB,GAA0C,EAAE,CAAC;QACjE,iCAA4B,GAEhC,EAAE,CAAC;QACC,qBAAgB,GAAuC,EAAE,CAAC;QAC1D,uBAAkB,GAAyC,EAAE,CAAC;QAsB9D,6BAAwB,GAAG,KAAK,CAAC;QA6IjC,kCAA6B,GAAG,KAAK,CAAC;QAqGtC,iCAA4B,GAAG,KAAK,CAAC;QAkHrC,+BAA0B,GAAG,KAAK,CAAC;QAvXzC,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAChD,CAAC;IAED;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C,UAAU,EAAE;KAC9B,CAAC,CACH,CAAC;AACJ,CAAC;AAED,SAAS,sBAAsB,CAAC,WAAqB;IACnD,OAAO;QACL,UAAU,EAAE;YACV,MAAM,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC;YACjC,KAAK,EAAE,WAAW,CAAC,MAAM;YACzB,OAAO,EAAE,WAAW,CAAC,MAAM,GAAG,GAAG;SAClC;KACF,CAAC;AACJ,CAAC;AAED,MAAM,uBAAuB,GAAmB;IAC9C,UAAU,EAAE;QACV,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,KAAK;KACf;CACF,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/sse.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/sse.d.ts new file mode 100644 index 0000000000..5fb4e8d36d --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/sse.d.ts @@ -0,0 +1,53 @@ +import { IncomingMessage, ServerResponse } from "node:http"; +import { Transport } from "../shared/transport.js"; +import { JSONRPCMessage } from "../types.js"; +import { AuthInfo } from "./auth/types.js"; +/** + * Server transport for SSE: this will send messages over an SSE connection and receive messages from HTTP POST requests. + * + * This transport is only available in Node.js environments. + */ +export declare class SSEServerTransport implements Transport { + private _endpoint; + private res; + private _sseResponse?; + private _sessionId; + onclose?: () => void; + onerror?: (error: Error) => void; + onmessage?: (message: JSONRPCMessage, extra?: { + authInfo?: AuthInfo; + }) => void; + /** + * Creates a new SSE server transport, which will direct the client to POST messages to the relative or absolute URL identified by `_endpoint`. + */ + constructor(_endpoint: string, res: ServerResponse); + /** + * Handles the initial SSE connection request. + * + * This should be called when a GET request is made to establish the SSE stream. + */ + start(): Promise; + /** + * Handles incoming POST messages. + * + * This should be called when a POST request is made to send a message to the server. + */ + handlePostMessage(req: IncomingMessage & { + auth?: AuthInfo; + }, res: ServerResponse, parsedBody?: unknown): Promise; + /** + * Handle a client message, regardless of how it arrived. This can be used to inform the server of messages that arrive via a means different than HTTP POST. + */ + handleMessage(message: unknown, extra?: { + authInfo?: AuthInfo; + }): Promise; + close(): Promise; + send(message: JSONRPCMessage): Promise; + /** + * Returns the session ID for this transport. + * + * This can be used to route incoming POST requests. + */ + get sessionId(): string; +} +//# sourceMappingURL=sse.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/sse.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/sse.d.ts.map new file mode 100644 index 0000000000..66c20c62ac --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/sse.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"sse.d.ts","sourceRoot":"","sources":["../../../src/server/sse.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAwB,MAAM,aAAa,CAAC;AAGnE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAK3C;;;;GAIG;AACH,qBAAa,kBAAmB,YAAW,SAAS;IAYhD,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,GAAG;IAZb,OAAO,CAAC,YAAY,CAAC,CAAiB;IACtC,OAAO,CAAC,UAAU,CAAS;IAE3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,QAAQ,CAAA;KAAE,KAAK,IAAI,CAAC;IAE/E;;OAEG;gBAEO,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,cAAc;IAK7B;;;;OAIG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAkC5B;;;;OAIG;IACG,iBAAiB,CACrB,GAAG,EAAE,eAAe,GAAG;QAAE,IAAI,CAAC,EAAE,QAAQ,CAAA;KAAE,EAC1C,GAAG,EAAE,cAAc,EACnB,UAAU,CAAC,EAAE,OAAO,GACnB,OAAO,CAAC,IAAI,CAAC;IAmChB;;OAEG;IACG,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAY/E,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAMtB,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAUlD;;;;OAIG;IACH,IAAI,SAAS,IAAI,MAAM,CAEtB;CACF"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/sse.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/sse.js new file mode 100644 index 0000000000..08597c89be --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/sse.js @@ -0,0 +1,125 @@ +import { randomUUID } from "node:crypto"; +import { JSONRPCMessageSchema } from "../types.js"; +import getRawBody from "raw-body"; +import contentType from "content-type"; +import { URL } from 'url'; +const MAXIMUM_MESSAGE_SIZE = "4mb"; +/** + * Server transport for SSE: this will send messages over an SSE connection and receive messages from HTTP POST requests. + * + * This transport is only available in Node.js environments. + */ +export class SSEServerTransport { + /** + * Creates a new SSE server transport, which will direct the client to POST messages to the relative or absolute URL identified by `_endpoint`. + */ + constructor(_endpoint, res) { + this._endpoint = _endpoint; + this.res = res; + this._sessionId = randomUUID(); + } + /** + * Handles the initial SSE connection request. + * + * This should be called when a GET request is made to establish the SSE stream. + */ + async start() { + if (this._sseResponse) { + throw new Error("SSEServerTransport already started! If using Server class, note that connect() calls start() automatically."); + } + this.res.writeHead(200, { + "Content-Type": "text/event-stream", + "Cache-Control": "no-cache, no-transform", + Connection: "keep-alive", + }); + // Send the endpoint event + // Use a dummy base URL because this._endpoint is relative. + // This allows using URL/URLSearchParams for robust parameter handling. + const dummyBase = 'http://localhost'; // Any valid base works + const endpointUrl = new URL(this._endpoint, dummyBase); + endpointUrl.searchParams.set('sessionId', this._sessionId); + // Reconstruct the relative URL string (pathname + search + hash) + const relativeUrlWithSession = endpointUrl.pathname + endpointUrl.search + endpointUrl.hash; + this.res.write(`event: endpoint\ndata: ${relativeUrlWithSession}\n\n`); + this._sseResponse = this.res; + this.res.on("close", () => { + var _a; + this._sseResponse = undefined; + (_a = this.onclose) === null || _a === void 0 ? void 0 : _a.call(this); + }); + } + /** + * Handles incoming POST messages. + * + * This should be called when a POST request is made to send a message to the server. + */ + async handlePostMessage(req, res, parsedBody) { + var _a, _b, _c; + if (!this._sseResponse) { + const message = "SSE connection not established"; + res.writeHead(500).end(message); + throw new Error(message); + } + const authInfo = req.auth; + let body; + try { + const ct = contentType.parse((_a = req.headers["content-type"]) !== null && _a !== void 0 ? _a : ""); + if (ct.type !== "application/json") { + throw new Error(`Unsupported content-type: ${ct}`); + } + body = parsedBody !== null && parsedBody !== void 0 ? parsedBody : await getRawBody(req, { + limit: MAXIMUM_MESSAGE_SIZE, + encoding: (_b = ct.parameters.charset) !== null && _b !== void 0 ? _b : "utf-8", + }); + } + catch (error) { + res.writeHead(400).end(String(error)); + (_c = this.onerror) === null || _c === void 0 ? void 0 : _c.call(this, error); + return; + } + try { + await this.handleMessage(typeof body === 'string' ? JSON.parse(body) : body, { authInfo }); + } + catch (_d) { + res.writeHead(400).end(`Invalid message: ${body}`); + return; + } + res.writeHead(202).end("Accepted"); + } + /** + * Handle a client message, regardless of how it arrived. This can be used to inform the server of messages that arrive via a means different than HTTP POST. + */ + async handleMessage(message, extra) { + var _a, _b; + let parsedMessage; + try { + parsedMessage = JSONRPCMessageSchema.parse(message); + } + catch (error) { + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + throw error; + } + (_b = this.onmessage) === null || _b === void 0 ? void 0 : _b.call(this, parsedMessage, extra); + } + async close() { + var _a, _b; + (_a = this._sseResponse) === null || _a === void 0 ? void 0 : _a.end(); + this._sseResponse = undefined; + (_b = this.onclose) === null || _b === void 0 ? void 0 : _b.call(this); + } + async send(message) { + if (!this._sseResponse) { + throw new Error("Not connected"); + } + this._sseResponse.write(`event: message\ndata: ${JSON.stringify(message)}\n\n`); + } + /** + * Returns the session ID for this transport. + * + * This can be used to route incoming POST requests. + */ + get sessionId() { + return this._sessionId; + } +} +//# sourceMappingURL=sse.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/sse.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/sse.js.map new file mode 100644 index 0000000000..90fba38ef0 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/sse.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sse.js","sourceRoot":"","sources":["../../../src/server/sse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,OAAO,EAAkB,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,UAAU,MAAM,UAAU,CAAC;AAClC,OAAO,WAAW,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAEnC;;;;GAIG;AACH,MAAM,OAAO,kBAAkB;IAQ7B;;OAEG;IACH,YACU,SAAiB,EACjB,GAAmB;QADnB,cAAS,GAAT,SAAS,CAAQ;QACjB,QAAG,GAAH,GAAG,CAAgB;QAE3B,IAAI,CAAC,UAAU,GAAG,UAAU,EAAE,CAAC;IACjC,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,KAAK;QACT,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CACb,6GAA6G,CAC9G,CAAC;QACJ,CAAC;QAED,IA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oBAAoB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACtD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAA,IAAI,CAAC,OAAO,qDAAG,KAAc,CAAC,CAAC;YAC/B,MAAM,KAAK,CAAC;QACd,CAAC;QAED,MAAA,IAAI,CAAC,SAAS,qDAAG,aAAa,EAAE,KAAK,CAAC,CAAC;IACzC,CAAC;IAED,KAAK,CAAC,KAAK;;QACT,MAAA,IAAI,CAAC,YAAY,0CAAE,GAAG,EAAE,CAAC;QACzB,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC;QAC9B,MAAA,IAAI,CAAC,OAAO,oDAAI,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,OAAuB;QAChC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YACvB,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;QACnC,CAAC;QAED,IAAI,CAAC,YAAY,CAAC,KAAK,CACrB,yBAAyB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CACvD,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;CACF"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/stdio.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/stdio.d.ts new file mode 100644 index 0000000000..92ab191948 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/stdio.d.ts @@ -0,0 +1,28 @@ +import { Readable, Writable } from "node:stream"; +import { JSONRPCMessage } from "../types.js"; +import { Transport } from "../shared/transport.js"; +/** + * Server transport for stdio: this communicates with a MCP client by reading from the current process' stdin and writing to stdout. + * + * This transport is only available in Node.js environments. + */ +export declare class StdioServerTransport implements Transport { + private _stdin; + private _stdout; + private _readBuffer; + private _started; + constructor(_stdin?: Readable, _stdout?: Writable); + onclose?: () => void; + onerror?: (error: Error) => void; + onmessage?: (message: JSONRPCMessage) => void; + _ondata: (chunk: Buffer) => void; + _onerror: (error: Error) => void; + /** + * Starts listening for messages on stdin. + */ + start(): Promise; + private processReadBuffer; + close(): Promise; + send(message: JSONRPCMessage): Promise; +} +//# sourceMappingURL=stdio.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/stdio.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/stdio.d.ts.map new file mode 100644 index 0000000000..d2d2417ab7 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/stdio.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"stdio.d.ts","sourceRoot":"","sources":["../../../src/server/stdio.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD;;;;GAIG;AACH,qBAAa,oBAAqB,YAAW,SAAS;IAKlD,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,OAAO;IALjB,OAAO,CAAC,WAAW,CAAgC;IACnD,OAAO,CAAC,QAAQ,CAAS;gBAGf,MAAM,GAAE,QAAwB,EAChC,OAAO,GAAE,QAAyB;IAG5C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;IAG9C,OAAO,UAAW,MAAM,UAGtB;IACF,QAAQ,UAAW,KAAK,UAEtB;IAEF;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAY5B,OAAO,CAAC,iBAAiB;IAenB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAkB5B,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAU7C"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/stdio.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/stdio.js new file mode 100644 index 0000000000..1605bd629a --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/stdio.js @@ -0,0 +1,78 @@ +import process from "node:process"; +import { ReadBuffer, serializeMessage } from "../shared/stdio.js"; +/** + * Server transport for stdio: this communicates with a MCP client by reading from the current process' stdin and writing to stdout. + * + * This transport is only available in Node.js environments. + */ +export class StdioServerTransport { + constructor(_stdin = process.stdin, _stdout = process.stdout) { + this._stdin = _stdin; + this._stdout = _stdout; + this._readBuffer = new ReadBuffer(); + this._started = false; + // Arrow functions to bind `this` properly, while maintaining function identity. + this._ondata = (chunk) => { + this._readBuffer.append(chunk); + this.processReadBuffer(); + }; + this._onerror = (error) => { + var _a; + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + }; + } + /** + * Starts listening for messages on stdin. + */ + async start() { + if (this._started) { + throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically."); + } + this._started = true; + this._stdin.on("data", this._ondata); + this._stdin.on("error", this._onerror); + } + processReadBuffer() { + var _a, _b; + while (true) { + try { + const message = this._readBuffer.readMessage(); + if (message === null) { + break; + } + (_a = this.onmessage) === null || _a === void 0 ? void 0 : _a.call(this, message); + } + catch (error) { + (_b = this.onerror) === null || _b === void 0 ? void 0 : _b.call(this, error); + } + } + } + async close() { + var _a; + // Remove our event listeners first + this._stdin.off("data", this._ondata); + this._stdin.off("error", this._onerror); + // Check if we were the only data listener + const remainingDataListeners = this._stdin.listenerCount('data'); + if (remainingDataListeners === 0) { + // Only pause stdin if we were the only listener + // This prevents interfering with other parts of the application that might be using stdin + this._stdin.pause(); + } + // Clear the buffer and notify closure + this._readBuffer.clear(); + (_a = this.onclose) === null || _a === void 0 ? void 0 : _a.call(this); + } + send(message) { + return new Promise((resolve) => { + const json = serializeMessage(message); + if (this._stdout.write(json)) { + resolve(); + } + else { + this._stdout.once("drain", resolve); + } + }); + } +} +//# sourceMappingURL=stdio.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/stdio.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/stdio.js.map new file mode 100644 index 0000000000..aa3698c691 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/stdio.js.map @@ -0,0 +1 @@ +{"version":3,"file":"stdio.js","sourceRoot":"","sources":["../../../src/server/stdio.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,cAAc,CAAC;AAEnC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAIlE;;;;GAIG;AACH,MAAM,OAAO,oBAAoB;IAI/B,YACU,SAAmB,OAAO,CAAC,KAAK,EAChC,UAAoB,OAAO,CAAC,MAAM;QADlC,WAAM,GAAN,MAAM,CAA0B;QAChC,YAAO,GAAP,OAAO,CAA2B;QALpC,gBAAW,GAAe,IAAI,UAAU,EAAE,CAAC;QAC3C,aAAQ,GAAG,KAAK,CAAC;QAWzB,gFAAgF;QAChF,YAAO,GAAG,CAAC,KAAa,EAAE,EAAE;YAC1B,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC/B,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAC3B,CAAC,CAAC;QACF,aAAQ,GAAG,CAAC,KAAY,EAAE,EAAE;;YAC1B,MAAA,IAAI,CAAC,OAAO,qDAAG,KAAK,CAAC,CAAC;QACxB,CAAC,CAAC;IAbC,CAAC;IAeJ;;OAEG;IACH,KAAK,CAAC,KAAK;QACT,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,MAAM,IAAI,KAAK,CACb,+GAA+G,CAChH,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,QAAQ,G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,IAAI,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;YACvC,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC7B,OAAO,EAAE,CAAC;YACZ,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YACtC,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/streamableHttp.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/streamableHttp.d.ts new file mode 100644 index 0000000000..2a2e86095e --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/streamableHttp.d.ts @@ -0,0 +1,151 @@ +import { IncomingMessage, ServerResponse } from "node:http"; +import { Transport } from "../shared/transport.js"; +import { JSONRPCMessage, RequestId } from "../types.js"; +import { AuthInfo } from "./auth/types.js"; +export type StreamId = string; +export type EventId = string; +/** + * Interface for resumability support via event storage + */ +export interface EventStore { + /** + * Stores an event for later retrieval + * @param streamId ID of the stream the event belongs to + * @param message The JSON-RPC message to store + * @returns The generated event ID for the stored event + */ + storeEvent(streamId: StreamId, message: JSONRPCMessage): Promise; + replayEventsAfter(lastEventId: EventId, { send }: { + send: (eventId: EventId, message: JSONRPCMessage) => Promise; + }): Promise; +} +/** + * Configuration options for StreamableHTTPServerTransport + */ +export interface StreamableHTTPServerTransportOptions { + /** + * Function that generates a session ID for the transport. + * The session ID SHOULD be globally unique and cryptographically secure (e.g., a securely generated UUID, a JWT, or a cryptographic hash) + * + * Return undefined to disable session management. + */ + sessionIdGenerator: (() => string) | undefined; + /** + * A callback for session initialization events + * This is called when the server initializes a new session. + * Useful in cases when you need to register multiple mcp sessions + * and need to keep track of them. + * @param sessionId The generated session ID + */ + onsessioninitialized?: (sessionId: string) => void; + /** + * If true, the server will return JSON responses instead of starting an SSE stream. + * This can be useful for simple request/response scenarios without streaming. + * Default is false (SSE streams are preferred). + */ + enableJsonResponse?: boolean; + /** + * Event store for resumability support + * If provided, resumability will be enabled, allowing clients to reconnect and resume messages + */ + eventStore?: EventStore; +} +/** + * Server transport for Streamable HTTP: this implements the MCP Streamable HTTP transport specification. + * It supports both SSE streaming and direct HTTP responses. + * + * Usage example: + * + * ```typescript + * // Stateful mode - server sets the session ID + * const statefulTransport = new StreamableHTTPServerTransport({ + * sessionIdGenerator: () => randomUUID(), + * }); + * + * // Stateless mode - explicitly set session ID to undefined + * const statelessTransport = new StreamableHTTPServerTransport({ + * sessionIdGenerator: undefined, + * }); + * + * // Using with pre-parsed request body + * app.post('/mcp', (req, res) => { + * transport.handleRequest(req, res, req.body); + * }); + * ``` + * + * In stateful mode: + * - Session ID is generated and included in response headers + * - Session ID is always included in initialization responses + * - Requests with invalid session IDs are rejected with 404 Not Found + * - Non-initialization requests without a session ID are rejected with 400 Bad Request + * - State is maintained in-memory (connections, message history) + * + * In stateless mode: + * - No Session ID is included in any responses + * - No session validation is performed + */ +export declare class StreamableHTTPServerTransport implements Transport { + private sessionIdGenerator; + private _started; + private _streamMapping; + private _requestToStreamMapping; + private _requestResponseMap; + private _initialized; + private _enableJsonResponse; + private _standaloneSseStreamId; + private _eventStore?; + private _onsessioninitialized?; + sessionId?: string | undefined; + onclose?: () => void; + onerror?: (error: Error) => void; + onmessage?: (message: JSONRPCMessage, extra?: { + authInfo?: AuthInfo; + }) => void; + constructor(options: StreamableHTTPServerTransportOptions); + /** + * Starts the transport. This is required by the Transport interface but is a no-op + * for the Streamable HTTP transport as connections are managed per-request. + */ + start(): Promise; + /** + * Handles an incoming HTTP request, whether GET or POST + */ + handleRequest(req: IncomingMessage & { + auth?: AuthInfo; + }, res: ServerResponse, parsedBody?: unknown): Promise; + /** + * Handles GET requests for SSE stream + */ + private handleGetRequest; + /** + * Replays events that would have been sent after the specified event ID + * Only used when resumability is enabled + */ + private replayEvents; + /** + * Writes an event to the SSE stream with proper formatting + */ + private writeSSEEvent; + /** + * Handles unsupported requests (PUT, PATCH, etc.) + */ + private handleUnsupportedRequest; + /** + * Handles POST requests containing JSON-RPC messages + */ + private handlePostRequest; + /** + * Handles DELETE requests to terminate sessions + */ + private handleDeleteRequest; + /** + * Validates session ID for non-initialization requests + * Returns true if the session is valid, false otherwise + */ + private validateSession; + close(): Promise; + send(message: JSONRPCMessage, options?: { + relatedRequestId?: RequestId; + }): Promise; +} +//# sourceMappingURL=streamableHttp.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/streamableHttp.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/streamableHttp.d.ts.map new file mode 100644 index 0000000000..3dfcb4fb35 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/streamableHttp.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"streamableHttp.d.ts","sourceRoot":"","sources":["../../../src/server/streamableHttp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAA4E,cAAc,EAAwB,SAAS,EAAE,MAAM,aAAa,CAAC;AAIxJ,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAI3C,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAC9B,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC;AAE7B;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB;;;;;OAKG;IACH,UAAU,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAE1E,iBAAiB,CAAC,WAAW,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE;QAChD,IAAI,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,KAAK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G,EAAE,eAAe,GAAG;QAAE,IAAI,CAAC,EAAE,QAAQ,CAAA;KAAE,EAAE,GAAG,EAAE,cAAc,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAYzH;;OAEG;YACW,gBAAgB;IAqE9B;;;OAGG;YACW,YAAY;IA8B1B;;OAEG;IACH,OAAO,CAAC,aAAa;IAWrB;;OAEG;YACW,wBAAwB;IAatC;;OAEG;YACW,iBAAiB;IAmK/B;;OAEG;YACW,mBAAmB;IAQjC;;;OAGG;IACH,OAAO,CAAC,eAAe;IA4DjB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAYtB,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE;QAAE,gBAAgB,CAAC,EAAE,SAAS,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAgG/F"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/streamableHttp.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/streamableHttp.js new file mode 100644 index 0000000000..f220d4ca87 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/streamableHttp.js @@ -0,0 +1,532 @@ +import { isInitializeRequest, isJSONRPCError, isJSONRPCRequest, isJSONRPCResponse, JSONRPCMessageSchema } from "../types.js"; +import getRawBody from "raw-body"; +import contentType from "content-type"; +import { randomUUID } from "node:crypto"; +const MAXIMUM_MESSAGE_SIZE = "4mb"; +/** + * Server transport for Streamable HTTP: this implements the MCP Streamable HTTP transport specification. + * It supports both SSE streaming and direct HTTP responses. + * + * Usage example: + * + * ```typescript + * // Stateful mode - server sets the session ID + * const statefulTransport = new StreamableHTTPServerTransport({ + * sessionIdGenerator: () => randomUUID(), + * }); + * + * // Stateless mode - explicitly set session ID to undefined + * const statelessTransport = new StreamableHTTPServerTransport({ + * sessionIdGenerator: undefined, + * }); + * + * // Using with pre-parsed request body + * app.post('/mcp', (req, res) => { + * transport.handleRequest(req, res, req.body); + * }); + * ``` + * + * In stateful mode: + * - Session ID is generated and included in response headers + * - Session ID is always included in initialization responses + * - Requests with invalid session IDs are rejected with 404 Not Found + * - Non-initialization requests without a session ID are rejected with 400 Bad Request + * - State is maintained in-memory (connections, message history) + * + * In stateless mode: + * - No Session ID is included in any responses + * - No session validation is performed + */ +export class StreamableHTTPServerTransport { + constructor(options) { + var _a; + this._started = false; + this._streamMapping = new Map(); + this._requestToStreamMapping = new Map(); + this._requestResponseMap = new Map(); + this._initialized = false; + this._enableJsonResponse = false; + this._standaloneSseStreamId = '_GET_stream'; + this.sessionIdGenerator = options.sessionIdGenerator; + this._enableJsonResponse = (_a = options.enableJsonResponse) !== null && _a !== void 0 ? _a : false; + this._eventStore = options.eventStore; + this._onsessioninitialized = options.onsessioninitialized; + } + /** + * Starts the transport. This is required by the Transport interface but is a no-op + * for the Streamable HTTP transport as connections are managed per-request. + */ + async start() { + if (this._started) { + throw new Error("Transport already started"); + } + this._started = true; + } + /** + * Handles an incoming HTTP request, whether GET or POST + */ + async handleRequest(req, res, parsedBody) { + if (req.method === "POST") { + await this.handlePostRequest(req, res, parsedBody); + } + else if (req.method === "GET") { + await this.handleGetRequest(req, res); + } + else if (req.method === "DELETE") { + await this.handleDeleteRequest(req, res); + } + else { + await this.handleUnsupportedRequest(res); + } + } + /** + * Handles GET requests for SSE stream + */ + async handleGetRequest(req, res) { + // The client MUST include an Accept header, listing text/event-stream as a supported content type. + const acceptHeader = req.headers.accept; + if (!(acceptHeader === null || acceptHeader === void 0 ? void 0 : acceptHeader.includes("text/event-stream"))) { + res.writeHead(406).end(JSON.stringify({ + jsonrpc: "2.0", + error: { + code: -32000, + message: "Not Acceptable: Client must accept text/event-stream" + }, + id: null + })); + return; + } + // If an Mcp-Session-Id is returned by the server during initialization, + // clients using the Streamable HTTP transport MUST include it + // in the Mcp-Session-Id header on all of their subsequent HTTP requests. + if (!this.validateSession(req, res)) { + return; + } + // Handle resumability: check for Last-Event-ID header + if (this._eventStore) { + const lastEventId = req.headers['last-event-id']; + if (lastEventId) { + await this.replayEvents(lastEventId, res); + return; + } + } + // The server MUST either return Content-Type: text/event-stream in response to this HTTP GET, + // or else return HTTP 405 Method Not Allowed + const headers = { + "Content-Type": "text/event-stream", + "Cache-Control": "no-cache, no-transform", + Connection: "keep-alive", + }; + // After initialization, always include the session ID if we have one + if (this.sessionId !== undefined) { + headers["mcp-session-id"] = this.sessionId; + } + // Check if there's already an active standalone SSE stream for this session + if (this._streamMapping.get(this._standaloneSseStreamId) !== undefined) { + // Only one GET SSE stream is allowed per session + res.writeHead(409).end(JSON.stringify({ + jsonrpc: "2.0", + error: { + code: -32000, + message: "Conflict: Only one SSE stream is allowed per session" + }, + id: null + })); + return; + } + // We need to send headers immediately as messages will arrive much later, + // otherwise the client will just wait for the first message + res.writeHead(200, headers).flushHeaders(); + // Assign the response to the standalone SSE stream + this._streamMapping.set(this._standaloneSseStreamId, res); + // Set up close handler for client disconnects + res.on("close", () => { + this._streamMapping.delete(this._standaloneSseStreamId); + }); + } + /** + * Replays events that would have been sent after the specified event ID + * Only used when resumability is enabled + */ + async replayEvents(lastEventId, res) { + var _a, _b; + if (!this._eventStore) { + return; + } + try { + const headers = { + "Content-Type": "text/event-stream", + "Cache-Control": "no-cache, no-transform", + Connection: "keep-alive", + }; + if (this.sessionId !== undefined) { + headers["mcp-session-id"] = this.sessionId; + } + res.writeHead(200, headers).flushHeaders(); + const streamId = await ((_a = this._eventStore) === null || _a === void 0 ? void 0 : _a.replayEventsAfter(lastEventId, { + send: async (eventId, message) => { + var _a; + if (!this.writeSSEEvent(res, message, eventId)) { + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, new Error("Failed replay events")); + res.end(); + } + } + })); + this._streamMapping.set(streamId, res); + } + catch (error) { + (_b = this.onerror) === null || _b === void 0 ? void 0 : _b.call(this, error); + } + } + /** + * Writes an event to the SSE stream with proper formatting + */ + writeSSEEvent(res, message, eventId) { + let eventData = `event: message\n`; + // Include event ID if provided - this is important for resumability + if (eventId) { + eventData += `id: ${eventId}\n`; + } + eventData += `data: ${JSON.stringify(message)}\n\n`; + return res.write(eventData); + } + /** + * Handles unsupported requests (PUT, PATCH, etc.) + */ + async handleUnsupportedRequest(res) { + res.writeHead(405, { + "Allow": "GET, POST, DELETE" + }).end(JSON.stringify({ + jsonrpc: "2.0", + error: { + code: -32000, + message: "Method not allowed." + }, + id: null + })); + } + /** + * Handles POST requests containing JSON-RPC messages + */ + async handlePostRequest(req, res, parsedBody) { + var _a, _b, _c, _d, _e; + try { + // Validate the Accept header + const acceptHeader = req.headers.accept; + // The client MUST include an Accept header, listing both application/json and text/event-stream as supported content types. + if (!(acceptHeader === null || acceptHeader === void 0 ? void 0 : acceptHeader.includes("application/json")) || !acceptHeader.includes("text/event-stream")) { + res.writeHead(406).end(JSON.stringify({ + jsonrpc: "2.0", + error: { + code: -32000, + message: "Not Acceptable: Client must accept both application/json and text/event-stream" + }, + id: null + })); + return; + } + const ct = req.headers["content-type"]; + if (!ct || !ct.includes("application/json")) { + res.writeHead(415).end(JSON.stringify({ + jsonrpc: "2.0", + error: { + code: -32000, + message: "Unsupported Media Type: Content-Type must be application/json" + }, + id: null + })); + return; + } + const authInfo = req.auth; + let rawMessage; + if (parsedBody !== undefined) { + rawMessage = parsedBody; + } + else { + const parsedCt = contentType.parse(ct); + const body = await getRawBody(req, { + limit: MAXIMUM_MESSAGE_SIZE, + encoding: (_a = parsedCt.parameters.charset) !== null && _a !== void 0 ? _a : "utf-8", + }); + rawMessage = JSON.parse(body.toString()); + } + let messages; + // handle batch and single messages + if (Array.isArray(rawMessage)) { + messages = rawMessage.map(msg => JSONRPCMessageSchema.parse(msg)); + } + else { + messages = [JSONRPCMessageSchema.parse(rawMessage)]; + } + // Check if this is an initialization request + // https://spec.modelcontextprotocol.io/specification/2025-03-26/basic/lifecycle/ + const isInitializationRequest = messages.some(isInitializeRequest); + if (isInitializationRequest) { + // If it's a server with session management and the session ID is already set we should reject the request + // to avoid re-initialization. + if (this._initialized && this.sessionId !== undefined) { + res.writeHead(400).end(JSON.stringify({ + jsonrpc: "2.0", + error: { + code: -32600, + message: "Invalid Request: Server already initialized" + }, + id: null + })); + return; + } + if (messages.length > 1) { + res.writeHead(400).end(JSON.stringify({ + jsonrpc: "2.0", + error: { + code: -32600, + message: "Invalid Request: Only one initialization request is allowed" + }, + id: null + })); + return; + } + this.sessionId = (_b = this.sessionIdGenerator) === null || _b === void 0 ? void 0 : _b.call(this); + this._initialized = true; + // If we have a session ID and an onsessioninitialized handler, call it immediately + // This is needed in cases where the server needs to keep track of multiple sessions + if (this.sessionId && this._onsessioninitialized) { + this._onsessioninitialized(this.sessionId); + } + } + // If an Mcp-Session-Id is returned by the server during initialization, + // clients using the Streamable HTTP transport MUST include it + // in the Mcp-Session-Id header on all of their subsequent HTTP requests. + if (!isInitializationRequest && !this.validateSession(req, res)) { + return; + } + // check if it contains requests + const hasRequests = messages.some(isJSONRPCRequest); + if (!hasRequests) { + // if it only contains notifications or responses, return 202 + res.writeHead(202).end(); + // handle each message + for (const message of messages) { + (_c = this.onmessage) === null || _c === void 0 ? void 0 : _c.call(this, message, { authInfo }); + } + } + else if (hasRequests) { + // The default behavior is to use SSE streaming + // but in some cases server will return JSON responses + const streamId = randomUUID(); + if (!this._enableJsonResponse) { + const headers = { + "Content-Type": "text/event-stream", + "Cache-Control": "no-cache", + Connection: "keep-alive", + }; + // After initialization, always include the session ID if we have one + if (this.sessionId !== undefined) { + headers["mcp-session-id"] = this.sessionId; + } + res.writeHead(200, headers); + } + // Store the response for this request to send messages back through this connection + // We need to track by request ID to maintain the connection + for (const message of messages) { + if (isJSONRPCRequest(message)) { + this._streamMapping.set(streamId, res); + this._requestToStreamMapping.set(message.id, streamId); + } + } + // Set up close handler for client disconnects + res.on("close", () => { + this._streamMapping.delete(streamId); + }); + // handle each message + for (const message of messages) { + (_d = this.onmessage) === null || _d === void 0 ? void 0 : _d.call(this, message, { authInfo }); + } + // The server SHOULD NOT close the SSE stream before sending all JSON-RPC responses + // This will be handled by the send() method when responses are ready + } + } + catch (error) { + // return JSON-RPC formatted error + res.writeHead(400).end(JSON.stringify({ + jsonrpc: "2.0", + error: { + code: -32700, + message: "Parse error", + data: String(error) + }, + id: null + })); + (_e = this.onerror) === null || _e === void 0 ? void 0 : _e.call(this, error); + } + } + /** + * Handles DELETE requests to terminate sessions + */ + async handleDeleteRequest(req, res) { + if (!this.validateSession(req, res)) { + return; + } + await this.close(); + res.writeHead(200).end(); + } + /** + * Validates session ID for non-initialization requests + * Returns true if the session is valid, false otherwise + */ + validateSession(req, res) { + if (this.sessionIdGenerator === undefined) { + // If the sessionIdGenerator ID is not set, the session management is disabled + // and we don't need to validate the session ID + return true; + } + if (!this._initialized) { + // If the server has not been initialized yet, reject all requests + res.writeHead(400).end(JSON.stringify({ + jsonrpc: "2.0", + error: { + code: -32000, + message: "Bad Request: Server not initialized" + }, + id: null + })); + return false; + } + const sessionId = req.headers["mcp-session-id"]; + if (!sessionId) { + // Non-initialization requests without a session ID should return 400 Bad Request + res.writeHead(400).end(JSON.stringify({ + jsonrpc: "2.0", + error: { + code: -32000, + message: "Bad Request: Mcp-Session-Id header is required" + }, + id: null + })); + return false; + } + else if (Array.isArray(sessionId)) { + res.writeHead(400).end(JSON.stringify({ + jsonrpc: "2.0", + error: { + code: -32000, + message: "Bad Request: Mcp-Session-Id header must be a single value" + }, + id: null + })); + return false; + } + else if (sessionId !== this.sessionId) { + // Reject requests with invalid session ID with 404 Not Found + res.writeHead(404).end(JSON.stringify({ + jsonrpc: "2.0", + error: { + code: -32001, + message: "Session not found" + }, + id: null + })); + return false; + } + return true; + } + async close() { + var _a; + // Close all SSE connections + this._streamMapping.forEach((response) => { + response.end(); + }); + this._streamMapping.clear(); + // Clear any pending responses + this._requestResponseMap.clear(); + (_a = this.onclose) === null || _a === void 0 ? void 0 : _a.call(this); + } + async send(message, options) { + let requestId = options === null || options === void 0 ? void 0 : options.relatedRequestId; + if (isJSONRPCResponse(message) || isJSONRPCError(message)) { + // If the message is a response, use the request ID from the message + requestId = message.id; + } + // Check if this message should be sent on the standalone SSE stream (no request ID) + // Ignore notifications from tools (which have relatedRequestId set) + // Those will be sent via dedicated response SSE streams + if (requestId === undefined) { + // For standalone SSE streams, we can only send requests and notifications + if (isJSONRPCResponse(message) || isJSONRPCError(message)) { + throw new Error("Cannot send a response on a standalone SSE stream unless resuming a previous client request"); + } + const standaloneSse = this._streamMapping.get(this._standaloneSseStreamId); + if (standaloneSse === undefined) { + // The spec says the server MAY send messages on the stream, so it's ok to discard if no stream + return; + } + // Generate and store event ID if event store is provided + let eventId; + if (this._eventStore) { + // Stores the event and gets the generated event ID + eventId = await this._eventStore.storeEvent(this._standaloneSseStreamId, message); + } + // Send the message to the standalone SSE stream + this.writeSSEEvent(standaloneSse, message, eventId); + return; + } + // Get the response for this request + const streamId = this._requestToStreamMapping.get(requestId); + const response = this._streamMapping.get(streamId); + if (!streamId) { + throw new Error(`No connection established for request ID: ${String(requestId)}`); + } + if (!this._enableJsonResponse) { + // For SSE responses, generate event ID if event store is provided + let eventId; + if (this._eventStore) { + eventId = await this._eventStore.storeEvent(streamId, message); + } + if (response) { + // Write the event to the response stream + this.writeSSEEvent(response, message, eventId); + } + } + if (isJSONRPCResponse(message) || isJSONRPCError(message)) { + this._requestResponseMap.set(requestId, message); + const relatedIds = Array.from(this._requestToStreamMapping.entries()) + .filter(([_, streamId]) => this._streamMapping.get(streamId) === response) + .map(([id]) => id); + // Check if we have responses for all requests using this connection + const allResponsesReady = relatedIds.every(id => this._requestResponseMap.has(id)); + if (allResponsesReady) { + if (!response) { + throw new Error(`No connection established for request ID: ${String(requestId)}`); + } + if (this._enableJsonResponse) { + // All responses ready, send as JSON + const headers = { + 'Content-Type': 'application/json', + }; + if (this.sessionId !== undefined) { + headers['mcp-session-id'] = this.sessionId; + } + const responses = relatedIds + .map(id => this._requestResponseMap.get(id)); + response.writeHead(200, headers); + if (responses.length === 1) { + response.end(JSON.stringify(responses[0])); + } + else { + response.end(JSON.stringify(responses)); + } + } + else { + // End the SSE stream + response.end(); + } + // Clean up + for (const id of relatedIds) { + this._requestResponseMap.delete(id); + this._requestToStreamMapping.delete(id); + } + } + } + } +} +//# sourceMappingURL=streamableHttp.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/server/streamableHttp.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/streamableHttp.js.map new file mode 100644 index 0000000000..22e026676c --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/server/streamableHttp.js.map @@ -0,0 +1 @@ +{"version":3,"file":"streamableHttp.js","sourceRoot":"","sources":["../../../src/server/streamableHttp.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,gBAAgB,EAAE,iBAAiB,EAAkB,oBAAoB,EAAa,MAAM,aAAa,CAAC;AACxJ,OAAO,UAAU,MAAM,UAAU,CAAC;AAClC,OAAO,WAAW,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAyDnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,OAAO,6BAA6B;IAkBxC,YAAY,OAA6C;;QAfjD,aAAQ,GAAY,KAAK,CAAC;QAC1B,mBAAc,GAAgC,IAAI,GAAG,EAAE,CAAC;QACxD,4BAAuB,GAA2B,IAAI,GAAG,EAAE,CAAC;QAC5D,wBAAmB,GAAmC,IAAI,GAAG,EAAE,CAAC;QAChE,iBAAY,GAAY,KAAK,CAAC;QAC9B,wBAAmB,GAAY,KAAK,CAAC;QACrC,2BAAsB,GAAW,aAAa,CAAC;QAUrD,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC;QACrD,IAAI,CAAC,mBAAmB,GAAG,MAAA,OAAO,CAAC,kBAAkB,mCAAI,KA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AAgB,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC;oBAC7C,CAAC;oBAED,MAAM,SAAS,GAAG,UAAU;yBACzB,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,EAAE,CAAE,CAAC,CAAC;oBAEhD,QAAQ,CAAC,SAAS,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;oBACjC,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;wBAC3B,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;oBAC7C,CAAC;yBAAM,CAAC;wBACN,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;oBAC1C,CAAC;gBACH,CAAC;qBAAM,CAAC;oBACN,qBAAqB;oBACrB,QAAQ,CAAC,GAAG,EAAE,CAAC;gBACjB,CAAC;gBACD,WAAW;gBACX,KAAK,MAAM,EAAE,IAAI,UAAU,EAAE,CAAC;oBAC5B,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;oBACpC,IAAI,CAAC,uBAAuB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;gBAC1C,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/auth.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/auth.d.ts new file mode 100644 index 0000000000..a14f1e706a --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/auth.d.ts @@ -0,0 +1,321 @@ +import { z } from "zod"; +/** + * RFC 9728 OAuth Protected Resource Metadata + */ +export declare const OAuthProtectedResourceMetadataSchema: z.ZodObject<{ + resource: z.ZodString; + authorization_servers: z.ZodOptional>; + jwks_uri: z.ZodOptional; + scopes_supported: z.ZodOptional>; + bearer_methods_supported: z.ZodOptional>; + resource_signing_alg_values_supported: z.ZodOptional>; + resource_name: z.ZodOptional; + resource_documentation: z.ZodOptional; + resource_policy_uri: z.ZodOptional; + resource_tos_uri: z.ZodOptional; + tls_client_certificate_bound_access_tokens: z.ZodOptional; + authorization_details_types_supported: z.ZodOptional>; + dpop_signing_alg_values_supported: z.ZodOptional>; + dpop_bound_access_tokens_required: z.ZodOptional; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + resource: z.ZodString; + authorization_servers: z.ZodOptional>; + jwks_uri: z.ZodOptional; + scopes_supported: z.ZodOptional>; + bearer_methods_supported: z.ZodOptional>; + resource_signing_alg_values_supported: z.ZodOptional>; + resource_name: z.ZodOptional; + resource_documentation: z.ZodOptional; + resource_policy_uri: z.ZodOptional; + resource_tos_uri: z.ZodOptional; + tls_client_certificate_bound_access_tokens: z.ZodOptional; + authorization_details_types_supported: z.ZodOptional>; + dpop_signing_alg_values_supported: z.ZodOptional>; + dpop_bound_access_tokens_required: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + resource: z.ZodString; + authorization_servers: z.ZodOptional>; + jwks_uri: z.ZodOptional; + scopes_supported: z.ZodOptional>; + bearer_methods_supported: z.ZodOptional>; + resource_signing_alg_values_supported: z.ZodOptional>; + resource_name: z.ZodOptional; + resource_documentation: z.ZodOptional; + resource_policy_uri: z.ZodOptional; + resource_tos_uri: z.ZodOptional; + tls_client_certificate_bound_access_tokens: z.ZodOptional; + authorization_details_types_supported: z.ZodOptional>; + dpop_signing_alg_values_supported: z.ZodOptional>; + dpop_bound_access_tokens_required: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">>; +/** + * RFC 8414 OAuth 2.0 Authorization Server Metadata + */ +export declare const OAuthMetadataSchema: z.ZodObject<{ + issuer: z.ZodString; + authorization_endpoint: z.ZodString; + token_endpoint: z.ZodString; + registration_endpoint: z.ZodOptional; + scopes_supported: z.ZodOptional>; + response_types_supported: z.ZodArray; + response_modes_supported: z.ZodOptional>; + grant_types_supported: z.ZodOptional>; + token_endpoint_auth_methods_supported: z.ZodOptional>; + token_endpoint_auth_signing_alg_values_supported: z.ZodOptional>; + service_documentation: z.ZodOptional; + revocation_endpoint: z.ZodOptional; + revocation_endpoint_auth_methods_supported: z.ZodOptional>; + revocation_endpoint_auth_signing_alg_values_supported: z.ZodOptional>; + introspection_endpoint: z.ZodOptional; + introspection_endpoint_auth_methods_supported: z.ZodOptional>; + introspection_endpoint_auth_signing_alg_values_supported: z.ZodOptional>; + code_challenge_methods_supported: z.ZodOptional>; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + issuer: z.ZodString; + authorization_endpoint: z.ZodString; + token_endpoint: z.ZodString; + registration_endpoint: z.ZodOptional; + scopes_supported: z.ZodOptional>; + response_types_supported: z.ZodArray; + response_modes_supported: z.ZodOptional>; + grant_types_supported: z.ZodOptional>; + token_endpoint_auth_methods_supported: z.ZodOptional>; + token_endpoint_auth_signing_alg_values_supported: z.ZodOptional>; + service_documentation: z.ZodOptional; + revocation_endpoint: z.ZodOptional; + revocation_endpoint_auth_methods_supported: z.ZodOptional>; + revocation_endpoint_auth_signing_alg_values_supported: z.ZodOptional>; + introspection_endpoint: z.ZodOptional; + introspection_endpoint_auth_methods_supported: z.ZodOptional>; + introspection_endpoint_auth_signing_alg_values_supported: z.ZodOptional>; + code_challenge_methods_supported: z.ZodOptional>; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + issuer: z.ZodString; + authorization_endpoint: z.ZodString; + token_endpoint: z.ZodString; + registration_endpoint: z.ZodOptional; + scopes_supported: z.ZodOptional>; + response_types_supported: z.ZodArray; + response_modes_supported: z.ZodOptional>; + grant_types_supported: z.ZodOptional>; + token_endpoint_auth_methods_supported: z.ZodOptional>; + token_endpoint_auth_signing_alg_values_supported: z.ZodOptional>; + service_documentation: z.ZodOptional; + revocation_endpoint: z.ZodOptional; + revocation_endpoint_auth_methods_supported: z.ZodOptional>; + revocation_endpoint_auth_signing_alg_values_supported: z.ZodOptional>; + introspection_endpoint: z.ZodOptional; + introspection_endpoint_auth_methods_supported: z.ZodOptional>; + introspection_endpoint_auth_signing_alg_values_supported: z.ZodOptional>; + code_challenge_methods_supported: z.ZodOptional>; +}, z.ZodTypeAny, "passthrough">>; +/** + * OAuth 2.1 token response + */ +export declare const OAuthTokensSchema: z.ZodObject<{ + access_token: z.ZodString; + token_type: z.ZodString; + expires_in: z.ZodOptional; + scope: z.ZodOptional; + refresh_token: z.ZodOptional; +}, "strip", z.ZodTypeAny, { + access_token: string; + token_type: string; + expires_in?: number | undefined; + scope?: string | undefined; + refresh_token?: string | undefined; +}, { + access_token: string; + token_type: string; + expires_in?: number | undefined; + scope?: string | undefined; + refresh_token?: string | undefined; +}>; +/** + * OAuth 2.1 error response + */ +export declare const OAuthErrorResponseSchema: z.ZodObject<{ + error: z.ZodString; + error_description: z.ZodOptional; + error_uri: z.ZodOptional; +}, "strip", z.ZodTypeAny, { + error: string; + error_description?: string | undefined; + error_uri?: string | undefined; +}, { + error: string; + error_description?: string | undefined; + error_uri?: string | undefined; +}>; +/** + * RFC 7591 OAuth 2.0 Dynamic Client Registration metadata + */ +export declare const OAuthClientMetadataSchema: z.ZodObject<{ + redirect_uris: z.ZodEffects, string[], string[]>; + token_endpoint_auth_method: z.ZodOptional; + grant_types: z.ZodOptional>; + response_types: z.ZodOptional>; + client_name: z.ZodOptional; + client_uri: z.ZodOptional; + logo_uri: z.ZodOptional; + scope: z.ZodOptional; + contacts: z.ZodOptional>; + tos_uri: z.ZodOptional; + policy_uri: z.ZodOptional; + jwks_uri: z.ZodOptional; + jwks: z.ZodOptional; + software_id: z.ZodOptional; + software_version: z.ZodOptional; +}, "strip", z.ZodTypeAny, { + redirect_uris: string[]; + jwks_uri?: string | undefined; + scope?: string | undefined; + token_endpoint_auth_method?: string | undefined; + grant_types?: string[] | undefined; + response_types?: string[] | undefined; + client_name?: string | undefined; + client_uri?: string | undefined; + logo_uri?: string | undefined; + contacts?: string[] | undefined; + tos_uri?: string | undefined; + policy_uri?: string | undefined; + jwks?: any; + software_id?: string | undefined; + software_version?: string | undefined; +}, { + redirect_uris: string[]; + jwks_uri?: string | undefined; + scope?: string | undefined; + token_endpoint_auth_method?: string | undefined; + grant_types?: string[] | undefined; + response_types?: string[] | undefined; + client_name?: string | undefined; + client_uri?: string | undefined; + logo_uri?: string | undefined; + contacts?: string[] | undefined; + tos_uri?: string | undefined; + policy_uri?: string | undefined; + jwks?: any; + software_id?: string | undefined; + software_version?: string | undefined; +}>; +/** + * RFC 7591 OAuth 2.0 Dynamic Client Registration client information + */ +export declare const OAuthClientInformationSchema: z.ZodObject<{ + client_id: z.ZodString; + client_secret: z.ZodOptional; + client_id_issued_at: z.ZodOptional; + client_secret_expires_at: z.ZodOptional; +}, "strip", z.ZodTypeAny, { + client_id: string; + client_secret?: string | undefined; + client_id_issued_at?: number | undefined; + client_secret_expires_at?: number | undefined; +}, { + client_id: string; + client_secret?: string | undefined; + client_id_issued_at?: number | undefined; + client_secret_expires_at?: number | undefined; +}>; +/** + * RFC 7591 OAuth 2.0 Dynamic Client Registration full response (client information plus metadata) + */ +export declare const OAuthClientInformationFullSchema: z.ZodObject, string[], string[]>; + token_endpoint_auth_method: z.ZodOptional; + grant_types: z.ZodOptional>; + response_types: z.ZodOptional>; + client_name: z.ZodOptional; + client_uri: z.ZodOptional; + logo_uri: z.ZodOptional; + scope: z.ZodOptional; + contacts: z.ZodOptional>; + tos_uri: z.ZodOptional; + policy_uri: z.ZodOptional; + jwks_uri: z.ZodOptional; + jwks: z.ZodOptional; + software_id: z.ZodOptional; + software_version: z.ZodOptional; +}, { + client_id: z.ZodString; + client_secret: z.ZodOptional; + client_id_issued_at: z.ZodOptional; + client_secret_expires_at: z.ZodOptional; +}>, "strip", z.ZodTypeAny, { + redirect_uris: string[]; + client_id: string; + jwks_uri?: string | undefined; + scope?: string | undefined; + token_endpoint_auth_method?: string | undefined; + grant_types?: string[] | undefined; + response_types?: string[] | undefined; + client_name?: string | undefined; + client_uri?: string | undefined; + logo_uri?: string | undefined; + contacts?: string[] | undefined; + tos_uri?: string | undefined; + policy_uri?: string | undefined; + jwks?: any; + software_id?: string | undefined; + software_version?: string | undefined; + client_secret?: string | undefined; + client_id_issued_at?: number | undefined; + client_secret_expires_at?: number | undefined; +}, { + redirect_uris: string[]; + client_id: string; + jwks_uri?: string | undefined; + scope?: string | undefined; + token_endpoint_auth_method?: string | undefined; + grant_types?: string[] | undefined; + response_types?: string[] | undefined; + client_name?: string | undefined; + client_uri?: string | undefined; + logo_uri?: string | undefined; + contacts?: string[] | undefined; + tos_uri?: string | undefined; + policy_uri?: string | undefined; + jwks?: any; + software_id?: string | undefined; + software_version?: string | undefined; + client_secret?: string | undefined; + client_id_issued_at?: number | undefined; + client_secret_expires_at?: number | undefined; +}>; +/** + * RFC 7591 OAuth 2.0 Dynamic Client Registration error response + */ +export declare const OAuthClientRegistrationErrorSchema: z.ZodObject<{ + error: z.ZodString; + error_description: z.ZodOptional; +}, "strip", z.ZodTypeAny, { + error: string; + error_description?: string | undefined; +}, { + error: string; + error_description?: string | undefined; +}>; +/** + * RFC 7009 OAuth 2.0 Token Revocation request + */ +export declare const OAuthTokenRevocationRequestSchema: z.ZodObject<{ + token: z.ZodString; + token_type_hint: z.ZodOptional; +}, "strip", z.ZodTypeAny, { + token: string; + token_type_hint?: string | undefined; +}, { + token: string; + token_type_hint?: string | undefined; +}>; +export type OAuthMetadata = z.infer; +export type OAuthTokens = z.infer; +export type OAuthErrorResponse = z.infer; +export type OAuthClientMetadata = z.infer; +export type OAuthClientInformation = z.infer; +export type OAuthClientInformationFull = z.infer; +export type OAuthClientRegistrationError = z.infer; +export type OAuthTokenRevocationRequest = z.infer; +export type OAuthProtectedResourceMetadata = z.infer; +//# sourceMappingURL=auth.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/auth.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/auth.d.ts.map new file mode 100644 index 0000000000..3cfebb032a --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/auth.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/shared/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAiBjC,CAAC;AAEjB;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCA6BhB,CAAC;AAEjB;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;EAQpB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;EAKjC,CAAC;AAEL;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgB5B,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;EAK/B,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAgE,CAAC;AAE9G;;GAEG;AACH,eAAO,MAAM,kCAAkC;;;;;;;;;EAGrC,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,iCAAiC;;;;;;;;;EAGpC,CAAC;AAGX,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAClF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAC1F,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAC9F,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAC5F,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/auth.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/auth.js new file mode 100644 index 0000000000..b2a8fdc2e3 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/auth.js @@ -0,0 +1,124 @@ +import { z } from "zod"; +/** + * RFC 9728 OAuth Protected Resource Metadata + */ +export const OAuthProtectedResourceMetadataSchema = z + .object({ + resource: z.string().url(), + authorization_servers: z.array(z.string().url()).optional(), + jwks_uri: z.string().url().optional(), + scopes_supported: z.array(z.string()).optional(), + bearer_methods_supported: z.array(z.string()).optional(), + resource_signing_alg_values_supported: z.array(z.string()).optional(), + resource_name: z.string().optional(), + resource_documentation: z.string().optional(), + resource_policy_uri: z.string().url().optional(), + resource_tos_uri: z.string().url().optional(), + tls_client_certificate_bound_access_tokens: z.boolean().optional(), + authorization_details_types_supported: z.array(z.string()).optional(), + dpop_signing_alg_values_supported: z.array(z.string()).optional(), + dpop_bound_access_tokens_required: z.boolean().optional(), +}) + .passthrough(); +/** + * RFC 8414 OAuth 2.0 Authorization Server Metadata + */ +export const OAuthMetadataSchema = z + .object({ + issuer: z.string(), + authorization_endpoint: z.string(), + token_endpoint: z.string(), + registration_endpoint: z.string().optional(), + scopes_supported: z.array(z.string()).optional(), + response_types_supported: z.array(z.string()), + response_modes_supported: z.array(z.string()).optional(), + grant_types_supported: z.array(z.string()).optional(), + token_endpoint_auth_methods_supported: z.array(z.string()).optional(), + token_endpoint_auth_signing_alg_values_supported: z + .array(z.string()) + .optional(), + service_documentation: z.string().optional(), + revocation_endpoint: z.string().optional(), + revocation_endpoint_auth_methods_supported: z.array(z.string()).optional(), + revocation_endpoint_auth_signing_alg_values_supported: z + .array(z.string()) + .optional(), + introspection_endpoint: z.string().optional(), + introspection_endpoint_auth_methods_supported: z + .array(z.string()) + .optional(), + introspection_endpoint_auth_signing_alg_values_supported: z + .array(z.string()) + .optional(), + code_challenge_methods_supported: z.array(z.string()).optional(), +}) + .passthrough(); +/** + * OAuth 2.1 token response + */ +export const OAuthTokensSchema = z + .object({ + access_token: z.string(), + token_type: z.string(), + expires_in: z.number().optional(), + scope: z.string().optional(), + refresh_token: z.string().optional(), +}) + .strip(); +/** + * OAuth 2.1 error response + */ +export const OAuthErrorResponseSchema = z + .object({ + error: z.string(), + error_description: z.string().optional(), + error_uri: z.string().optional(), +}); +/** + * RFC 7591 OAuth 2.0 Dynamic Client Registration metadata + */ +export const OAuthClientMetadataSchema = z.object({ + redirect_uris: z.array(z.string()).refine((uris) => uris.every((uri) => URL.canParse(uri)), { message: "redirect_uris must contain valid URLs" }), + token_endpoint_auth_method: z.string().optional(), + grant_types: z.array(z.string()).optional(), + response_types: z.array(z.string()).optional(), + client_name: z.string().optional(), + client_uri: z.string().optional(), + logo_uri: z.string().optional(), + scope: z.string().optional(), + contacts: z.array(z.string()).optional(), + tos_uri: z.string().optional(), + policy_uri: z.string().optional(), + jwks_uri: z.string().optional(), + jwks: z.any().optional(), + software_id: z.string().optional(), + software_version: z.string().optional(), +}).strip(); +/** + * RFC 7591 OAuth 2.0 Dynamic Client Registration client information + */ +export const OAuthClientInformationSchema = z.object({ + client_id: z.string(), + client_secret: z.string().optional(), + client_id_issued_at: z.number().optional(), + client_secret_expires_at: z.number().optional(), +}).strip(); +/** + * RFC 7591 OAuth 2.0 Dynamic Client Registration full response (client information plus metadata) + */ +export const OAuthClientInformationFullSchema = OAuthClientMetadataSchema.merge(OAuthClientInformationSchema); +/** + * RFC 7591 OAuth 2.0 Dynamic Client Registration error response + */ +export const OAuthClientRegistrationErrorSchema = z.object({ + error: z.string(), + error_description: z.string().optional(), +}).strip(); +/** + * RFC 7009 OAuth 2.0 Token Revocation request + */ +export const OAuthTokenRevocationRequestSchema = z.object({ + token: z.string(), + token_type_hint: z.string().optional(), +}).strip(); +//# sourceMappingURL=auth.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/auth.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/auth.js.map new file mode 100644 index 0000000000..00e16c094f --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/auth.js.map @@ -0,0 +1 @@ +{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/shared/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC;KAClD,MAAM,CAAC;IACN,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IAC1B,qBAAqB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC3D,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACrC,gBAAgB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;I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AAQ,EAAE;CACzC,CAAC,CAAC,KAAK,EAAE,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,CAAC;IACxD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACvC,CAAC,CAAC,KAAK,EAAE,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/protocol.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/protocol.d.ts new file mode 100644 index 0000000000..7fadb219a6 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/protocol.d.ts @@ -0,0 +1,217 @@ +import { ZodLiteral, ZodObject, ZodType, z } from "zod"; +import { ClientCapabilities, Notification, Progress, Request, RequestId, Result, ServerCapabilities, RequestMeta } from "../types.js"; +import { Transport, TransportSendOptions } from "./transport.js"; +import { AuthInfo } from "../server/auth/types.js"; +/** + * Callback for progress notifications. + */ +export type ProgressCallback = (progress: Progress) => void; +/** + * Additional initialization options. + */ +export type ProtocolOptions = { + /** + * Whether to restrict emitted requests to only those that the remote side has indicated that they can handle, through their advertised capabilities. + * + * Note that this DOES NOT affect checking of _local_ side capabilities, as it is considered a logic error to mis-specify those. + * + * Currently this defaults to false, for backwards compatibility with SDK versions that did not advertise capabilities correctly. In future, this will default to true. + */ + enforceStrictCapabilities?: boolean; +}; +/** + * The default request timeout, in miliseconds. + */ +export declare const DEFAULT_REQUEST_TIMEOUT_MSEC = 60000; +/** + * Options that can be given per request. + */ +export type RequestOptions = { + /** + * If set, requests progress notifications from the remote end (if supported). When progress notifications are received, this callback will be invoked. + */ + onprogress?: ProgressCallback; + /** + * Can be used to cancel an in-flight request. This will cause an AbortError to be raised from request(). + */ + signal?: AbortSignal; + /** + * A timeout (in milliseconds) for this request. If exceeded, an McpError with code `RequestTimeout` will be raised from request(). + * + * If not specified, `DEFAULT_REQUEST_TIMEOUT_MSEC` will be used as the timeout. + */ + timeout?: number; + /** + * If true, receiving a progress notification will reset the request timeout. + * This is useful for long-running operations that send periodic progress updates. + * Default: false + */ + resetTimeoutOnProgress?: boolean; + /** + * Maximum total time (in milliseconds) to wait for a response. + * If exceeded, an McpError with code `RequestTimeout` will be raised, regardless of progress notifications. + * If not specified, there is no maximum total timeout. + */ + maxTotalTimeout?: number; +} & TransportSendOptions; +/** + * Options that can be given per notification. + */ +export type NotificationOptions = { + /** + * May be used to indicate to the transport which incoming request to associate this outgoing notification with. + */ + relatedRequestId?: RequestId; +}; +/** + * Extra data given to request handlers. + */ +export type RequestHandlerExtra = { + /** + * An abort signal used to communicate if the request was cancelled from the sender's side. + */ + signal: AbortSignal; + /** + * Information about a validated access token, provided to request handlers. + */ + authInfo?: AuthInfo; + /** + * The session ID from the transport, if available. + */ + sessionId?: string; + /** + * Metadata from the original request. + */ + _meta?: RequestMeta; + /** + * The JSON-RPC ID of the request being handled. + * This can be useful for tracking or logging purposes. + */ + requestId: RequestId; + /** + * Sends a notification that relates to the current request being handled. + * + * This is used by certain transports to correctly associate related messages. + */ + sendNotification: (notification: SendNotificationT) => Promise; + /** + * Sends a request that relates to the current request being handled. + * + * This is used by certain transports to correctly associate related messages. + */ + sendRequest: >(request: SendRequestT, resultSchema: U, options?: RequestOptions) => Promise>; +}; +/** + * Implements MCP protocol framing on top of a pluggable transport, including + * features like request/response linking, notifications, and progress. + */ +export declare abstract class Protocol { + private _options?; + private _transport?; + private _requestMessageId; + private _requestHandlers; + private _requestHandlerAbortControllers; + private _notificationHandlers; + private _responseHandlers; + private _progressHandlers; + private _timeoutInfo; + /** + * Callback for when the connection is closed for any reason. + * + * This is invoked when close() is called as well. + */ + onclose?: () => void; + /** + * Callback for when an error occurs. + * + * Note that errors are not necessarily fatal; they are used for reporting any kind of exceptional condition out of band. + */ + onerror?: (error: Error) => void; + /** + * A handler to invoke for any request types that do not have their own handler installed. + */ + fallbackRequestHandler?: (request: Request) => Promise; + /** + * A handler to invoke for any notification types that do not have their own handler installed. + */ + fallbackNotificationHandler?: (notification: Notification) => Promise; + constructor(_options?: ProtocolOptions | undefined); + private _setupTimeout; + private _resetTimeout; + private _cleanupTimeout; + /** + * Attaches to the given transport, starts it, and starts listening for messages. + * + * The Protocol object assumes ownership of the Transport, replacing any callbacks that have already been set, and expects that it is the only user of the Transport instance going forward. + */ + connect(transport: Transport): Promise; + private _onclose; + private _onerror; + private _onnotification; + private _onrequest; + private _onprogress; + private _onresponse; + get transport(): Transport | undefined; + /** + * Closes the connection. + */ + close(): Promise; + /** + * A method to check if a capability is supported by the remote side, for the given method to be called. + * + * This should be implemented by subclasses. + */ + protected abstract assertCapabilityForMethod(method: SendRequestT["method"]): void; + /** + * A method to check if a notification is supported by the local side, for the given method to be sent. + * + * This should be implemented by subclasses. + */ + protected abstract assertNotificationCapability(method: SendNotificationT["method"]): void; + /** + * A method to check if a request handler is supported by the local side, for the given method to be handled. + * + * This should be implemented by subclasses. + */ + protected abstract assertRequestHandlerCapability(method: string): void; + /** + * Sends a request and wait for a response. + * + * Do not use this method to emit notifications! Use notification() instead. + */ + request>(request: SendRequestT, resultSchema: T, options?: RequestOptions): Promise>; + /** + * Emits a notification, which is a one-way message that does not expect a response. + */ + notification(notification: SendNotificationT, options?: NotificationOptions): Promise; + /** + * Registers a handler to invoke when this protocol object receives a request with the given method. + * + * Note that this will replace any previous request handler for the same method. + */ + setRequestHandler; + }>>(requestSchema: T, handler: (request: z.infer, extra: RequestHandlerExtra) => SendResultT | Promise): void; + /** + * Removes the request handler for the given method. + */ + removeRequestHandler(method: string): void; + /** + * Asserts that a request handler has not already been set for the given method, in preparation for a new one being automatically installed. + */ + assertCanSetRequestHandler(method: string): void; + /** + * Registers a handler to invoke when this protocol object receives a notification with the given method. + * + * Note that this will replace any previous notification handler for the same method. + */ + setNotificationHandler; + }>>(notificationSchema: T, handler: (notification: z.infer) => void | Promise): void; + /** + * Removes the notification handler for the given method. + */ + removeNotificationHandler(method: string): void; +} +export declare function mergeCapabilities(base: T, additional: T): T; +//# sourceMappingURL=protocol.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/protocol.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/protocol.d.ts.map new file mode 100644 index 0000000000..74819ec2ef --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/protocol.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../../src/shared/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxD,OAAO,EAEL,kBAAkB,EAWlB,YAAY,EAEZ,QAAQ,EAGR,OAAO,EACP,SAAS,EACT,MAAM,EACN,kBAAkB,EAClB,WAAW,EACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;AAE5D;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;;;OAMG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,4BAA4B,QAAQ,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAE9B;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAEjC;;;;OAIG;I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/dist/esm/shared/protocol.js new file mode 100644 index 0000000000..85450de585 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/protocol.js @@ -0,0 +1,369 @@ +import { CancelledNotificationSchema, ErrorCode, isJSONRPCError, isJSONRPCRequest, isJSONRPCResponse, isJSONRPCNotification, McpError, PingRequestSchema, ProgressNotificationSchema, } from "../types.js"; +/** + * The default request timeout, in miliseconds. + */ +export const DEFAULT_REQUEST_TIMEOUT_MSEC = 60000; +/** + * Implements MCP protocol framing on top of a pluggable transport, including + * features like request/response linking, notifications, and progress. + */ +export class Protocol { + constructor(_options) { + this._options = _options; + this._requestMessageId = 0; + this._requestHandlers = new Map(); + this._requestHandlerAbortControllers = new Map(); + this._notificationHandlers = new Map(); + this._responseHandlers = new Map(); + this._progressHandlers = new Map(); + this._timeoutInfo = new Map(); + this.setNotificationHandler(CancelledNotificationSchema, (notification) => { + const controller = this._requestHandlerAbortControllers.get(notification.params.requestId); + controller === null || controller === void 0 ? void 0 : controller.abort(notification.params.reason); + }); + this.setNotificationHandler(ProgressNotificationSchema, (notification) => { + this._onprogress(notification); + }); + this.setRequestHandler(PingRequestSchema, + // Automatic pong by default. + (_request) => ({})); + } + _setupTimeout(messageId, timeout, maxTotalTimeout, onTimeout, resetTimeoutOnProgress = false) { + this._timeoutInfo.set(messageId, { + timeoutId: setTimeout(onTimeout, timeout), + startTime: Date.now(), + timeout, + maxTotalTimeout, + resetTimeoutOnProgress, + onTimeout + }); + } + _resetTimeout(messageId) { + const info = this._timeoutInfo.get(messageId); + if (!info) + return false; + const totalElapsed = Date.now() - info.startTime; + if (info.maxTotalTimeout && totalElapsed >= info.maxTotalTimeout) { + this._timeoutInfo.delete(messageId); + throw new McpError(ErrorCode.RequestTimeout, "Maximum total timeout exceeded", { maxTotalTimeout: info.maxTotalTimeout, totalElapsed }); + } + clearTimeout(info.timeoutId); + info.timeoutId = setTimeout(info.onTimeout, info.timeout); + return true; + } + _cleanupTimeout(messageId) { + const info = this._timeoutInfo.get(messageId); + if (info) { + clearTimeout(info.timeoutId); + this._timeoutInfo.delete(messageId); + } + } + /** + * Attaches to the given transport, starts it, and starts listening for messages. + * + * The Protocol object assumes ownership of the Transport, replacing any callbacks that have already been set, and expects that it is the only user of the Transport instance going forward. + */ + async connect(transport) { + this._transport = transport; + this._transport.onclose = () => { + this._onclose(); + }; + this._transport.onerror = (error) => { + this._onerror(error); + }; + this._transport.onmessage = (message, extra) => { + if (isJSONRPCResponse(message) || isJSONRPCError(message)) { + this._onresponse(message); + } + else if (isJSONRPCRequest(message)) { + this._onrequest(message, extra); + } + else if (isJSONRPCNotification(message)) { + this._onnotification(message); + } + else { + this._onerror(new Error(`Unknown message type: ${JSON.stringify(message)}`)); + } + }; + await this._transport.start(); + } + _onclose() { + var _a; + const responseHandlers = this._responseHandlers; + this._responseHandlers = new Map(); + this._progressHandlers.clear(); + this._transport = undefined; + (_a = this.onclose) === null || _a === void 0 ? void 0 : _a.call(this); + const error = new McpError(ErrorCode.ConnectionClosed, "Connection closed"); + for (const handler of responseHandlers.values()) { + handler(error); + } + } + _onerror(error) { + var _a; + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + } + _onnotification(notification) { + var _a; + const handler = (_a = this._notificationHandlers.get(notification.method)) !== null && _a !== void 0 ? _a : this.fallbackNotificationHandler; + // Ignore notifications not being subscribed to. + if (handler === undefined) { + return; + } + // Starting with Promise.resolve() puts any synchronous errors into the monad as well. + Promise.resolve() + .then(() => handler(notification)) + .catch((error) => this._onerror(new Error(`Uncaught error in notification handler: ${error}`))); + } + _onrequest(request, extra) { + var _a, _b, _c, _d; + const handler = (_a = this._requestHandlers.get(request.method)) !== null && _a !== void 0 ? _a : this.fallbackRequestHandler; + if (handler === undefined) { + (_b = this._transport) === null || _b === void 0 ? void 0 : _b.send({ + jsonrpc: "2.0", + id: request.id, + error: { + code: ErrorCode.MethodNotFound, + message: "Method not found", + }, + }).catch((error) => this._onerror(new Error(`Failed to send an error response: ${error}`))); + return; + } + const abortController = new AbortController(); + this._requestHandlerAbortControllers.set(request.id, abortController); + const fullExtra = { + signal: abortController.signal, + sessionId: (_c = this._transport) === null || _c === void 0 ? void 0 : _c.sessionId, + _meta: (_d = request.params) === null || _d === void 0 ? void 0 : _d._meta, + sendNotification: (notification) => this.notification(notification, { relatedRequestId: request.id }), + sendRequest: (r, resultSchema, options) => this.request(r, resultSchema, { ...options, relatedRequestId: request.id }), + authInfo: extra === null || extra === void 0 ? void 0 : extra.authInfo, + requestId: request.id, + }; + // Starting with Promise.resolve() puts any synchronous errors into the monad as well. + Promise.resolve() + .then(() => handler(request, fullExtra)) + .then((result) => { + var _a; + if (abortController.signal.aborted) { + return; + } + return (_a = this._transport) === null || _a === void 0 ? void 0 : _a.send({ + result, + jsonrpc: "2.0", + id: request.id, + }); + }, (error) => { + var _a, _b; + if (abortController.signal.aborted) { + return; + } + return (_a = this._transport) === null || _a === void 0 ? void 0 : _a.send({ + jsonrpc: "2.0", + id: request.id, + error: { + code: Number.isSafeInteger(error["code"]) + ? error["code"] + : ErrorCode.InternalError, + message: (_b = error.message) !== null && _b !== void 0 ? _b : "Internal error", + }, + }); + }) + .catch((error) => this._onerror(new Error(`Failed to send response: ${error}`))) + .finally(() => { + this._requestHandlerAbortControllers.delete(request.id); + }); + } + _onprogress(notification) { + const { progressToken, ...params } = notification.params; + const messageId = Number(progressToken); + const handler = this._progressHandlers.get(messageId); + if (!handler) { + this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(notification)}`)); + return; + } + const responseHandler = this._responseHandlers.get(messageId); + const timeoutInfo = this._timeoutInfo.get(messageId); + if (timeoutInfo && responseHandler && timeoutInfo.resetTimeoutOnProgress) { + try { + this._resetTimeout(messageId); + } + catch (error) { + responseHandler(error); + return; + } + } + handler(params); + } + _onresponse(response) { + const messageId = Number(response.id); + const handler = this._responseHandlers.get(messageId); + if (handler === undefined) { + this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(response)}`)); + return; + } + this._responseHandlers.delete(messageId); + this._progressHandlers.delete(messageId); + this._cleanupTimeout(messageId); + if (isJSONRPCResponse(response)) { + handler(response); + } + else { + const error = new McpError(response.error.code, response.error.message, response.error.data); + handler(error); + } + } + get transport() { + return this._transport; + } + /** + * Closes the connection. + */ + async close() { + var _a; + await ((_a = this._transport) === null || _a === void 0 ? void 0 : _a.close()); + } + /** + * Sends a request and wait for a response. + * + * Do not use this method to emit notifications! Use notification() instead. + */ + request(request, resultSchema, options) { + const { relatedRequestId, resumptionToken, onresumptiontoken } = options !== null && options !== void 0 ? options : {}; + return new Promise((resolve, reject) => { + var _a, _b, _c, _d, _e, _f; + if (!this._transport) { + reject(new Error("Not connected")); + return; + } + if (((_a = this._options) === null || _a === void 0 ? void 0 : _a.enforceStrictCapabilities) === true) { + this.assertCapabilityForMethod(request.method); + } + (_b = options === null || options === void 0 ? void 0 : options.signal) === null || _b === void 0 ? void 0 : _b.throwIfAborted(); + const messageId = this._requestMessageId++; + const jsonrpcRequest = { + ...request, + jsonrpc: "2.0", + id: messageId, + }; + if (options === null || options === void 0 ? void 0 : options.onprogress) { + this._progressHandlers.set(messageId, options.onprogress); + jsonrpcRequest.params = { + ...request.params, + _meta: { + ...(((_c = request.params) === null || _c === void 0 ? void 0 : _c._meta) || {}), + progressToken: messageId + }, + }; + } + const cancel = (reason) => { + var _a; + this._responseHandlers.delete(messageId); + this._progressHandlers.delete(messageId); + this._cleanupTimeout(messageId); + (_a = this._transport) === null || _a === void 0 ? void 0 : _a.send({ + jsonrpc: "2.0", + method: "notifications/cancelled", + params: { + requestId: messageId, + reason: String(reason), + }, + }, { relatedRequestId, resumptionToken, onresumptiontoken }).catch((error) => this._onerror(new Error(`Failed to send cancellation: ${error}`))); + reject(reason); + }; + this._responseHandlers.set(messageId, (response) => { + var _a; + if ((_a = options === null || options === void 0 ? void 0 : options.signal) === null || _a === void 0 ? void 0 : _a.aborted) { + return; + } + if (response instanceof Error) { + return reject(response); + } + try { + const result = resultSchema.parse(response.result); + resolve(result); + } + catch (error) { + reject(error); + } + }); + (_d = options === null || options === void 0 ? void 0 : options.signal) === null || _d === void 0 ? void 0 : _d.addEventListener("abort", () => { + var _a; + cancel((_a = options === null || options === void 0 ? void 0 : options.signal) === null || _a === void 0 ? void 0 : _a.reason); + }); + const timeout = (_e = options === null || options === void 0 ? void 0 : options.timeout) !== null && _e !== void 0 ? _e : DEFAULT_REQUEST_TIMEOUT_MSEC; + const timeoutHandler = () => cancel(new McpError(ErrorCode.RequestTimeout, "Request timed out", { timeout })); + this._setupTimeout(messageId, timeout, options === null || options === void 0 ? void 0 : options.maxTotalTimeout, timeoutHandler, (_f = options === null || options === void 0 ? void 0 : options.resetTimeoutOnProgress) !== null && _f !== void 0 ? _f : false); + this._transport.send(jsonrpcRequest, { relatedRequestId, resumptionToken, onresumptiontoken }).catch((error) => { + this._cleanupTimeout(messageId); + reject(error); + }); + }); + } + /** + * Emits a notification, which is a one-way message that does not expect a response. + */ + async notification(notification, options) { + if (!this._transport) { + throw new Error("Not connected"); + } + this.assertNotificationCapability(notification.method); + const jsonrpcNotification = { + ...notification, + jsonrpc: "2.0", + }; + await this._transport.send(jsonrpcNotification, options); + } + /** + * Registers a handler to invoke when this protocol object receives a request with the given method. + * + * Note that this will replace any previous request handler for the same method. + */ + setRequestHandler(requestSchema, handler) { + const method = requestSchema.shape.method.value; + this.assertRequestHandlerCapability(method); + this._requestHandlers.set(method, (request, extra) => { + return Promise.resolve(handler(requestSchema.parse(request), extra)); + }); + } + /** + * Removes the request handler for the given method. + */ + removeRequestHandler(method) { + this._requestHandlers.delete(method); + } + /** + * Asserts that a request handler has not already been set for the given method, in preparation for a new one being automatically installed. + */ + assertCanSetRequestHandler(method) { + if (this._requestHandlers.has(method)) { + throw new Error(`A request handler for ${method} already exists, which would be overridden`); + } + } + /** + * Registers a handler to invoke when this protocol object receives a notification with the given method. + * + * Note that this will replace any previous notification handler for the same method. + */ + setNotificationHandler(notificationSchema, handler) { + this._notificationHandlers.set(notificationSchema.shape.method.value, (notification) => Promise.resolve(handler(notificationSchema.parse(notification)))); + } + /** + * Removes the notification handler for the given method. + */ + removeNotificationHandler(method) { + this._notificationHandlers.delete(method); + } +} +export function mergeCapabilities(base, additional) { + return Object.entries(additional).reduce((acc, [key, value]) => { + if (value && typeof value === "object") { + acc[key] = acc[key] ? { ...acc[key], ...value } : value; + } + else { + acc[key] = value; + } + return acc; + }, { ...base }); +} +//# sourceMappingURL=protocol.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/protocol.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/protocol.js.map new file mode 100644 index 0000000000..6440bad1d6 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/protocol.js.map @@ -0,0 +1 @@ +{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../../src/shared/protocol.ts"],"names":[],"mappings":"AACA,OAAO,EACL,2BAA2B,EAE3B,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EAKrB,QAAQ,EAER,iBAAiB,EAGjB,0BAA0B,GAM3B,MAAM,aAAa,CAAC;AAuBrB;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,KAAK,CAAC;AA0GlD;;;GAGG;AACH,MAAM,OAAgB,QAAQ;IAmD5B,YAAoB,QAA0B;QAA1B,aAAQ,GAAR,QAAQ,CAAkB;QA7CtC,sBAAiB,GAAG,CAAC,CAAC;QACtB,qBAAgB,GAMpB,IAAI,GAAG,EAAE,CAAC;QACN,oCAA+B,GACrC,IAAI,GAAG,EAAE,CAAC;QACJ,0BAAqB,GAGzB,IAAI,GAAG,EAAE,CAAC;QACN,sBAAiB,GAGrB,IAAI,GAAG,EAAE,CAAC;QACN,sBAAiB,GAAkC,IAAI,GAAG,EAAE,CAAC;QAC7D,iBAAY,GAA6B,IAAI,GAAG,EAAE,CAAC;QA2BzD,IAAI,CAAC,sBAAsB,CAA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K,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;QAC1D,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACnB,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC,EACD,EAAE,GAAG,IAAI,EAAE,CACZ,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/stdio.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/stdio.d.ts new file mode 100644 index 0000000000..c997594734 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/stdio.d.ts @@ -0,0 +1,13 @@ +import { JSONRPCMessage } from "../types.js"; +/** + * Buffers a continuous stdio stream into discrete JSON-RPC messages. + */ +export declare class ReadBuffer { + private _buffer?; + append(chunk: Buffer): void; + readMessage(): JSONRPCMessage | null; + clear(): void; +} +export declare function deserializeMessage(line: string): JSONRPCMessage; +export declare function serializeMessage(message: JSONRPCMessage): string; +//# sourceMappingURL=stdio.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/stdio.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/stdio.d.ts.map new file mode 100644 index 0000000000..e730360d2f --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/stdio.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"stdio.d.ts","sourceRoot":"","sources":["../../../src/shared/stdio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,aAAa,CAAC;AAEnE;;GAEG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,OAAO,CAAC,CAAS;IAEzB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAI3B,WAAW,IAAI,cAAc,GAAG,IAAI;IAepC,KAAK,IAAI,IAAI;CAGd;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAE/D;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,CAEhE"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/stdio.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/stdio.js new file mode 100644 index 0000000000..33cc904a09 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/stdio.js @@ -0,0 +1,31 @@ +import { JSONRPCMessageSchema } from "../types.js"; +/** + * Buffers a continuous stdio stream into discrete JSON-RPC messages. + */ +export class ReadBuffer { + append(chunk) { + this._buffer = this._buffer ? Buffer.concat([this._buffer, chunk]) : chunk; + } + readMessage() { + if (!this._buffer) { + return null; + } + const index = this._buffer.indexOf("\n"); + if (index === -1) { + return null; + } + const line = this._buffer.toString("utf8", 0, index).replace(/\r$/, ''); + this._buffer = this._buffer.subarray(index + 1); + return deserializeMessage(line); + } + clear() { + this._buffer = undefined; + } +} +export function deserializeMessage(line) { + return JSONRPCMessageSchema.parse(JSON.parse(line)); +} +export function serializeMessage(message) { + return JSON.stringify(message) + "\n"; +} +//# sourceMappingURL=stdio.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/stdio.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/stdio.js.map new file mode 100644 index 0000000000..3b01b38e18 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/stdio.js.map @@ -0,0 +1 @@ +{"version":3,"file":"stdio.js","sourceRoot":"","sources":["../../../src/shared/stdio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnE;;GAEG;AACH,MAAM,OAAO,UAAU;IAGrB,MAAM,CAAC,KAAa;QAClB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAC7E,CAAC;IAED,WAAW;QACT,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YAClB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;YACjB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACxE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QAChD,OAAO,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;IAED,KAAK;QACH,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC;IAC3B,CAAC;CACF;AAED,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,OAAO,oBAAoB,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;AACtD,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,OAAuB;IACtD,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;AACxC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/transport.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/transport.d.ts new file mode 100644 index 0000000000..18700b203f --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/transport.d.ts @@ -0,0 +1,72 @@ +import { AuthInfo } from "../server/auth/types.js"; +import { JSONRPCMessage, RequestId } from "../types.js"; +/** + * Options for sending a JSON-RPC message. + */ +export type TransportSendOptions = { + /** + * If present, `relatedRequestId` is used to indicate to the transport which incoming request to associate this outgoing message with. + */ + relatedRequestId?: RequestId; + /** + * The resumption token used to continue long-running requests that were interrupted. + * + * This allows clients to reconnect and continue from where they left off, if supported by the transport. + */ + resumptionToken?: string; + /** + * A callback that is invoked when the resumption token changes, if supported by the transport. + * + * This allows clients to persist the latest token for potential reconnection. + */ + onresumptiontoken?: (token: string) => void; +}; +/** + * Describes the minimal contract for a MCP transport that a client or server can communicate over. + */ +export interface Transport { + /** + * Starts processing messages on the transport, including any connection steps that might need to be taken. + * + * This method should only be called after callbacks are installed, or else messages may be lost. + * + * NOTE: This method should not be called explicitly when using Client, Server, or Protocol classes, as they will implicitly call start(). + */ + start(): Promise; + /** + * Sends a JSON-RPC message (request or response). + * + * If present, `relatedRequestId` is used to indicate to the transport which incoming request to associate this outgoing message with. + */ + send(message: JSONRPCMessage, options?: TransportSendOptions): Promise; + /** + * Closes the connection. + */ + close(): Promise; + /** + * Callback for when the connection is closed for any reason. + * + * This should be invoked when close() is called as well. + */ + onclose?: () => void; + /** + * Callback for when an error occurs. + * + * Note that errors are not necessarily fatal; they are used for reporting any kind of exceptional condition out of band. + */ + onerror?: (error: Error) => void; + /** + * Callback for when a message (request or response) is received over the connection. + * + * Includes the authInfo if the transport is authenticated. + * + */ + onmessage?: (message: JSONRPCMessage, extra?: { + authInfo?: AuthInfo; + }) => void; + /** + * The session ID generated for this connection. + */ + sessionId?: string; +} +//# sourceMappingURL=transport.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/transport.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/transport.d.ts.map new file mode 100644 index 0000000000..e762585c2a --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/transport.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../../src/shared/transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExD;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC;;OAEG;IACH,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAE7B;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7C,CAAA;AACD;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;;;;;OAMG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB;;;;OAIG;IACH,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7E;;OAEG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAEjC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,QAAQ,CAAA;KAAE,KAAK,IAAI,CAAC;IAE/E;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/transport.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/transport.js new file mode 100644 index 0000000000..00d3520ba0 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/transport.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=transport.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/transport.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/transport.js.map new file mode 100644 index 0000000000..b10f2929f2 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/transport.js.map @@ -0,0 +1 @@ +{"version":3,"file":"transport.js","sourceRoot":"","sources":["../../../src/shared/transport.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/uriTemplate.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/uriTemplate.d.ts new file mode 100644 index 0000000000..175e329b66 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/uriTemplate.d.ts @@ -0,0 +1,25 @@ +export type Variables = Record; +export declare class UriTemplate { + /** + * Returns true if the given string contains any URI template expressions. + * A template expression is a sequence of characters enclosed in curly braces, + * like {foo} or {?bar}. + */ + static isTemplate(str: string): boolean; + private static validateLength; + private readonly template; + private readonly parts; + get variableNames(): string[]; + constructor(template: string); + toString(): string; + private parse; + private getOperator; + private getNames; + private encodeValue; + private expandPart; + expand(variables: Variables): string; + private escapeRegExp; + private partToRegExp; + match(uri: string): Variables | null; +} +//# sourceMappingURL=uriTemplate.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/uriTemplate.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/uriTemplate.d.ts.map new file mode 100644 index 0000000000..c2d381fa35 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/uriTemplate.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"uriTemplate.d.ts","sourceRoot":"","sources":["../../../src/shared/uriTemplate.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;AAO1D,qBAAa,WAAW;IACtB;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAMvC,OAAO,CAAC,MAAM,CAAC,cAAc;IAW7B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAGpB;IAEF,IAAI,aAAa,IAAI,MAAM,EAAE,CAE5B;gBAEW,QAAQ,EAAE,MAAM;IAM5B,QAAQ,IAAI,MAAM;IAIlB,OAAO,CAAC,KAAK;IA4Db,OAAO,CAAC,WAAW;IAKnB,OAAO,CAAC,QAAQ;IAShB,OAAO,CAAC,WAAW;IAQnB,OAAO,CAAC,UAAU;IAwDlB,MAAM,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM;IA4BpC,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,YAAY;IAkDpB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI;CA2CrC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/uriTemplate.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/uriTemplate.js new file mode 100644 index 0000000000..f4c2e84459 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/uriTemplate.js @@ -0,0 +1,241 @@ +// Claude-authored implementation of RFC 6570 URI Templates +const MAX_TEMPLATE_LENGTH = 1000000; // 1MB +const MAX_VARIABLE_LENGTH = 1000000; // 1MB +const MAX_TEMPLATE_EXPRESSIONS = 10000; +const MAX_REGEX_LENGTH = 1000000; // 1MB +export class UriTemplate { + /** + * Returns true if the given string contains any URI template expressions. + * A template expression is a sequence of characters enclosed in curly braces, + * like {foo} or {?bar}. + */ + static isTemplate(str) { + // Look for any sequence of characters between curly braces + // that isn't just whitespace + return /\{[^}\s]+\}/.test(str); + } + static validateLength(str, max, context) { + if (str.length > max) { + throw new Error(`${context} exceeds maximum length of ${max} characters (got ${str.length})`); + } + } + get variableNames() { + return this.parts.flatMap((part) => typeof part === 'string' ? [] : part.names); + } + constructor(template) { + UriTemplate.validateLength(template, MAX_TEMPLATE_LENGTH, "Template"); + this.template = template; + this.parts = this.parse(template); + } + toString() { + return this.template; + } + parse(template) { + const parts = []; + let currentText = ""; + let i = 0; + let expressionCount = 0; + while (i < template.length) { + if (template[i] === "{") { + if (currentText) { + parts.push(currentText); + currentText = ""; + } + const end = template.indexOf("}", i); + if (end === -1) + throw new Error("Unclosed template expression"); + expressionCount++; + if (expressionCount > MAX_TEMPLATE_EXPRESSIONS) { + throw new Error(`Template contains too many expressions (max ${MAX_TEMPLATE_EXPRESSIONS})`); + } + const expr = template.slice(i + 1, end); + const operator = this.getOperator(expr); + const exploded = expr.includes("*"); + const names = this.getNames(expr); + const name = names[0]; + // Validate variable name length + for (const name of names) { + UriTemplate.validateLength(name, MAX_VARIABLE_LENGTH, "Variable name"); + } + parts.push({ name, operator, names, exploded }); + i = end + 1; + } + else { + currentText += template[i]; + i++; + } + } + if (currentText) { + parts.push(currentText); + } + return parts; + } + getOperator(expr) { + const operators = ["+", "#", ".", "/", "?", "&"]; + return operators.find((op) => expr.startsWith(op)) || ""; + } + getNames(expr) { + const operator = this.getOperator(expr); + return expr + .slice(operator.length) + .split(",") + .map((name) => name.replace("*", "").trim()) + .filter((name) => name.length > 0); + } + encodeValue(value, operator) { + UriTemplate.validateLength(value, MAX_VARIABLE_LENGTH, "Variable value"); + if (operator === "+" || operator === "#") { + return encodeURI(value); + } + return encodeURIComponent(value); + } + expandPart(part, variables) { + if (part.operator === "?" || part.operator === "&") { + const pairs = part.names + .map((name) => { + const value = variables[name]; + if (value === undefined) + return ""; + const encoded = Array.isArray(value) + ? value.map((v) => this.encodeValue(v, part.operator)).join(",") + : this.encodeValue(value.toString(), part.operator); + return `${name}=${encoded}`; + }) + .filter((pair) => pair.length > 0); + if (pairs.length === 0) + return ""; + const separator = part.operator === "?" ? "?" : "&"; + return separator + pairs.join("&"); + } + if (part.names.length > 1) { + const values = part.names + .map((name) => variables[name]) + .filter((v) => v !== undefined); + if (values.length === 0) + return ""; + return values.map((v) => (Array.isArray(v) ? v[0] : v)).join(","); + } + const value = variables[part.name]; + if (value === undefined) + return ""; + const values = Array.isArray(value) ? value : [value]; + const encoded = values.map((v) => this.encodeValue(v, part.operator)); + switch (part.operator) { + case "": + return encoded.join(","); + case "+": + return encoded.join(","); + case "#": + return "#" + encoded.join(","); + case ".": + return "." + encoded.join("."); + case "/": + return "/" + encoded.join("/"); + default: + return encoded.join(","); + } + } + expand(variables) { + let result = ""; + let hasQueryParam = false; + for (const part of this.parts) { + if (typeof part === "string") { + result += part; + continue; + } + const expanded = this.expandPart(part, variables); + if (!expanded) + continue; + // Convert ? to & if we already have a query parameter + if ((part.operator === "?" || part.operator === "&") && hasQueryParam) { + result += expanded.replace("?", "&"); + } + else { + result += expanded; + } + if (part.operator === "?" || part.operator === "&") { + hasQueryParam = true; + } + } + return result; + } + escapeRegExp(str) { + return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); + } + partToRegExp(part) { + const patterns = []; + // Validate variable name length for matching + for (const name of part.names) { + UriTemplate.validateLength(name, MAX_VARIABLE_LENGTH, "Variable name"); + } + if (part.operator === "?" || part.operator === "&") { + for (let i = 0; i < part.names.length; i++) { + const name = part.names[i]; + const prefix = i === 0 ? "\\" + part.operator : "&"; + patterns.push({ + pattern: prefix + this.escapeRegExp(name) + "=([^&]+)", + name, + }); + } + return patterns; + } + let pattern; + const name = part.name; + switch (part.operator) { + case "": + pattern = part.exploded ? "([^/]+(?:,[^/]+)*)" : "([^/,]+)"; + break; + case "+": + case "#": + pattern = "(.+)"; + break; + case ".": + pattern = "\\.([^/,]+)"; + break; + case "/": + pattern = "/" + (part.exploded ? "([^/]+(?:,[^/]+)*)" : "([^/,]+)"); + break; + default: + pattern = "([^/]+)"; + } + patterns.push({ pattern, name }); + return patterns; + } + match(uri) { + UriTemplate.validateLength(uri, MAX_TEMPLATE_LENGTH, "URI"); + let pattern = "^"; + const names = []; + for (const part of this.parts) { + if (typeof part === "string") { + pattern += this.escapeRegExp(part); + } + else { + const patterns = this.partToRegExp(part); + for (const { pattern: partPattern, name } of patterns) { + pattern += partPattern; + names.push({ name, exploded: part.exploded }); + } + } + } + pattern += "$"; + UriTemplate.validateLength(pattern, MAX_REGEX_LENGTH, "Generated regex pattern"); + const regex = new RegExp(pattern); + const match = uri.match(regex); + if (!match) + return null; + const result = {}; + for (let i = 0; i < names.length; i++) { + const { name, exploded } = names[i]; + const value = match[i + 1]; + const cleanName = name.replace("*", ""); + if (exploded && value.includes(",")) { + result[cleanName] = value.split(","); + } + else { + result[cleanName] = value; + } + } + return result; + } +} +//# sourceMappingURL=uriTemplate.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/uriTemplate.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/uriTemplate.js.map new file mode 100644 index 0000000000..43b063fd96 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/shared/uriTemplate.js.map @@ -0,0 +1 @@ +{"version":3,"file":"uriTemplate.js","sourceRoot":"","sources":["../../../src/shared/uriTemplate.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAI3D,MAAM,mBAAmB,GAAG,OAAO,CAAC,CAAC,MAAM;AAC3C,MAAM,mBAAmB,GAAG,OAAO,CAAC,CAAC,MAAM;AAC3C,MAAM,wBAAwB,GAAG,KAAK,CAAC;AACvC,MAAM,gBAAgB,GAAG,OAAO,CAAC,CAAC,MAAM;AAExC,MAAM,OAAO,WAAW;IACtB;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,GAAW;QAC3B,2DAA2D;QAC3D,6BAA6B;QAC7B,OAAO,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC;IAEO,MAAM,CAAC,cAAc,CAC3B,GAAW,EACX,GAAW,EACX,OAAe;QAEf,IAAI,GAAG,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CACb,GAAG,O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party/mcp-sdk/ajv/dist/esm/types.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/esm/types.d.ts new file mode 100644 index 0000000000..3f5473bb1f --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/types.d.ts @@ -0,0 +1,31751 @@ +import { z, ZodTypeAny } from "zod"; +export declare const LATEST_PROTOCOL_VERSION = "2025-03-26"; +export declare const SUPPORTED_PROTOCOL_VERSIONS: string[]; +export declare const JSONRPC_VERSION = "2.0"; +/** + * A progress token, used to associate progress notifications with the original request. + */ +export declare const ProgressTokenSchema: z.ZodUnion<[z.ZodString, z.ZodNumber]>; +/** + * An opaque token used to represent a cursor for pagination. + */ +export declare const CursorSchema: z.ZodString; +declare const RequestMetaSchema: z.ZodObject<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; +}, z.ZodTypeAny, "passthrough">>; +export declare const RequestSchema: z.ZodObject<{ + method: z.ZodString; + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, "strip", z.ZodTypeAny, { + method: string; + params?: z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: string; + params?: z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +export declare const NotificationSchema: z.ZodObject<{ + method: z.ZodString; + params: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, "strip", z.ZodTypeAny, { + method: string; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: string; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +export declare const ResultSchema: z.ZodObject<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, z.ZodTypeAny, "passthrough">>; +/** + * A uniquely identifying ID for a request in JSON-RPC. + */ +export declare const RequestIdSchema: z.ZodUnion<[z.ZodString, z.ZodNumber]>; +/** + * A request that expects a response. + */ +export declare const JSONRPCRequestSchema: z.ZodObject; + id: z.ZodUnion<[z.ZodString, z.ZodNumber]>; +}, { + method: z.ZodString; + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}>, "strict", z.ZodTypeAny, { + method: string; + jsonrpc: "2.0"; + id: string | number; + params?: z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: string; + jsonrpc: "2.0"; + id: string | number; + params?: z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +export declare const isJSONRPCRequest: (value: unknown) => value is JSONRPCRequest; +/** + * A notification which does not expect a response. + */ +export declare const JSONRPCNotificationSchema: z.ZodObject; +}, { + method: z.ZodString; + params: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}>, "strict", z.ZodTypeAny, { + method: string; + jsonrpc: "2.0"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: string; + jsonrpc: "2.0"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +export declare const isJSONRPCNotification: (value: unknown) => value is JSONRPCNotification; +/** + * A successful (non-error) response to a request. + */ +export declare const JSONRPCResponseSchema: z.ZodObject<{ + jsonrpc: z.ZodLiteral<"2.0">; + id: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + result: z.ZodObject<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; +}, "strict", z.ZodTypeAny, { + jsonrpc: "2.0"; + id: string | number; + result: { + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; +}, { + jsonrpc: "2.0"; + id: string | number; + result: { + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; +}>; +export declare const isJSONRPCResponse: (value: unknown) => value is JSONRPCResponse; +/** + * Error codes defined by the JSON-RPC specification. + */ +export declare enum ErrorCode { + ConnectionClosed = -32000, + RequestTimeout = -32001, + ParseError = -32700, + InvalidRequest = -32600, + MethodNotFound = -32601, + InvalidParams = -32602, + InternalError = -32603 +} +/** + * A response to a request that indicates an error occurred. + */ +export declare const JSONRPCErrorSchema: z.ZodObject<{ + jsonrpc: z.ZodLiteral<"2.0">; + id: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + error: z.ZodObject<{ + /** + * The error type that occurred. + */ + code: z.ZodNumber; + /** + * A short description of the error. The message SHOULD be limited to a concise single sentence. + */ + message: z.ZodString; + /** + * Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.). + */ + data: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + code: number; + message: string; + data?: unknown; + }, { + code: number; + message: string; + data?: unknown; + }>; +}, "strict", z.ZodTypeAny, { + jsonrpc: "2.0"; + id: string | number; + error: { + code: number; + message: string; + data?: unknown; + }; +}, { + jsonrpc: "2.0"; + id: string | number; + error: { + code: number; + message: string; + data?: unknown; + }; +}>; +export declare const isJSONRPCError: (value: unknown) => value is JSONRPCError; +export declare const JSONRPCMessageSchema: z.ZodUnion<[z.ZodObject; + id: z.ZodUnion<[z.ZodString, z.ZodNumber]>; +}, { + method: z.ZodString; + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}>, "strict", z.ZodTypeAny, { + method: string; + jsonrpc: "2.0"; + id: string | number; + params?: z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: string; + jsonrpc: "2.0"; + id: string | number; + params?: z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject; +}, { + method: z.ZodString; + params: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}>, "strict", z.ZodTypeAny, { + method: string; + jsonrpc: "2.0"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: string; + jsonrpc: "2.0"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject<{ + jsonrpc: z.ZodLiteral<"2.0">; + id: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + result: z.ZodObject<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; +}, "strict", z.ZodTypeAny, { + jsonrpc: "2.0"; + id: string | number; + result: { + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; +}, { + jsonrpc: "2.0"; + id: string | number; + result: { + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; +}>, z.ZodObject<{ + jsonrpc: z.ZodLiteral<"2.0">; + id: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + error: z.ZodObject<{ + /** + * The error type that occurred. + */ + code: z.ZodNumber; + /** + * A short description of the error. The message SHOULD be limited to a concise single sentence. + */ + message: z.ZodString; + /** + * Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.). + */ + data: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + code: number; + message: string; + data?: unknown; + }, { + code: number; + message: string; + data?: unknown; + }>; +}, "strict", z.ZodTypeAny, { + jsonrpc: "2.0"; + id: string | number; + error: { + code: number; + message: string; + data?: unknown; + }; +}, { + jsonrpc: "2.0"; + id: string | number; + error: { + code: number; + message: string; + data?: unknown; + }; +}>]>; +/** + * A response that indicates success but carries no data. + */ +export declare const EmptyResultSchema: z.ZodObject<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, "strict", z.ZodTypeAny, { + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; +}, { + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * This notification can be sent by either side to indicate that it is cancelling a previously-issued request. + * + * The request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished. + * + * This notification indicates that the result will be unused, so any associated processing SHOULD cease. + * + * A client MUST NOT attempt to cancel its `initialize` request. + */ +export declare const CancelledNotificationSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/cancelled">; + params: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The ID of the request to cancel. + * + * This MUST correspond to the ID of a request previously issued in the same direction. + */ + requestId: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + /** + * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. + */ + reason: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The ID of the request to cancel. + * + * This MUST correspond to the ID of a request previously issued in the same direction. + */ + requestId: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + /** + * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. + */ + reason: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The ID of the request to cancel. + * + * This MUST correspond to the ID of a request previously issued in the same direction. + */ + requestId: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + /** + * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. + */ + reason: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + requestId: string | number; + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + reason?: string | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/cancelled"; +}, { + params: { + requestId: string | number; + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + reason?: string | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/cancelled"; +}>; +/** + * Describes the name and version of an MCP implementation. + */ +export declare const ImplementationSchema: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; +}, z.ZodTypeAny, "passthrough">>; +/** + * Capabilities a client may support. Known capabilities are defined here, in this schema, but this is not a closed set: any client can define its own, additional capabilities. + */ +export declare const ClientCapabilitiesSchema: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; +}, z.ZodTypeAny, "passthrough">>; +/** + * This request is sent from the client to the server when it first connects, asking it to begin initialization. + */ +export declare const InitializeRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"initialize">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + clientInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + clientInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + clientInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + protocolVersion: string; + capabilities: { + experimental?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + sampling?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + roots?: z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + clientInfo: { + name: string; + version: string; + } & { + [k: string]: unknown; + }; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "initialize"; +}, { + params: { + protocolVersion: string; + capabilities: { + experimental?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + sampling?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + roots?: z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + clientInfo: { + name: string; + version: string; + } & { + [k: string]: unknown; + }; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "initialize"; +}>; +export declare const isInitializeRequest: (value: unknown) => value is InitializeRequest; +/** + * Capabilities that a server may support. Known capabilities are defined here, in this schema, but this is not a closed set: any server can define its own, additional capabilities. + */ +export declare const ServerCapabilitiesSchema: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; +}, z.ZodTypeAny, "passthrough">>; +/** + * After receiving an initialize request from the client, the server sends this response. + */ +export declare const InitializeResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + serverInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + /** + * Instructions describing how to use the server and its features. + * + * This can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a "hint" to the model. For example, this information MAY be added to the system prompt. + */ + instructions: z.ZodOptional; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + serverInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + /** + * Instructions describing how to use the server and its features. + * + * This can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a "hint" to the model. For example, this information MAY be added to the system prompt. + */ + instructions: z.ZodOptional; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + serverInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + /** + * Instructions describing how to use the server and its features. + * + * This can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a "hint" to the model. For example, this information MAY be added to the system prompt. + */ + instructions: z.ZodOptional; +}>, z.ZodTypeAny, "passthrough">>; +/** + * This notification is sent from the client to the server after initialization has finished. + */ +export declare const InitializedNotificationSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/initialized">; +}>, "strip", z.ZodTypeAny, { + method: "notifications/initialized"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "notifications/initialized"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +export declare const isInitializedNotification: (value: unknown) => value is InitializedNotification; +/** + * A ping, issued by either the server or the client, to check that the other party is still alive. The receiver must promptly respond, or else may be disconnected. + */ +export declare const PingRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"ping">; +}>, "strip", z.ZodTypeAny, { + method: "ping"; + params?: z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "ping"; + params?: z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +export declare const ProgressSchema: z.ZodObject<{ + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + /** + * An optional message describing the current progress. + */ + message: z.ZodOptional; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + /** + * An optional message describing the current progress. + */ + message: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + /** + * An optional message describing the current progress. + */ + message: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">>; +/** + * An out-of-band notification used to inform the receiver of a progress update for a long-running request. + */ +export declare const ProgressNotificationSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/progress">; + params: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + /** + * An optional message describing the current progress. + */ + message: z.ZodOptional; + }>, { + /** + * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. + */ + progressToken: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + /** + * An optional message describing the current progress. + */ + message: z.ZodOptional; + }>, { + /** + * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. + */ + progressToken: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + /** + * An optional message describing the current progress. + */ + message: z.ZodOptional; + }>, { + /** + * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. + */ + progressToken: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + progressToken: string | number; + progress: number; + message?: string | undefined; + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + total?: number | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/progress"; +}, { + params: { + progressToken: string | number; + progress: number; + message?: string | undefined; + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + total?: number | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/progress"; +}>; +export declare const PaginatedRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>>; +}>, "strip", z.ZodTypeAny, { + method: string; + params?: z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: string; + params?: z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}>; +export declare const PaginatedResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, z.ZodTypeAny, "passthrough">>; +/** + * The contents of a specific resource or sub-resource. + */ +export declare const ResourceContentsSchema: z.ZodObject<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">>; +export declare const TextResourceContentsSchema: z.ZodObject; +}, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType; +}, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType; +}, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; +}>, z.ZodTypeAny, "passthrough">>; +export declare const BlobResourceContentsSchema: z.ZodObject; +}, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType; +}, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType; +}, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; +}>, z.ZodTypeAny, "passthrough">>; +/** + * A known resource that the server is capable of reading. + */ +export declare const ResourceSchema: z.ZodObject<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">>; +/** + * A template description for resources available on the server. + */ +export declare const ResourceTemplateSchema: z.ZodObject<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">>; +/** + * Sent from the client to request a list of resources the server has. + */ +export declare const ListResourcesRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>>; +}>, { + method: z.ZodLiteral<"resources/list">; +}>, "strip", z.ZodTypeAny, { + method: "resources/list"; + params?: z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "resources/list"; + params?: z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * The server's response to a resources/list request from the client. + */ +export declare const ListResourcesResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resources: z.ZodArray; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resources: z.ZodArray; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resources: z.ZodArray; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>; +/** + * Sent from the client to request a list of resource templates the server has. + */ +export declare const ListResourceTemplatesRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>>; +}>, { + method: z.ZodLiteral<"resources/templates/list">; +}>, "strip", z.ZodTypeAny, { + method: "resources/templates/list"; + params?: z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "resources/templates/list"; + params?: z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * The server's response to a resources/templates/list request from the client. + */ +export declare const ListResourceTemplatesResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resourceTemplates: z.ZodArray; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resourceTemplates: z.ZodArray; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resourceTemplates: z.ZodArray; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>; +/** + * Sent from the client to the server, to read a specific resource URI. + */ +export declare const ReadResourceRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"resources/read">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + uri: string; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/read"; +}, { + params: { + uri: string; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/read"; +}>; +/** + * The server's response to a resources/read request from the client. + */ +export declare const ReadResourceResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + contents: z.ZodArray; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + contents: z.ZodArray; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + contents: z.ZodArray; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>, "many">; +}>, z.ZodTypeAny, "passthrough">>; +/** + * An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This may be issued by servers without any previous subscription from the client. + */ +export declare const ResourceListChangedNotificationSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/resources/list_changed">; +}>, "strip", z.ZodTypeAny, { + method: "notifications/resources/list_changed"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "notifications/resources/list_changed"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * Sent from the client to request resources/updated notifications from the server whenever a particular resource changes. + */ +export declare const SubscribeRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"resources/subscribe">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + uri: string; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/subscribe"; +}, { + params: { + uri: string; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/subscribe"; +}>; +/** + * Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request. + */ +export declare const UnsubscribeRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"resources/unsubscribe">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to unsubscribe from. + */ + uri: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to unsubscribe from. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to unsubscribe from. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + uri: string; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/unsubscribe"; +}, { + params: { + uri: string; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/unsubscribe"; +}>; +/** + * A notification from the server to the client, informing it that a resource has changed and may need to be read again. This should only be sent if the client previously sent a resources/subscribe request. + */ +export declare const ResourceUpdatedNotificationSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/resources/updated">; + params: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to. + */ + uri: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + uri: string; + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/resources/updated"; +}, { + params: { + uri: string; + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/resources/updated"; +}>; +/** + * Describes an argument that a prompt can accept. + */ +export declare const PromptArgumentSchema: z.ZodObject<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">>; +/** + * A prompt or prompt template that the server offers. + */ +export declare const PromptSchema: z.ZodObject<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; +}, z.ZodTypeAny, "passthrough">>; +/** + * Sent from the client to request a list of prompts and prompt templates the server has. + */ +export declare const ListPromptsRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>>; +}>, { + method: z.ZodLiteral<"prompts/list">; +}>, "strip", z.ZodTypeAny, { + method: "prompts/list"; + params?: z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "prompts/list"; + params?: z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * The server's response to a prompts/list request from the client. + */ +export declare const ListPromptsResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + prompts: z.ZodArray; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + prompts: z.ZodArray; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + prompts: z.ZodArray; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>; +/** + * Used by the client to get a prompt provided by the server. + */ +export declare const GetPromptRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"prompts/get">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * Arguments to use for templating the prompt. + */ + arguments: z.ZodOptional>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * Arguments to use for templating the prompt. + */ + arguments: z.ZodOptional>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * Arguments to use for templating the prompt. + */ + arguments: z.ZodOptional>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + name: string; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + arguments?: Record | undefined; + } & { + [k: string]: unknown; + }; + method: "prompts/get"; +}, { + params: { + name: string; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + arguments?: Record | undefined; + } & { + [k: string]: unknown; + }; + method: "prompts/get"; +}>; +/** + * Text provided to or from an LLM. + */ +export declare const TextContentSchema: z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; +}, z.ZodTypeAny, "passthrough">>; +/** + * An image provided to or from an LLM. + */ +export declare const ImageContentSchema: z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; +}, z.ZodTypeAny, "passthrough">>; +/** + * An Audio provided to or from an LLM. + */ +export declare const AudioContentSchema: z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; +}, z.ZodTypeAny, "passthrough">>; +/** + * The contents of a resource, embedded into a prompt or tool call result. + */ +export declare const EmbeddedResourceSchema: z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; +}, z.ZodTypeAny, "passthrough">>; +/** + * Describes a message returned as part of a prompt. + */ +export declare const PromptMessageSchema: z.ZodObject<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; +}, z.ZodTypeAny, "passthrough">>; +/** + * The server's response to a prompts/get request from the client. + */ +export declare const GetPromptResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An optional description for the prompt. + */ + description: z.ZodOptional; + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An optional description for the prompt. + */ + description: z.ZodOptional; + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An optional description for the prompt. + */ + description: z.ZodOptional; + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>; +/** + * An optional notification from the server to the client, informing it that the list of prompts it offers has changed. This may be issued by servers without any previous subscription from the client. + */ +export declare const PromptListChangedNotificationSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/prompts/list_changed">; +}>, "strip", z.ZodTypeAny, { + method: "notifications/prompts/list_changed"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "notifications/prompts/list_changed"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * Additional properties describing a Tool to clients. + * + * NOTE: all properties in ToolAnnotations are **hints**. + * They are not guaranteed to provide a faithful description of + * tool behavior (including descriptive properties like `title`). + * + * Clients should never make tool use decisions based on ToolAnnotations + * received from untrusted servers. + */ +export declare const ToolAnnotationsSchema: z.ZodObject<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">>; +/** + * Definition for a tool the client can call. + */ +export declare const ToolSchema: z.ZodObject<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; +}, z.ZodTypeAny, "passthrough">>; +/** + * Sent from the client to request a list of tools the server has. + */ +export declare const ListToolsRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>>; +}>, { + method: z.ZodLiteral<"tools/list">; +}>, "strip", z.ZodTypeAny, { + method: "tools/list"; + params?: z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "tools/list"; + params?: z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * The server's response to a tools/list request from the client. + */ +export declare const ListToolsResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + tools: z.ZodArray; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + tools: z.ZodArray; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + tools: z.ZodArray; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>; +/** + * The server's response to a tool call. + */ +export declare const CallToolResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * A list of content objects that represent the result of the tool call. + * + * If the Tool does not define an outputSchema, this field MUST be present in the result. + * For backwards compatibility, this field is always present, but it may be empty. + */ + content: z.ZodDefault; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>, "many">>; + /** + * An object containing structured tool output. + * + * If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema. + */ + structuredContent: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Whether the tool call ended in an error. + * + * If not set, this is assumed to be false (the call was successful). + * + * Any errors that originate from the tool SHOULD be reported inside the result + * object, with `isError` set to true, _not_ as an MCP protocol-level error + * response. Otherwise, the LLM would not be able to see that an error occurred + * and self-correct. + * + * However, any errors in _finding_ the tool, an error indicating that the + * server does not support tool calls, or any other exceptional conditions, + * should be reported as an MCP error response. + */ + isError: z.ZodOptional; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * A list of content objects that represent the result of the tool call. + * + * If the Tool does not define an outputSchema, this field MUST be present in the result. + * For backwards compatibility, this field is always present, but it may be empty. + */ + content: z.ZodDefault; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>, "many">>; + /** + * An object containing structured tool output. + * + * If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema. + */ + structuredContent: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Whether the tool call ended in an error. + * + * If not set, this is assumed to be false (the call was successful). + * + * Any errors that originate from the tool SHOULD be reported inside the result + * object, with `isError` set to true, _not_ as an MCP protocol-level error + * response. Otherwise, the LLM would not be able to see that an error occurred + * and self-correct. + * + * However, any errors in _finding_ the tool, an error indicating that the + * server does not support tool calls, or any other exceptional conditions, + * should be reported as an MCP error response. + */ + isError: z.ZodOptional; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * A list of content objects that represent the result of the tool call. + * + * If the Tool does not define an outputSchema, this field MUST be present in the result. + * For backwards compatibility, this field is always present, but it may be empty. + */ + content: z.ZodDefault; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>, "many">>; + /** + * An object containing structured tool output. + * + * If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema. + */ + structuredContent: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Whether the tool call ended in an error. + * + * If not set, this is assumed to be false (the call was successful). + * + * Any errors that originate from the tool SHOULD be reported inside the result + * object, with `isError` set to true, _not_ as an MCP protocol-level error + * response. Otherwise, the LLM would not be able to see that an error occurred + * and self-correct. + * + * However, any errors in _finding_ the tool, an error indicating that the + * server does not support tool calls, or any other exceptional conditions, + * should be reported as an MCP error response. + */ + isError: z.ZodOptional; +}>, z.ZodTypeAny, "passthrough">>; +/** + * CallToolResultSchema extended with backwards compatibility to protocol version 2024-10-07. + */ +export declare const CompatibilityCallToolResultSchema: z.ZodUnion<[z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * A list of content objects that represent the result of the tool call. + * + * If the Tool does not define an outputSchema, this field MUST be present in the result. + * For backwards compatibility, this field is always present, but it may be empty. + */ + content: z.ZodDefault; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>, "many">>; + /** + * An object containing structured tool output. + * + * If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema. + */ + structuredContent: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Whether the tool call ended in an error. + * + * If not set, this is assumed to be false (the call was successful). + * + * Any errors that originate from the tool SHOULD be reported inside the result + * object, with `isError` set to true, _not_ as an MCP protocol-level error + * response. Otherwise, the LLM would not be able to see that an error occurred + * and self-correct. + * + * However, any errors in _finding_ the tool, an error indicating that the + * server does not support tool calls, or any other exceptional conditions, + * should be reported as an MCP error response. + */ + isError: z.ZodOptional; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * A list of content objects that represent the result of the tool call. + * + * If the Tool does not define an outputSchema, this field MUST be present in the result. + * For backwards compatibility, this field is always present, but it may be empty. + */ + content: z.ZodDefault; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>, "many">>; + /** + * An object containing structured tool output. + * + * If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema. + */ + structuredContent: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Whether the tool call ended in an error. + * + * If not set, this is assumed to be false (the call was successful). + * + * Any errors that originate from the tool SHOULD be reported inside the result + * object, with `isError` set to true, _not_ as an MCP protocol-level error + * response. Otherwise, the LLM would not be able to see that an error occurred + * and self-correct. + * + * However, any errors in _finding_ the tool, an error indicating that the + * server does not support tool calls, or any other exceptional conditions, + * should be reported as an MCP error response. + */ + isError: z.ZodOptional; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * A list of content objects that represent the result of the tool call. + * + * If the Tool does not define an outputSchema, this field MUST be present in the result. + * For backwards compatibility, this field is always present, but it may be empty. + */ + content: z.ZodDefault; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>, "many">>; + /** + * An object containing structured tool output. + * + * If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema. + */ + structuredContent: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Whether the tool call ended in an error. + * + * If not set, this is assumed to be false (the call was successful). + * + * Any errors that originate from the tool SHOULD be reported inside the result + * object, with `isError` set to true, _not_ as an MCP protocol-level error + * response. Otherwise, the LLM would not be able to see that an error occurred + * and self-correct. + * + * However, any errors in _finding_ the tool, an error indicating that the + * server does not support tool calls, or any other exceptional conditions, + * should be reported as an MCP error response. + */ + isError: z.ZodOptional; +}>, z.ZodTypeAny, "passthrough">>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + toolResult: z.ZodUnknown; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + toolResult: z.ZodUnknown; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + toolResult: z.ZodUnknown; +}>, z.ZodTypeAny, "passthrough">>]>; +/** + * Used by the client to invoke a tool provided by the server. + */ +export declare const CallToolRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"tools/call">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + name: z.ZodString; + arguments: z.ZodOptional>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + name: z.ZodString; + arguments: z.ZodOptional>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + name: z.ZodString; + arguments: z.ZodOptional>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + name: string; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + arguments?: Record | undefined; + } & { + [k: string]: unknown; + }; + method: "tools/call"; +}, { + params: { + name: string; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + arguments?: Record | undefined; + } & { + [k: string]: unknown; + }; + method: "tools/call"; +}>; +/** + * An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client. + */ +export declare const ToolListChangedNotificationSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/tools/list_changed">; +}>, "strip", z.ZodTypeAny, { + method: "notifications/tools/list_changed"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "notifications/tools/list_changed"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * The severity of a log message. + */ +export declare const LoggingLevelSchema: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; +/** + * A request from the client to the server, to enable or adjust logging. + */ +export declare const SetLevelRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"logging/setLevel">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + level: "error" | "debug" | "info" | "notice" | "warning" | "critical" | "alert" | "emergency"; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "logging/setLevel"; +}, { + params: { + level: "error" | "debug" | "info" | "notice" | "warning" | "critical" | "alert" | "emergency"; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "logging/setLevel"; +}>; +/** + * Notification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically. + */ +export declare const LoggingMessageNotificationSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/message">; + params: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The severity of this log message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + /** + * An optional name of the logger issuing this message. + */ + logger: z.ZodOptional; + /** + * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here. + */ + data: z.ZodUnknown; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The severity of this log message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + /** + * An optional name of the logger issuing this message. + */ + logger: z.ZodOptional; + /** + * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here. + */ + data: z.ZodUnknown; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The severity of this log message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + /** + * An optional name of the logger issuing this message. + */ + logger: z.ZodOptional; + /** + * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here. + */ + data: z.ZodUnknown; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + level: "error" | "debug" | "info" | "notice" | "warning" | "critical" | "alert" | "emergency"; + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + data?: unknown; + logger?: string | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/message"; +}, { + params: { + level: "error" | "debug" | "info" | "notice" | "warning" | "critical" | "alert" | "emergency"; + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + data?: unknown; + logger?: string | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/message"; +}>; +/** + * Hints to use for model selection. + */ +export declare const ModelHintSchema: z.ZodObject<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">>; +/** + * The server's preferences for model selection, requested of the client during sampling. + */ +export declare const ModelPreferencesSchema: z.ZodObject<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">>; +/** + * Describes a message issued to or received from an LLM API. + */ +export declare const SamplingMessageSchema: z.ZodObject<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; +}, z.ZodTypeAny, "passthrough">>; +/** + * A request from the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it. + */ +export declare const CreateMessageRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"sampling/createMessage">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; + /** + * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt. + */ + systemPrompt: z.ZodOptional; + /** + * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request. + */ + includeContext: z.ZodOptional>; + temperature: z.ZodOptional; + /** + * The maximum number of tokens to sample, as requested by the server. The client MAY choose to sample fewer tokens than requested. + */ + maxTokens: z.ZodNumber; + stopSequences: z.ZodOptional>; + /** + * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific. + */ + metadata: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * The server's preferences for which model to select. + */ + modelPreferences: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; + /** + * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt. + */ + systemPrompt: z.ZodOptional; + /** + * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request. + */ + includeContext: z.ZodOptional>; + temperature: z.ZodOptional; + /** + * The maximum number of tokens to sample, as requested by the server. The client MAY choose to sample fewer tokens than requested. + */ + maxTokens: z.ZodNumber; + stopSequences: z.ZodOptional>; + /** + * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific. + */ + metadata: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * The server's preferences for which model to select. + */ + modelPreferences: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; + /** + * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt. + */ + systemPrompt: z.ZodOptional; + /** + * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request. + */ + includeContext: z.ZodOptional>; + temperature: z.ZodOptional; + /** + * The maximum number of tokens to sample, as requested by the server. The client MAY choose to sample fewer tokens than requested. + */ + maxTokens: z.ZodNumber; + stopSequences: z.ZodOptional>; + /** + * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific. + */ + metadata: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * The server's preferences for which model to select. + */ + modelPreferences: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + messages: z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">[]; + maxTokens: number; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + systemPrompt?: string | undefined; + includeContext?: "none" | "thisServer" | "allServers" | undefined; + temperature?: number | undefined; + stopSequences?: string[] | undefined; + metadata?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + modelPreferences?: z.objectOutputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "sampling/createMessage"; +}, { + params: { + messages: z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">[]; + maxTokens: number; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + systemPrompt?: string | undefined; + includeContext?: "none" | "thisServer" | "allServers" | undefined; + temperature?: number | undefined; + stopSequences?: string[] | undefined; + metadata?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + modelPreferences?: z.objectInputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "sampling/createMessage"; +}>; +/** + * The client's response to a sampling/create_message request from the server. The client should inform the user before returning the sampled message, to allow them to inspect the response (human in the loop) and decide whether to allow the server to see it. + */ +export declare const CreateMessageResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The name of the model that generated the message. + */ + model: z.ZodString; + /** + * The reason why sampling stopped. + */ + stopReason: z.ZodOptional, z.ZodString]>>; + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The name of the model that generated the message. + */ + model: z.ZodString; + /** + * The reason why sampling stopped. + */ + stopReason: z.ZodOptional, z.ZodString]>>; + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The name of the model that generated the message. + */ + model: z.ZodString; + /** + * The reason why sampling stopped. + */ + stopReason: z.ZodOptional, z.ZodString]>>; + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; +}>, z.ZodTypeAny, "passthrough">>; +/** + * A reference to a resource or resource template definition. + */ +export declare const ResourceReferenceSchema: z.ZodObject<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; +}, z.ZodTypeAny, "passthrough">>; +/** + * Identifies a prompt. + */ +export declare const PromptReferenceSchema: z.ZodObject<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; +}, z.ZodTypeAny, "passthrough">>; +/** + * A request from the client to the server, to ask for completion options. + */ +export declare const CompleteRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"completion/complete">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + ref: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + /** + * The argument's information + */ + argument: z.ZodObject<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + ref: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + /** + * The argument's information + */ + argument: z.ZodObject<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + ref: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + /** + * The argument's information + */ + argument: z.ZodObject<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + ref: z.objectOutputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">; + argument: { + value: string; + name: string; + } & { + [k: string]: unknown; + }; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "completion/complete"; +}, { + params: { + ref: z.objectInputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough"> | z.objectInputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">; + argument: { + value: string; + name: string; + } & { + [k: string]: unknown; + }; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "completion/complete"; +}>; +/** + * The server's response to a completion/complete request + */ +export declare const CompleteResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + completion: z.ZodObject<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + completion: z.ZodObject<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + completion: z.ZodObject<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>; +}>, z.ZodTypeAny, "passthrough">>; +/** + * Represents a root directory or file that the server can operate on. + */ +export declare const RootSchema: z.ZodObject<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">>; +/** + * Sent from the server to request a list of root URIs from the client. + */ +export declare const ListRootsRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"roots/list">; +}>, "strip", z.ZodTypeAny, { + method: "roots/list"; + params?: z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "roots/list"; + params?: z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * The client's response to a roots/list request from the server. + */ +export declare const ListRootsResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + roots: z.ZodArray; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + roots: z.ZodArray; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + roots: z.ZodArray; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>; +/** + * A notification from the client to the server, informing it that the list of roots has changed. + */ +export declare const RootsListChangedNotificationSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/roots/list_changed">; +}>, "strip", z.ZodTypeAny, { + method: "notifications/roots/list_changed"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "notifications/roots/list_changed"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +export declare const ClientRequestSchema: z.ZodUnion<[z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"ping">; +}>, "strip", z.ZodTypeAny, { + method: "ping"; + params?: z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "ping"; + params?: z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"initialize">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + clientInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + clientInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + clientInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + protocolVersion: string; + capabilities: { + experimental?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + sampling?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + roots?: z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + clientInfo: { + name: string; + version: string; + } & { + [k: string]: unknown; + }; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "initialize"; +}, { + params: { + protocolVersion: string; + capabilities: { + experimental?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + sampling?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + roots?: z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + clientInfo: { + name: string; + version: string; + } & { + [k: string]: unknown; + }; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "initialize"; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"completion/complete">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + ref: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + /** + * The argument's information + */ + argument: z.ZodObject<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + ref: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + /** + * The argument's information + */ + argument: z.ZodObject<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + ref: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + /** + * The argument's information + */ + argument: z.ZodObject<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + ref: z.objectOutputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">; + argument: { + value: string; + name: string; + } & { + [k: string]: unknown; + }; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "completion/complete"; +}, { + params: { + ref: z.objectInputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough"> | z.objectInputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">; + argument: { + value: string; + name: string; + } & { + [k: string]: unknown; + }; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "completion/complete"; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"logging/setLevel">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + level: "error" | "debug" | "info" | "notice" | "warning" | "critical" | "alert" | "emergency"; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "logging/setLevel"; +}, { + params: { + level: "error" | "debug" | "info" | "notice" | "warning" | "critical" | "alert" | "emergency"; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "logging/setLevel"; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"prompts/get">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * Arguments to use for templating the prompt. + */ + arguments: z.ZodOptional>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * Arguments to use for templating the prompt. + */ + arguments: z.ZodOptional>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * Arguments to use for templating the prompt. + */ + arguments: z.ZodOptional>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + name: string; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + arguments?: Record | undefined; + } & { + [k: string]: unknown; + }; + method: "prompts/get"; +}, { + params: { + name: string; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + arguments?: Record | undefined; + } & { + [k: string]: unknown; + }; + method: "prompts/get"; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>>; +}>, { + method: z.ZodLiteral<"prompts/list">; +}>, "strip", z.ZodTypeAny, { + method: "prompts/list"; + params?: z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "prompts/list"; + params?: z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>>; +}>, { + method: z.ZodLiteral<"resources/list">; +}>, "strip", z.ZodTypeAny, { + method: "resources/list"; + params?: z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "resources/list"; + params?: z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>>; +}>, { + method: z.ZodLiteral<"resources/templates/list">; +}>, "strip", z.ZodTypeAny, { + method: "resources/templates/list"; + params?: z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "resources/templates/list"; + params?: z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"resources/read">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + uri: string; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/read"; +}, { + params: { + uri: string; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/read"; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"resources/subscribe">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + uri: string; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/subscribe"; +}, { + params: { + uri: string; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/subscribe"; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"resources/unsubscribe">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to unsubscribe from. + */ + uri: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to unsubscribe from. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to unsubscribe from. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + uri: string; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/unsubscribe"; +}, { + params: { + uri: string; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/unsubscribe"; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"tools/call">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + name: z.ZodString; + arguments: z.ZodOptional>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + name: z.ZodString; + arguments: z.ZodOptional>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + name: z.ZodString; + arguments: z.ZodOptional>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + name: string; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + arguments?: Record | undefined; + } & { + [k: string]: unknown; + }; + method: "tools/call"; +}, { + params: { + name: string; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + arguments?: Record | undefined; + } & { + [k: string]: unknown; + }; + method: "tools/call"; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>>; +}>, { + method: z.ZodLiteral<"tools/list">; +}>, "strip", z.ZodTypeAny, { + method: "tools/list"; + params?: z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "tools/list"; + params?: z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}>]>; +export declare const ClientNotificationSchema: z.ZodUnion<[z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/cancelled">; + params: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The ID of the request to cancel. + * + * This MUST correspond to the ID of a request previously issued in the same direction. + */ + requestId: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + /** + * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. + */ + reason: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The ID of the request to cancel. + * + * This MUST correspond to the ID of a request previously issued in the same direction. + */ + requestId: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + /** + * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. + */ + reason: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The ID of the request to cancel. + * + * This MUST correspond to the ID of a request previously issued in the same direction. + */ + requestId: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + /** + * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. + */ + reason: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + requestId: string | number; + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + reason?: string | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/cancelled"; +}, { + params: { + requestId: string | number; + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + reason?: string | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/cancelled"; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/progress">; + params: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + /** + * An optional message describing the current progress. + */ + message: z.ZodOptional; + }>, { + /** + * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. + */ + progressToken: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + /** + * An optional message describing the current progress. + */ + message: z.ZodOptional; + }>, { + /** + * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. + */ + progressToken: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + /** + * An optional message describing the current progress. + */ + message: z.ZodOptional; + }>, { + /** + * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. + */ + progressToken: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + progressToken: string | number; + progress: number; + message?: string | undefined; + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + total?: number | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/progress"; +}, { + params: { + progressToken: string | number; + progress: number; + message?: string | undefined; + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + total?: number | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/progress"; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/initialized">; +}>, "strip", z.ZodTypeAny, { + method: "notifications/initialized"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "notifications/initialized"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/roots/list_changed">; +}>, "strip", z.ZodTypeAny, { + method: "notifications/roots/list_changed"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "notifications/roots/list_changed"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>]>; +export declare const ClientResultSchema: z.ZodUnion<[z.ZodObject<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, "strict", z.ZodTypeAny, { + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; +}, { + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The name of the model that generated the message. + */ + model: z.ZodString; + /** + * The reason why sampling stopped. + */ + stopReason: z.ZodOptional, z.ZodString]>>; + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The name of the model that generated the message. + */ + model: z.ZodString; + /** + * The reason why sampling stopped. + */ + stopReason: z.ZodOptional, z.ZodString]>>; + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The name of the model that generated the message. + */ + model: z.ZodString; + /** + * The reason why sampling stopped. + */ + stopReason: z.ZodOptional, z.ZodString]>>; + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; +}>, z.ZodTypeAny, "passthrough">>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + roots: z.ZodArray; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + roots: z.ZodArray; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + roots: z.ZodArray; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>]>; +export declare const ServerRequestSchema: z.ZodUnion<[z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"ping">; +}>, "strip", z.ZodTypeAny, { + method: "ping"; + params?: z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "ping"; + params?: z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"sampling/createMessage">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; + /** + * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt. + */ + systemPrompt: z.ZodOptional; + /** + * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request. + */ + includeContext: z.ZodOptional>; + temperature: z.ZodOptional; + /** + * The maximum number of tokens to sample, as requested by the server. The client MAY choose to sample fewer tokens than requested. + */ + maxTokens: z.ZodNumber; + stopSequences: z.ZodOptional>; + /** + * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific. + */ + metadata: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * The server's preferences for which model to select. + */ + modelPreferences: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; + /** + * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt. + */ + systemPrompt: z.ZodOptional; + /** + * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request. + */ + includeContext: z.ZodOptional>; + temperature: z.ZodOptional; + /** + * The maximum number of tokens to sample, as requested by the server. The client MAY choose to sample fewer tokens than requested. + */ + maxTokens: z.ZodNumber; + stopSequences: z.ZodOptional>; + /** + * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific. + */ + metadata: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * The server's preferences for which model to select. + */ + modelPreferences: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; + /** + * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt. + */ + systemPrompt: z.ZodOptional; + /** + * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request. + */ + includeContext: z.ZodOptional>; + temperature: z.ZodOptional; + /** + * The maximum number of tokens to sample, as requested by the server. The client MAY choose to sample fewer tokens than requested. + */ + maxTokens: z.ZodNumber; + stopSequences: z.ZodOptional>; + /** + * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific. + */ + metadata: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * The server's preferences for which model to select. + */ + modelPreferences: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + messages: z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">[]; + maxTokens: number; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + systemPrompt?: string | undefined; + includeContext?: "none" | "thisServer" | "allServers" | undefined; + temperature?: number | undefined; + stopSequences?: string[] | undefined; + metadata?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + modelPreferences?: z.objectOutputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "sampling/createMessage"; +}, { + params: { + messages: z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">[]; + maxTokens: number; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + systemPrompt?: string | undefined; + includeContext?: "none" | "thisServer" | "allServers" | undefined; + temperature?: number | undefined; + stopSequences?: string[] | undefined; + metadata?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + modelPreferences?: z.objectInputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "sampling/createMessage"; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"roots/list">; +}>, "strip", z.ZodTypeAny, { + method: "roots/list"; + params?: z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "roots/list"; + params?: z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>]>; +export declare const ServerNotificationSchema: z.ZodUnion<[z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/cancelled">; + params: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The ID of the request to cancel. + * + * This MUST correspond to the ID of a request previously issued in the same direction. + */ + requestId: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + /** + * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. + */ + reason: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The ID of the request to cancel. + * + * This MUST correspond to the ID of a request previously issued in the same direction. + */ + requestId: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + /** + * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. + */ + reason: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The ID of the request to cancel. + * + * This MUST correspond to the ID of a request previously issued in the same direction. + */ + requestId: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + /** + * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. + */ + reason: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + requestId: string | number; + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + reason?: string | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/cancelled"; +}, { + params: { + requestId: string | number; + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + reason?: string | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/cancelled"; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/progress">; + params: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + /** + * An optional message describing the current progress. + */ + message: z.ZodOptional; + }>, { + /** + * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. + */ + progressToken: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + /** + * An optional message describing the current progress. + */ + message: z.ZodOptional; + }>, { + /** + * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. + */ + progressToken: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + /** + * An optional message describing the current progress. + */ + message: z.ZodOptional; + }>, { + /** + * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. + */ + progressToken: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + progressToken: string | number; + progress: number; + message?: string | undefined; + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + total?: number | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/progress"; +}, { + params: { + progressToken: string | number; + progress: number; + message?: string | undefined; + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + total?: number | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/progress"; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/message">; + params: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The severity of this log message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + /** + * An optional name of the logger issuing this message. + */ + logger: z.ZodOptional; + /** + * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here. + */ + data: z.ZodUnknown; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The severity of this log message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + /** + * An optional name of the logger issuing this message. + */ + logger: z.ZodOptional; + /** + * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here. + */ + data: z.ZodUnknown; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The severity of this log message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + /** + * An optional name of the logger issuing this message. + */ + logger: z.ZodOptional; + /** + * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here. + */ + data: z.ZodUnknown; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + level: "error" | "debug" | "info" | "notice" | "warning" | "critical" | "alert" | "emergency"; + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + data?: unknown; + logger?: string | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/message"; +}, { + params: { + level: "error" | "debug" | "info" | "notice" | "warning" | "critical" | "alert" | "emergency"; + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + data?: unknown; + logger?: string | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/message"; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/resources/updated">; + params: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to. + */ + uri: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + uri: string; + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/resources/updated"; +}, { + params: { + uri: string; + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/resources/updated"; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/resources/list_changed">; +}>, "strip", z.ZodTypeAny, { + method: "notifications/resources/list_changed"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "notifications/resources/list_changed"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/tools/list_changed">; +}>, "strip", z.ZodTypeAny, { + method: "notifications/tools/list_changed"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "notifications/tools/list_changed"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/prompts/list_changed">; +}>, "strip", z.ZodTypeAny, { + method: "notifications/prompts/list_changed"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "notifications/prompts/list_changed"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>]>; +export declare const ServerResultSchema: z.ZodUnion<[z.ZodObject<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, "strict", z.ZodTypeAny, { + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; +}, { + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + serverInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + /** + * Instructions describing how to use the server and its features. + * + * This can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a "hint" to the model. For example, this information MAY be added to the system prompt. + */ + instructions: z.ZodOptional; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + serverInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + /** + * Instructions describing how to use the server and its features. + * + * This can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a "hint" to the model. For example, this information MAY be added to the system prompt. + */ + instructions: z.ZodOptional; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending completions to the client. + */ + completions: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + serverInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + /** + * Instructions describing how to use the server and its features. + * + * This can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a "hint" to the model. For example, this information MAY be added to the system prompt. + */ + instructions: z.ZodOptional; +}>, z.ZodTypeAny, "passthrough">>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + completion: z.ZodObject<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + completion: z.ZodObject<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + completion: z.ZodObject<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>; +}>, z.ZodTypeAny, "passthrough">>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An optional description for the prompt. + */ + description: z.ZodOptional; + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An optional description for the prompt. + */ + description: z.ZodOptional; + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An optional description for the prompt. + */ + description: z.ZodOptional; + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + prompts: z.ZodArray; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + prompts: z.ZodArray; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + prompts: z.ZodArray; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resources: z.ZodArray; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resources: z.ZodArray; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resources: z.ZodArray; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resourceTemplates: z.ZodArray; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resourceTemplates: z.ZodArray; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resourceTemplates: z.ZodArray; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + contents: z.ZodArray; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + contents: z.ZodArray; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + contents: z.ZodArray; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>, "many">; +}>, z.ZodTypeAny, "passthrough">>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * A list of content objects that represent the result of the tool call. + * + * If the Tool does not define an outputSchema, this field MUST be present in the result. + * For backwards compatibility, this field is always present, but it may be empty. + */ + content: z.ZodDefault; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>, "many">>; + /** + * An object containing structured tool output. + * + * If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema. + */ + structuredContent: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Whether the tool call ended in an error. + * + * If not set, this is assumed to be false (the call was successful). + * + * Any errors that originate from the tool SHOULD be reported inside the result + * object, with `isError` set to true, _not_ as an MCP protocol-level error + * response. Otherwise, the LLM would not be able to see that an error occurred + * and self-correct. + * + * However, any errors in _finding_ the tool, an error indicating that the + * server does not support tool calls, or any other exceptional conditions, + * should be reported as an MCP error response. + */ + isError: z.ZodOptional; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * A list of content objects that represent the result of the tool call. + * + * If the Tool does not define an outputSchema, this field MUST be present in the result. + * For backwards compatibility, this field is always present, but it may be empty. + */ + content: z.ZodDefault; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>, "many">>; + /** + * An object containing structured tool output. + * + * If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema. + */ + structuredContent: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Whether the tool call ended in an error. + * + * If not set, this is assumed to be false (the call was successful). + * + * Any errors that originate from the tool SHOULD be reported inside the result + * object, with `isError` set to true, _not_ as an MCP protocol-level error + * response. Otherwise, the LLM would not be able to see that an error occurred + * and self-correct. + * + * However, any errors in _finding_ the tool, an error indicating that the + * server does not support tool calls, or any other exceptional conditions, + * should be reported as an MCP error response. + */ + isError: z.ZodOptional; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * A list of content objects that represent the result of the tool call. + * + * If the Tool does not define an outputSchema, this field MUST be present in the result. + * For backwards compatibility, this field is always present, but it may be empty. + */ + content: z.ZodDefault; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"audio">; + /** + * The base64-encoded audio data. + */ + data: z.ZodString; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>, "many">>; + /** + * An object containing structured tool output. + * + * If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema. + */ + structuredContent: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Whether the tool call ended in an error. + * + * If not set, this is assumed to be false (the call was successful). + * + * Any errors that originate from the tool SHOULD be reported inside the result + * object, with `isError` set to true, _not_ as an MCP protocol-level error + * response. Otherwise, the LLM would not be able to see that an error occurred + * and self-correct. + * + * However, any errors in _finding_ the tool, an error indicating that the + * server does not support tool calls, or any other exceptional conditions, + * should be reported as an MCP error response. + */ + isError: z.ZodOptional; +}>, z.ZodTypeAny, "passthrough">>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + tools: z.ZodArray; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + tools: z.ZodArray; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + tools: z.ZodArray; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>; + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.ZodOptional; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + required: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Optional additional tool information. + */ + annotations: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A human-readable title for the tool. + */ + title: z.ZodOptional; + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.ZodOptional; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.ZodOptional; + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.ZodOptional; + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>]>; +export declare class McpError extends Error { + readonly code: number; + readonly data?: unknown; + constructor(code: number, message: string, data?: unknown); +} +type Primitive = string | number | boolean | bigint | null | undefined; +type Flatten = T extends Primitive ? T : T extends Array ? Array> : T extends Set ? Set> : T extends Map ? Map, Flatten> : T extends object ? { + [K in keyof T]: Flatten; +} : T; +type Infer = Flatten>; +export type ProgressToken = Infer; +export type Cursor = Infer; +export type Request = Infer; +export type RequestMeta = Infer; +export type Notification = Infer; +export type Result = Infer; +export type RequestId = Infer; +export type JSONRPCRequest = Infer; +export type JSONRPCNotification = Infer; +export type JSONRPCResponse = Infer; +export type JSONRPCError = Infer; +export type JSONRPCMessage = Infer; +export type EmptyResult = Infer; +export type CancelledNotification = Infer; +export type Implementation = Infer; +export type ClientCapabilities = Infer; +export type InitializeRequest = Infer; +export type ServerCapabilities = Infer; +export type InitializeResult = Infer; +export type InitializedNotification = Infer; +export type PingRequest = Infer; +export type Progress = Infer; +export type ProgressNotification = Infer; +export type PaginatedRequest = Infer; +export type PaginatedResult = Infer; +export type ResourceContents = Infer; +export type TextResourceContents = Infer; +export type BlobResourceContents = Infer; +export type Resource = Infer; +export type ResourceTemplate = Infer; +export type ListResourcesRequest = Infer; +export type ListResourcesResult = Infer; +export type ListResourceTemplatesRequest = Infer; +export type ListResourceTemplatesResult = Infer; +export type ReadResourceRequest = Infer; +export type ReadResourceResult = Infer; +export type ResourceListChangedNotification = Infer; +export type SubscribeRequest = Infer; +export type UnsubscribeRequest = Infer; +export type ResourceUpdatedNotification = Infer; +export type PromptArgument = Infer; +export type Prompt = Infer; +export type ListPromptsRequest = Infer; +export type ListPromptsResult = Infer; +export type GetPromptRequest = Infer; +export type TextContent = Infer; +export type ImageContent = Infer; +export type AudioContent = Infer; +export type EmbeddedResource = Infer; +export type PromptMessage = Infer; +export type GetPromptResult = Infer; +export type PromptListChangedNotification = Infer; +export type ToolAnnotations = Infer; +export type Tool = Infer; +export type ListToolsRequest = Infer; +export type ListToolsResult = Infer; +export type CallToolResult = Infer; +export type CompatibilityCallToolResult = Infer; +export type CallToolRequest = Infer; +export type ToolListChangedNotification = Infer; +export type LoggingLevel = Infer; +export type SetLevelRequest = Infer; +export type LoggingMessageNotification = Infer; +export type SamplingMessage = Infer; +export type CreateMessageRequest = Infer; +export type CreateMessageResult = Infer; +export type ResourceReference = Infer; +export type PromptReference = Infer; +export type CompleteRequest = Infer; +export type CompleteResult = Infer; +export type Root = Infer; +export type ListRootsRequest = Infer; +export type ListRootsResult = Infer; +export type RootsListChangedNotification = Infer; +export type ClientRequest = Infer; +export type ClientNotification = Infer; +export type ClientResult = Infer; +export type ServerRequest = Infer; +export type ServerNotification = Infer; +export type ServerResult = Infer; +export {}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/types.d.ts.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/types.d.ts.map new file mode 100644 index 0000000000..4abffb003c --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAEpC,eAAO,MAAM,uBAAuB,eAAe,CAAC;AACpD,eAAO,MAAM,2BAA2B,UAIvC,CAAC;AAGF,eAAO,MAAM,eAAe,QAAQ,CAAC;AAErC;;GAEG;AACH,eAAO,MAAM,mBAAmB,wCAA0C,CAAC;AAE3E;;GAEG;AACH,eAAO,MAAM,YAAY,aAAa,CAAC;AAEvC,QAAA,MAAM,iBAAiB;IAEnB;;OAEG;;;IAFH;;OAEG;;;IAFH;;OAEG;;gCAGS,CAAC;AAQjB,eAAO,MAAM,aAAa;;;;YAbtB;;eAEG;;;YAFH;;eAEG;;;YAFH;;eAEG;;;;;YAFH;;eAEG;;;YAFH;;eAEG;;;YAFH;;eAEG;;;;;YAFH;;eAEG;;;YAFH;;eAEG;;;YAFH;;eAEG;;;;;;;;YAFH;;eAEG;;;YAFH;;eAEG;;;YAFH;;eAEG;;;;;;;;YAFH;;eAEG;;;YAFH;;eAEG;;;YAFH;;eAEG;;;;EAcL,CAAC;AAWH,eAAO,MAAM,kBAAkB;;;QAP3B;;WAEG;;;QAFH;;WAEG;;;QAFH;;WAEG;;;;;;QAFH;;WAEG;;;;;;QAFH;;WAEG;;;EAQL,CAAC;AAEH,eAAO,MAAM,YAAY;IAErB;;OAEG;;;IAFH;;OAEG;;;IAFH;;OAEG;;gCAGS,CAAC;AAEjB;;GAEG;AACH,eAAO,MAAM,eAAe,wCAA0C,CAAC;AAEvE;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;YAjD7B;;eAEG;;;YAFH;;eAEG;;;YAFH;;eAEG;;;;;YAFH;;eA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,CAAC;AACpE,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAClE,MAAM,MAAM,4BAA4B,GAAG,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAG5F,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAC9D,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AACxE,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAG5D,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAC9D,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AACxE,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/types.js b/front_end/third_party/mcp-sdk/ajv/dist/esm/types.js new file mode 100644 index 0000000000..1d1eff4c43 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/types.js @@ -0,0 +1,1135 @@ +import { z } from "zod"; +export const LATEST_PROTOCOL_VERSION = "2025-03-26"; +export const SUPPORTED_PROTOCOL_VERSIONS = [ + LATEST_PROTOCOL_VERSION, + "2024-11-05", + "2024-10-07", +]; +/* JSON-RPC types */ +export const JSONRPC_VERSION = "2.0"; +/** + * A progress token, used to associate progress notifications with the original request. + */ +export const ProgressTokenSchema = z.union([z.string(), z.number().int()]); +/** + * An opaque token used to represent a cursor for pagination. + */ +export const CursorSchema = z.string(); +const RequestMetaSchema = z + .object({ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.optional(ProgressTokenSchema), +}) + .passthrough(); +const BaseRequestParamsSchema = z + .object({ + _meta: z.optional(RequestMetaSchema), +}) + .passthrough(); +export const RequestSchema = z.object({ + method: z.string(), + params: z.optional(BaseRequestParamsSchema), +}); +const BaseNotificationParamsSchema = z + .object({ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.optional(z.object({}).passthrough()), +}) + .passthrough(); +export const NotificationSchema = z.object({ + method: z.string(), + params: z.optional(BaseNotificationParamsSchema), +}); +export const ResultSchema = z + .object({ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.optional(z.object({}).passthrough()), +}) + .passthrough(); +/** + * A uniquely identifying ID for a request in JSON-RPC. + */ +export const RequestIdSchema = z.union([z.string(), z.number().int()]); +/** + * A request that expects a response. + */ +export const JSONRPCRequestSchema = z + .object({ + jsonrpc: z.literal(JSONRPC_VERSION), + id: RequestIdSchema, +}) + .merge(RequestSchema) + .strict(); +export const isJSONRPCRequest = (value) => JSONRPCRequestSchema.safeParse(value).success; +/** + * A notification which does not expect a response. + */ +export const JSONRPCNotificationSchema = z + .object({ + jsonrpc: z.literal(JSONRPC_VERSION), +}) + .merge(NotificationSchema) + .strict(); +export const isJSONRPCNotification = (value) => JSONRPCNotificationSchema.safeParse(value).success; +/** + * A successful (non-error) response to a request. + */ +export const JSONRPCResponseSchema = z + .object({ + jsonrpc: z.literal(JSONRPC_VERSION), + id: RequestIdSchema, + result: ResultSchema, +}) + .strict(); +export const isJSONRPCResponse = (value) => JSONRPCResponseSchema.safeParse(value).success; +/** + * Error codes defined by the JSON-RPC specification. + */ +export var ErrorCode; +(function (ErrorCode) { + // SDK error codes + ErrorCode[ErrorCode["ConnectionClosed"] = -32000] = "ConnectionClosed"; + ErrorCode[ErrorCode["RequestTimeout"] = -32001] = "RequestTimeout"; + // Standard JSON-RPC error codes + ErrorCode[ErrorCode["ParseError"] = -32700] = "ParseError"; + ErrorCode[ErrorCode["InvalidRequest"] = -32600] = "InvalidRequest"; + ErrorCode[ErrorCode["MethodNotFound"] = -32601] = "MethodNotFound"; + ErrorCode[ErrorCode["InvalidParams"] = -32602] = "InvalidParams"; + ErrorCode[ErrorCode["InternalError"] = -32603] = "InternalError"; +})(ErrorCode || (ErrorCode = {})); +/** + * A response to a request that indicates an error occurred. + */ +export const JSONRPCErrorSchema = z + .object({ + jsonrpc: z.literal(JSONRPC_VERSION), + id: RequestIdSchema, + error: z.object({ + /** + * The error type that occurred. + */ + code: z.number().int(), + /** + * A short description of the error. The message SHOULD be limited to a concise single sentence. + */ + message: z.string(), + /** + * Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.). + */ + data: z.optional(z.unknown()), + }), +}) + .strict(); +export const isJSONRPCError = (value) => JSONRPCErrorSchema.safeParse(value).success; +export const JSONRPCMessageSchema = z.union([ + JSONRPCRequestSchema, + JSONRPCNotificationSchema, + JSONRPCResponseSchema, + JSONRPCErrorSchema, +]); +/* Empty result */ +/** + * A response that indicates success but carries no data. + */ +export const EmptyResultSchema = ResultSchema.strict(); +/* Cancellation */ +/** + * This notification can be sent by either side to indicate that it is cancelling a previously-issued request. + * + * The request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished. + * + * This notification indicates that the result will be unused, so any associated processing SHOULD cease. + * + * A client MUST NOT attempt to cancel its `initialize` request. + */ +export const CancelledNotificationSchema = NotificationSchema.extend({ + method: z.literal("notifications/cancelled"), + params: BaseNotificationParamsSchema.extend({ + /** + * The ID of the request to cancel. + * + * This MUST correspond to the ID of a request previously issued in the same direction. + */ + requestId: RequestIdSchema, + /** + * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. + */ + reason: z.string().optional(), + }), +}); +/* Initialization */ +/** + * Describes the name and version of an MCP implementation. + */ +export const ImplementationSchema = z + .object({ + name: z.string(), + version: z.string(), +}) + .passthrough(); +/** + * Capabilities a client may support. Known capabilities are defined here, in this schema, but this is not a closed set: any client can define its own, additional capabilities. + */ +export const ClientCapabilitiesSchema = z + .object({ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.optional(z.object({}).passthrough()), + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.optional(z.object({}).passthrough()), + /** + * Present if the client supports listing roots. + */ + roots: z.optional(z + .object({ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.optional(z.boolean()), + }) + .passthrough()), +}) + .passthrough(); +/** + * This request is sent from the client to the server when it first connects, asking it to begin initialization. + */ +export const InitializeRequestSchema = RequestSchema.extend({ + method: z.literal("initialize"), + params: BaseRequestParamsSchema.extend({ + /** + * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well. + */ + protocolVersion: z.string(), + capabilities: ClientCapabilitiesSchema, + clientInfo: ImplementationSchema, + }), +}); +export const isInitializeRequest = (value) => InitializeRequestSchema.safeParse(value).success; +/** + * Capabilities that a server may support. Known capabilities are defined here, in this schema, but this is not a closed set: any server can define its own, additional capabilities. + */ +export const ServerCapabilitiesSchema = z + .object({ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.optional(z.object({}).passthrough()), + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.optional(z.object({}).passthrough()), + /** + * Present if the server supports sending completions to the client. + */ + completions: z.optional(z.object({}).passthrough()), + /** + * Present if the server offers any prompt templates. + */ + prompts: z.optional(z + .object({ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.optional(z.boolean()), + }) + .passthrough()), + /** + * Present if the server offers any resources to read. + */ + resources: z.optional(z + .object({ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.optional(z.boolean()), + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.optional(z.boolean()), + }) + .passthrough()), + /** + * Present if the server offers any tools to call. + */ + tools: z.optional(z + .object({ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.optional(z.boolean()), + }) + .passthrough()), +}) + .passthrough(); +/** + * After receiving an initialize request from the client, the server sends this response. + */ +export const InitializeResultSchema = ResultSchema.extend({ + /** + * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect. + */ + protocolVersion: z.string(), + capabilities: ServerCapabilitiesSchema, + serverInfo: ImplementationSchema, + /** + * Instructions describing how to use the server and its features. + * + * This can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a "hint" to the model. For example, this information MAY be added to the system prompt. + */ + instructions: z.optional(z.string()), +}); +/** + * This notification is sent from the client to the server after initialization has finished. + */ +export const InitializedNotificationSchema = NotificationSchema.extend({ + method: z.literal("notifications/initialized"), +}); +export const isInitializedNotification = (value) => InitializedNotificationSchema.safeParse(value).success; +/* Ping */ +/** + * A ping, issued by either the server or the client, to check that the other party is still alive. The receiver must promptly respond, or else may be disconnected. + */ +export const PingRequestSchema = RequestSchema.extend({ + method: z.literal("ping"), +}); +/* Progress notifications */ +export const ProgressSchema = z + .object({ + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.number(), + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.optional(z.number()), + /** + * An optional message describing the current progress. + */ + message: z.optional(z.string()), +}) + .passthrough(); +/** + * An out-of-band notification used to inform the receiver of a progress update for a long-running request. + */ +export const ProgressNotificationSchema = NotificationSchema.extend({ + method: z.literal("notifications/progress"), + params: BaseNotificationParamsSchema.merge(ProgressSchema).extend({ + /** + * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. + */ + progressToken: ProgressTokenSchema, + }), +}); +/* Pagination */ +export const PaginatedRequestSchema = RequestSchema.extend({ + params: BaseRequestParamsSchema.extend({ + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.optional(CursorSchema), + }).optional(), +}); +export const PaginatedResultSchema = ResultSchema.extend({ + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.optional(CursorSchema), +}); +/* Resources */ +/** + * The contents of a specific resource or sub-resource. + */ +export const ResourceContentsSchema = z + .object({ + /** + * The URI of this resource. + */ + uri: z.string(), + /** + * The MIME type of this resource, if known. + */ + mimeType: z.optional(z.string()), +}) + .passthrough(); +export const TextResourceContentsSchema = ResourceContentsSchema.extend({ + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.string(), +}); +export const BlobResourceContentsSchema = ResourceContentsSchema.extend({ + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.string().base64(), +}); +/** + * A known resource that the server is capable of reading. + */ +export const ResourceSchema = z + .object({ + /** + * The URI of this resource. + */ + uri: z.string(), + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.string(), + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.optional(z.string()), + /** + * The MIME type of this resource, if known. + */ + mimeType: z.optional(z.string()), +}) + .passthrough(); +/** + * A template description for resources available on the server. + */ +export const ResourceTemplateSchema = z + .object({ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.string(), + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.string(), + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.optional(z.string()), + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.optional(z.string()), +}) + .passthrough(); +/** + * Sent from the client to request a list of resources the server has. + */ +export const ListResourcesRequestSchema = PaginatedRequestSchema.extend({ + method: z.literal("resources/list"), +}); +/** + * The server's response to a resources/list request from the client. + */ +export const ListResourcesResultSchema = PaginatedResultSchema.extend({ + resources: z.array(ResourceSchema), +}); +/** + * Sent from the client to request a list of resource templates the server has. + */ +export const ListResourceTemplatesRequestSchema = PaginatedRequestSchema.extend({ + method: z.literal("resources/templates/list"), +}); +/** + * The server's response to a resources/templates/list request from the client. + */ +export const ListResourceTemplatesResultSchema = PaginatedResultSchema.extend({ + resourceTemplates: z.array(ResourceTemplateSchema), +}); +/** + * Sent from the client to the server, to read a specific resource URI. + */ +export const ReadResourceRequestSchema = RequestSchema.extend({ + method: z.literal("resources/read"), + params: BaseRequestParamsSchema.extend({ + /** + * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.string(), + }), +}); +/** + * The server's response to a resources/read request from the client. + */ +export const ReadResourceResultSchema = ResultSchema.extend({ + contents: z.array(z.union([TextResourceContentsSchema, BlobResourceContentsSchema])), +}); +/** + * An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This may be issued by servers without any previous subscription from the client. + */ +export const ResourceListChangedNotificationSchema = NotificationSchema.extend({ + method: z.literal("notifications/resources/list_changed"), +}); +/** + * Sent from the client to request resources/updated notifications from the server whenever a particular resource changes. + */ +export const SubscribeRequestSchema = RequestSchema.extend({ + method: z.literal("resources/subscribe"), + params: BaseRequestParamsSchema.extend({ + /** + * The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.string(), + }), +}); +/** + * Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request. + */ +export const UnsubscribeRequestSchema = RequestSchema.extend({ + method: z.literal("resources/unsubscribe"), + params: BaseRequestParamsSchema.extend({ + /** + * The URI of the resource to unsubscribe from. + */ + uri: z.string(), + }), +}); +/** + * A notification from the server to the client, informing it that a resource has changed and may need to be read again. This should only be sent if the client previously sent a resources/subscribe request. + */ +export const ResourceUpdatedNotificationSchema = NotificationSchema.extend({ + method: z.literal("notifications/resources/updated"), + params: BaseNotificationParamsSchema.extend({ + /** + * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to. + */ + uri: z.string(), + }), +}); +/* Prompts */ +/** + * Describes an argument that a prompt can accept. + */ +export const PromptArgumentSchema = z + .object({ + /** + * The name of the argument. + */ + name: z.string(), + /** + * A human-readable description of the argument. + */ + description: z.optional(z.string()), + /** + * Whether this argument must be provided. + */ + required: z.optional(z.boolean()), +}) + .passthrough(); +/** + * A prompt or prompt template that the server offers. + */ +export const PromptSchema = z + .object({ + /** + * The name of the prompt or prompt template. + */ + name: z.string(), + /** + * An optional description of what this prompt provides + */ + description: z.optional(z.string()), + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.optional(z.array(PromptArgumentSchema)), +}) + .passthrough(); +/** + * Sent from the client to request a list of prompts and prompt templates the server has. + */ +export const ListPromptsRequestSchema = PaginatedRequestSchema.extend({ + method: z.literal("prompts/list"), +}); +/** + * The server's response to a prompts/list request from the client. + */ +export const ListPromptsResultSchema = PaginatedResultSchema.extend({ + prompts: z.array(PromptSchema), +}); +/** + * Used by the client to get a prompt provided by the server. + */ +export const GetPromptRequestSchema = RequestSchema.extend({ + method: z.literal("prompts/get"), + params: BaseRequestParamsSchema.extend({ + /** + * The name of the prompt or prompt template. + */ + name: z.string(), + /** + * Arguments to use for templating the prompt. + */ + arguments: z.optional(z.record(z.string())), + }), +}); +/** + * Text provided to or from an LLM. + */ +export const TextContentSchema = z + .object({ + type: z.literal("text"), + /** + * The text content of the message. + */ + text: z.string(), +}) + .passthrough(); +/** + * An image provided to or from an LLM. + */ +export const ImageContentSchema = z + .object({ + type: z.literal("image"), + /** + * The base64-encoded image data. + */ + data: z.string().base64(), + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.string(), +}) + .passthrough(); +/** + * An Audio provided to or from an LLM. + */ +export const AudioContentSchema = z + .object({ + type: z.literal("audio"), + /** + * The base64-encoded audio data. + */ + data: z.string().base64(), + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: z.string(), +}) + .passthrough(); +/** + * The contents of a resource, embedded into a prompt or tool call result. + */ +export const EmbeddedResourceSchema = z + .object({ + type: z.literal("resource"), + resource: z.union([TextResourceContentsSchema, BlobResourceContentsSchema]), +}) + .passthrough(); +/** + * Describes a message returned as part of a prompt. + */ +export const PromptMessageSchema = z + .object({ + role: z.enum(["user", "assistant"]), + content: z.union([ + TextContentSchema, + ImageContentSchema, + AudioContentSchema, + EmbeddedResourceSchema, + ]), +}) + .passthrough(); +/** + * The server's response to a prompts/get request from the client. + */ +export const GetPromptResultSchema = ResultSchema.extend({ + /** + * An optional description for the prompt. + */ + description: z.optional(z.string()), + messages: z.array(PromptMessageSchema), +}); +/** + * An optional notification from the server to the client, informing it that the list of prompts it offers has changed. This may be issued by servers without any previous subscription from the client. + */ +export const PromptListChangedNotificationSchema = NotificationSchema.extend({ + method: z.literal("notifications/prompts/list_changed"), +}); +/* Tools */ +/** + * Additional properties describing a Tool to clients. + * + * NOTE: all properties in ToolAnnotations are **hints**. + * They are not guaranteed to provide a faithful description of + * tool behavior (including descriptive properties like `title`). + * + * Clients should never make tool use decisions based on ToolAnnotations + * received from untrusted servers. + */ +export const ToolAnnotationsSchema = z + .object({ + /** + * A human-readable title for the tool. + */ + title: z.optional(z.string()), + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint: z.optional(z.boolean()), + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint: z.optional(z.boolean()), + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on the its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint: z.optional(z.boolean()), + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint: z.optional(z.boolean()), +}) + .passthrough(); +/** + * Definition for a tool the client can call. + */ +export const ToolSchema = z + .object({ + /** + * The name of the tool. + */ + name: z.string(), + /** + * A human-readable description of the tool. + */ + description: z.optional(z.string()), + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z + .object({ + type: z.literal("object"), + properties: z.optional(z.object({}).passthrough()), + required: z.optional(z.array(z.string())), + }) + .passthrough(), + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a CallToolResult. + */ + outputSchema: z.optional(z.object({ + type: z.literal("object"), + properties: z.optional(z.object({}).passthrough()), + required: z.optional(z.array(z.string())), + }) + .passthrough()), + /** + * Optional additional tool information. + */ + annotations: z.optional(ToolAnnotationsSchema), +}) + .passthrough(); +/** + * Sent from the client to request a list of tools the server has. + */ +export const ListToolsRequestSchema = PaginatedRequestSchema.extend({ + method: z.literal("tools/list"), +}); +/** + * The server's response to a tools/list request from the client. + */ +export const ListToolsResultSchema = PaginatedResultSchema.extend({ + tools: z.array(ToolSchema), +}); +/** + * The server's response to a tool call. + */ +export const CallToolResultSchema = ResultSchema.extend({ + /** + * A list of content objects that represent the result of the tool call. + * + * If the Tool does not define an outputSchema, this field MUST be present in the result. + * For backwards compatibility, this field is always present, but it may be empty. + */ + content: z.array(z.union([ + TextContentSchema, + ImageContentSchema, + AudioContentSchema, + EmbeddedResourceSchema, + ])).default([]), + /** + * An object containing structured tool output. + * + * If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema. + */ + structuredContent: z.object({}).passthrough().optional(), + /** + * Whether the tool call ended in an error. + * + * If not set, this is assumed to be false (the call was successful). + * + * Any errors that originate from the tool SHOULD be reported inside the result + * object, with `isError` set to true, _not_ as an MCP protocol-level error + * response. Otherwise, the LLM would not be able to see that an error occurred + * and self-correct. + * + * However, any errors in _finding_ the tool, an error indicating that the + * server does not support tool calls, or any other exceptional conditions, + * should be reported as an MCP error response. + */ + isError: z.optional(z.boolean()), +}); +/** + * CallToolResultSchema extended with backwards compatibility to protocol version 2024-10-07. + */ +export const CompatibilityCallToolResultSchema = CallToolResultSchema.or(ResultSchema.extend({ + toolResult: z.unknown(), +})); +/** + * Used by the client to invoke a tool provided by the server. + */ +export const CallToolRequestSchema = RequestSchema.extend({ + method: z.literal("tools/call"), + params: BaseRequestParamsSchema.extend({ + name: z.string(), + arguments: z.optional(z.record(z.unknown())), + }), +}); +/** + * An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client. + */ +export const ToolListChangedNotificationSchema = NotificationSchema.extend({ + method: z.literal("notifications/tools/list_changed"), +}); +/* Logging */ +/** + * The severity of a log message. + */ +export const LoggingLevelSchema = z.enum([ + "debug", + "info", + "notice", + "warning", + "error", + "critical", + "alert", + "emergency", +]); +/** + * A request from the client to the server, to enable or adjust logging. + */ +export const SetLevelRequestSchema = RequestSchema.extend({ + method: z.literal("logging/setLevel"), + params: BaseRequestParamsSchema.extend({ + /** + * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message. + */ + level: LoggingLevelSchema, + }), +}); +/** + * Notification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically. + */ +export const LoggingMessageNotificationSchema = NotificationSchema.extend({ + method: z.literal("notifications/message"), + params: BaseNotificationParamsSchema.extend({ + /** + * The severity of this log message. + */ + level: LoggingLevelSchema, + /** + * An optional name of the logger issuing this message. + */ + logger: z.optional(z.string()), + /** + * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here. + */ + data: z.unknown(), + }), +}); +/* Sampling */ +/** + * Hints to use for model selection. + */ +export const ModelHintSchema = z + .object({ + /** + * A hint for a model name. + */ + name: z.string().optional(), +}) + .passthrough(); +/** + * The server's preferences for model selection, requested of the client during sampling. + */ +export const ModelPreferencesSchema = z + .object({ + /** + * Optional hints to use for model selection. + */ + hints: z.optional(z.array(ModelHintSchema)), + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.optional(z.number().min(0).max(1)), + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.optional(z.number().min(0).max(1)), + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.optional(z.number().min(0).max(1)), +}) + .passthrough(); +/** + * Describes a message issued to or received from an LLM API. + */ +export const SamplingMessageSchema = z + .object({ + role: z.enum(["user", "assistant"]), + content: z.union([TextContentSchema, ImageContentSchema, AudioContentSchema]), +}) + .passthrough(); +/** + * A request from the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it. + */ +export const CreateMessageRequestSchema = RequestSchema.extend({ + method: z.literal("sampling/createMessage"), + params: BaseRequestParamsSchema.extend({ + messages: z.array(SamplingMessageSchema), + /** + * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt. + */ + systemPrompt: z.optional(z.string()), + /** + * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request. + */ + includeContext: z.optional(z.enum(["none", "thisServer", "allServers"])), + temperature: z.optional(z.number()), + /** + * The maximum number of tokens to sample, as requested by the server. The client MAY choose to sample fewer tokens than requested. + */ + maxTokens: z.number().int(), + stopSequences: z.optional(z.array(z.string())), + /** + * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific. + */ + metadata: z.optional(z.object({}).passthrough()), + /** + * The server's preferences for which model to select. + */ + modelPreferences: z.optional(ModelPreferencesSchema), + }), +}); +/** + * The client's response to a sampling/create_message request from the server. The client should inform the user before returning the sampled message, to allow them to inspect the response (human in the loop) and decide whether to allow the server to see it. + */ +export const CreateMessageResultSchema = ResultSchema.extend({ + /** + * The name of the model that generated the message. + */ + model: z.string(), + /** + * The reason why sampling stopped. + */ + stopReason: z.optional(z.enum(["endTurn", "stopSequence", "maxTokens"]).or(z.string())), + role: z.enum(["user", "assistant"]), + content: z.discriminatedUnion("type", [ + TextContentSchema, + ImageContentSchema, + AudioContentSchema + ]), +}); +/* Autocomplete */ +/** + * A reference to a resource or resource template definition. + */ +export const ResourceReferenceSchema = z + .object({ + type: z.literal("ref/resource"), + /** + * The URI or URI template of the resource. + */ + uri: z.string(), +}) + .passthrough(); +/** + * Identifies a prompt. + */ +export const PromptReferenceSchema = z + .object({ + type: z.literal("ref/prompt"), + /** + * The name of the prompt or prompt template + */ + name: z.string(), +}) + .passthrough(); +/** + * A request from the client to the server, to ask for completion options. + */ +export const CompleteRequestSchema = RequestSchema.extend({ + method: z.literal("completion/complete"), + params: BaseRequestParamsSchema.extend({ + ref: z.union([PromptReferenceSchema, ResourceReferenceSchema]), + /** + * The argument's information + */ + argument: z + .object({ + /** + * The name of the argument + */ + name: z.string(), + /** + * The value of the argument to use for completion matching. + */ + value: z.string(), + }) + .passthrough(), + }), +}); +/** + * The server's response to a completion/complete request + */ +export const CompleteResultSchema = ResultSchema.extend({ + completion: z + .object({ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.array(z.string()).max(100), + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.optional(z.number().int()), + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.optional(z.boolean()), + }) + .passthrough(), +}); +/* Roots */ +/** + * Represents a root directory or file that the server can operate on. + */ +export const RootSchema = z + .object({ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.string().startsWith("file://"), + /** + * An optional name for the root. + */ + name: z.optional(z.string()), +}) + .passthrough(); +/** + * Sent from the server to request a list of root URIs from the client. + */ +export const ListRootsRequestSchema = RequestSchema.extend({ + method: z.literal("roots/list"), +}); +/** + * The client's response to a roots/list request from the server. + */ +export const ListRootsResultSchema = ResultSchema.extend({ + roots: z.array(RootSchema), +}); +/** + * A notification from the client to the server, informing it that the list of roots has changed. + */ +export const RootsListChangedNotificationSchema = NotificationSchema.extend({ + method: z.literal("notifications/roots/list_changed"), +}); +/* Client messages */ +export const ClientRequestSchema = z.union([ + PingRequestSchema, + InitializeRequestSchema, + CompleteRequestSchema, + SetLevelRequestSchema, + GetPromptRequestSchema, + ListPromptsRequestSchema, + ListResourcesRequestSchema, + ListResourceTemplatesRequestSchema, + ReadResourceRequestSchema, + SubscribeRequestSchema, + UnsubscribeRequestSchema, + CallToolRequestSchema, + ListToolsRequestSchema, +]); +export const ClientNotificationSchema = z.union([ + CancelledNotificationSchema, + ProgressNotificationSchema, + InitializedNotificationSchema, + RootsListChangedNotificationSchema, +]); +export const ClientResultSchema = z.union([ + EmptyResultSchema, + CreateMessageResultSchema, + ListRootsResultSchema, +]); +/* Server messages */ +export const ServerRequestSchema = z.union([ + PingRequestSchema, + CreateMessageRequestSchema, + ListRootsRequestSchema, +]); +export const ServerNotificationSchema = z.union([ + CancelledNotificationSchema, + ProgressNotificationSchema, + LoggingMessageNotificationSchema, + ResourceUpdatedNotificationSchema, + ResourceListChangedNotificationSchema, + ToolListChangedNotificationSchema, + PromptListChangedNotificationSchema, +]); +export const ServerResultSchema = z.union([ + EmptyResultSchema, + InitializeResultSchema, + CompleteResultSchema, + GetPromptResultSchema, + ListPromptsResultSchema, + ListResourcesResultSchema, + ListResourceTemplatesResultSchema, + ReadResourceResultSchema, + CallToolResultSchema, + ListToolsResultSchema, +]); +export class McpError extends Error { + constructor(code, message, data) { + super(`MCP error ${code}: ${message}`); + this.code = code; + this.data = data; + this.name = "McpError"; + } +} +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/esm/types.js.map b/front_end/third_party/mcp-sdk/ajv/dist/esm/types.js.map new file mode 100644 index 0000000000..22d0378bc5 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/esm/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAc,MAAM,KAAK,CAAC;AAEpC,MAAM,CAAC,MAAM,uBAAuB,GAAG,YAAY,CAAC;AACpD,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,uBAAuB;IACvB,YAAY;IACZ,YAAY;CACb,CAAC;AAEF,oBAAoB;AACpB,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC;AAErC;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAA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B;IACjB,yBAAyB;IACzB,qBAAqB;CACtB,CAAC,CAAC;AAEH,qBAAqB;AACrB,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC;IACzC,iBAAiB;IACjB,0BAA0B;IAC1B,sBAAsB;CACvB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC;IAC9C,2BAA2B;IAC3B,0BAA0B;IAC1B,gCAAgC;IAChC,iCAAiC;IACjC,qCAAqC;IACrC,iCAAiC;IACjC,mCAAmC;CACpC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC;IACxC,iBAAiB;IACjB,sBAAsB;IACtB,oBAAoB;IACpB,qBAAqB;IACrB,uBAAuB;IACvB,yBAAyB;IACzB,iCAAiC;IACjC,wBAAwB;IACxB,oBAAoB;IACpB,qBAAqB;CACtB,CAAC,CAAC;AAEH,MAAM,OAAO,QAAS,SAAQ,KAAK;IACjC,YACkB,IAAY,EAC5B,OAAe,EACC,IAAc;QAE9B,KAAK,CAAC,aAAa,IAAI,KAAK,OAAO,EAAE,CAAC,CAAC;QAJvB,SAAI,GAAJ,IAAI,CAAQ;QAEZ,SAAI,GAAJ,IAAI,CAAU;QAG9B,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;IACzB,CAAC;CACF"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/jtd.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/jtd.d.ts new file mode 100644 index 0000000000..a079ba4b1b --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/jtd.d.ts @@ -0,0 +1,47 @@ +import type { AnySchemaObject, SchemaObject, JTDParser } from "./types"; +import type { JTDSchemaType, SomeJTDSchemaType, JTDDataType } from "./types/jtd-schema"; +import AjvCore, { CurrentOptions } from "./core"; +type JTDOptions = CurrentOptions & { + strict?: never; + allowMatchingProperties?: never; + allowUnionTypes?: never; + validateFormats?: never; + $data?: never; + verbose?: boolean; + $comment?: never; + formats?: never; + loadSchema?: never; + useDefaults?: never; + coerceTypes?: never; + next?: never; + unevaluated?: never; + dynamicRef?: never; + meta?: boolean; + defaultMeta?: never; + inlineRefs?: boolean; + loopRequired?: never; + multipleOfPrecision?: never; +}; +export declare class Ajv extends AjvCore { + constructor(opts?: JTDOptions); + _addVocabularies(): void; + _addDefaultMetaSchema(): void; + defaultMeta(): string | AnySchemaObject | undefined; + compileSerializer(schema: SchemaObject): (data: T) => string; + compileSerializer(schema: JTDSchemaType): (data: T) => string; + compileParser(schema: SchemaObject): JTDParser; + compileParser(schema: JTDSchemaType): JTDParser; + private _compileSerializer; + private _compileParser; +} +export default Ajv; +export { Format, FormatDefinition, AsyncFormatDefinition, KeywordDefinition, KeywordErrorDefinition, CodeKeywordDefinition, MacroKeywordDefinition, FuncKeywordDefinition, Vocabulary, Schema, SchemaObject, AnySchemaObject, AsyncSchema, AnySchema, ValidateFunction, AsyncValidateFunction, ErrorObject, ErrorNoParams, JTDParser, } from "./types"; +export { Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions } from "./core"; +export { SchemaCxt, SchemaObjCxt } from "./compile"; +export { KeywordCxt } from "./compile/validate"; +export { JTDErrorObject } from "./vocabularies/jtd"; +export { _, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions } from "./compile/codegen"; +export { JTDSchemaType, SomeJTDSchemaType, JTDDataType }; +export { JTDOptions }; +export { default as ValidationError } from "./runtime/validation_error"; +export { default as MissingRefError } from "./compile/ref_error"; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/jtd.js b/front_end/third_party/mcp-sdk/ajv/dist/jtd.js new file mode 100644 index 0000000000..1a3baaf2e3 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/jtd.js @@ -0,0 +1,72 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv = void 0; +const core_1 = require("./core"); +const jtd_1 = require("./vocabularies/jtd"); +const jtd_schema_1 = require("./refs/jtd-schema"); +const serialize_1 = require("./compile/jtd/serialize"); +const parse_1 = require("./compile/jtd/parse"); +const META_SCHEMA_ID = "JTD-meta-schema"; +class Ajv extends core_1.default { + constructor(opts = {}) { + super({ + ...opts, + jtd: true, + }); + } + _addVocabularies() { + super._addVocabularies(); + this.addVocabulary(jtd_1.default); + } + _addDefaultMetaSchema() { + super._addDefaultMetaSchema(); + if (!this.opts.meta) + return; + this.addMetaSchema(jtd_schema_1.default, META_SCHEMA_ID, false); + } + defaultMeta() { + return (this.opts.defaultMeta = + super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined)); + } + compileSerializer(schema) { + const sch = this._addSchema(schema); + return sch.serialize || this._compileSerializer(sch); + } + compileParser(schema) { + const sch = this._addSchema(schema); + return (sch.parse || this._compileParser(sch)); + } + _compileSerializer(sch) { + serialize_1.default.call(this, sch, sch.schema.definitions || {}); + /* istanbul ignore if */ + if (!sch.serialize) + throw new Error("ajv implementation error"); + return sch.serialize; + } + _compileParser(sch) { + parse_1.default.call(this, sch, sch.schema.definitions || {}); + /* istanbul ignore if */ + if (!sch.parse) + throw new Error("ajv implementation error"); + return sch.parse; + } +} +exports.Ajv = Ajv; +module.exports = exports = Ajv; +module.exports.Ajv = Ajv; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = Ajv; +var validate_1 = require("./compile/validate"); +Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function () { return validate_1.KeywordCxt; } }); +var codegen_1 = require("./compile/codegen"); +Object.defineProperty(exports, "_", { enumerable: true, get: function () { return codegen_1._; } }); +Object.defineProperty(exports, "str", { enumerable: true, get: function () { return codegen_1.str; } }); +Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return codegen_1.stringify; } }); +Object.defineProperty(exports, "nil", { enumerable: true, get: function () { return codegen_1.nil; } }); +Object.defineProperty(exports, "Name", { enumerable: true, get: function () { return codegen_1.Name; } }); +Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function () { return codegen_1.CodeGen; } }); +var validation_error_1 = require("./runtime/validation_error"); +Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return validation_error_1.default; } }); +var ref_error_1 = require("./compile/ref_error"); +Object.defineProperty(exports, "MissingRefError", { enumerable: true, get: function () { return ref_error_1.default; } }); +//# sourceMappingURL=jtd.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/jtd.js.map b/front_end/third_party/mcp-sdk/ajv/dist/jtd.js.map new file mode 100644 index 0000000000..6bf9f3b1bd --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/jtd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"jtd.js","sourceRoot":"","sources":["../lib/jtd.ts"],"names":[],"mappings":";;;AAEA,iCAA8C;AAC9C,4CAA8C;AAC9C,kDAA6C;AAC7C,uDAAuD;AACvD,+CAA+C;AAG/C,MAAM,cAAc,GAAG,iBAAiB,CAAA;AA4BxC,MAAa,GAAI,SAAQ,cAAO;IAC9B,YAAY,OAAmB,EAAE;QAC/B,KAAK,CAAC;YACJ,GAAG,IAAI;YACP,GAAG,EAAE,IAAI;SACV,CAAC,CAAA;IACJ,CAAC;IAED,gBAAgB;QACd,KAAK,CAAC,gBAAgB,EAAE,CAAA;QACxB,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,CAAA;IACnC,CAAC;IAED,qBAAqB;QACnB,KAAK,CAAC,qBAAqB,EAAE,CAAA;QAC7B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;YAAE,OAAM;QAC3B,IAAI,CAAC,aAAa,CAAC,oBAAa,EAAE,cAAc,EAAE,KAAK,CAAC,CAAA;IAC1D,CAAC;IAED,WAAW;QACT,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW;YAC3B,KA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;AACxB,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC,CAAA;AAE3D,kBAAe,GAAG,CAAA;AA0BlB,+CAA6C;AAArC,sGAAA,UAAU,OAAA;AAElB,6CAA6F;AAArF,4FAAA,CAAC,OAAA;AAAE,8FAAA,GAAG,OAAA;AAAE,oGAAA,SAAS,OAAA;AAAE,8FAAA,GAAG,OAAA;AAAE,+FAAA,IAAI,OAAA;AAAQ,kGAAA,OAAO,OAAA;AAInD,+DAAqE;AAA7D,mHAAA,OAAO,OAAmB;AAClC,iDAA8D;AAAtD,4GAAA,OAAO,OAAmB"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/refs/data.json b/front_end/third_party/mcp-sdk/ajv/dist/refs/data.json new file mode 100644 index 0000000000..9ffc9f5ce0 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/refs/data.json @@ -0,0 +1,13 @@ +{ + "$id": "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", + "description": "Meta-schema for $data reference (JSON AnySchema extension proposal)", + "type": "object", + "required": ["$data"], + "properties": { + "$data": { + "type": "string", + "anyOf": [{"format": "relative-json-pointer"}, {"format": "json-pointer"}] + } + }, + "additionalProperties": false +} diff --git a/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2019-09/index.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2019-09/index.d.ts new file mode 100644 index 0000000000..cf008331f7 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2019-09/index.d.ts @@ -0,0 +1,2 @@ +import type Ajv from "../../core"; +export default function addMetaSchema2019(this: Ajv, $data?: boolean): Ajv; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2019-09/index.js b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2019-09/index.js new file mode 100644 index 0000000000..e864962820 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2019-09/index.js @@ -0,0 +1,28 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const metaSchema = require("./schema.json"); +const applicator = require("./meta/applicator.json"); +const content = require("./meta/content.json"); +const core = require("./meta/core.json"); +const format = require("./meta/format.json"); +const metadata = require("./meta/meta-data.json"); +const validation = require("./meta/validation.json"); +const META_SUPPORT_DATA = ["/properties"]; +function addMetaSchema2019($data) { + ; + [ + metaSchema, + applicator, + content, + core, + with$data(this, format), + metadata, + with$data(this, validation), + ].forEach((sch) => this.addMetaSchema(sch, undefined, false)); + return this; + function with$data(ajv, sch) { + return $data ? ajv.$dataMetaSchema(sch, META_SUPPORT_DATA) : sch; + } +} +exports.default = addMetaSchema2019; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2019-09/index.js.map b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2019-09/index.js.map new file mode 100644 index 0000000000..9b8a36d618 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2019-09/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/refs/json-schema-2019-09/index.ts"],"names":[],"mappings":";;AAEA,4CAA2C;AAC3C,qDAAoD;AACpD,+CAA8C;AAC9C,yCAAwC;AACxC,6CAA4C;AAC5C,kDAAiD;AACjD,qDAAoD;AAEpD,MAAM,iBAAiB,GAAG,CAAC,aAAa,CAAC,CAAA;AAEzC,SAAwB,iBAAiB,CAAY,KAAe;IAClE,CAAC;IAAA;QACC,UAAU;QACV,UAAU;QACV,OAAO;QACP,IAAI;QACJ,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC;QACvB,QAAQ;QACR,SAAS,CAAC,IAAI,EAAE,UAAU,CAAC;KAC5B,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC,CAAA;IAC7D,OAAO,IAAI,CAAA;IAEX,SAAS,SAAS,CAAC,GAAQ,EAAE,GAAoB;QAC/C,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC,GAAG,CAAA;IAClE,CAAC;AACH,CAAC;AAfD,oCAeC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2019-09/meta/applicator.json b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2019-09/meta/applicator.json new file mode 100644 index 0000000000..c5e91cf2ac --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2019-09/meta/applicator.json @@ -0,0 +1,53 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/applicator", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/applicator": true + }, + "$recursiveAnchor": true, + + "title": "Applicator vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "additionalItems": {"$recursiveRef": "#"}, + "unevaluatedItems": {"$recursiveRef": "#"}, + "items": { + "anyOf": [{"$recursiveRef": "#"}, {"$ref": "#/$defs/schemaArray"}] + }, + "contains": {"$recursiveRef": "#"}, + "additionalProperties": {"$recursiveRef": "#"}, + "unevaluatedProperties": {"$recursiveRef": "#"}, + "properties": { + "type": "object", + "additionalProperties": {"$recursiveRef": "#"}, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": {"$recursiveRef": "#"}, + "propertyNames": {"format": "regex"}, + "default": {} + }, + "dependentSchemas": { + "type": "object", + "additionalProperties": { + "$recursiveRef": "#" + } + }, + "propertyNames": {"$recursiveRef": "#"}, + "if": {"$recursiveRef": "#"}, + "then": {"$recursiveRef": "#"}, + "else": {"$recursiveRef": "#"}, + "allOf": {"$ref": "#/$defs/schemaArray"}, + "anyOf": {"$ref": "#/$defs/schemaArray"}, + "oneOf": {"$ref": "#/$defs/schemaArray"}, + "not": {"$recursiveRef": "#"} + }, + "$defs": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": {"$recursiveRef": "#"} + } + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2019-09/meta/content.json b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2019-09/meta/content.json new file mode 100644 index 0000000000..b8f6373434 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2019-09/meta/content.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/content", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/content": true + }, + "$recursiveAnchor": true, + + "title": "Content vocabulary meta-schema", + + "type": ["object", "boolean"], + "properties": { + "contentMediaType": {"type": "string"}, + "contentEncoding": {"type": "string"}, + "contentSchema": {"$recursiveRef": "#"} + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2019-09/meta/core.json b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2019-09/meta/core.json new file mode 100644 index 0000000000..f71adbff04 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2019-09/meta/core.json @@ -0,0 +1,57 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/core", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/core": true + }, + "$recursiveAnchor": true, + + "title": "Core vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference", + "$comment": "Non-empty fragments not allowed.", + "pattern": "^[^#]*#?$" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$anchor": { + "type": "string", + "pattern": "^[A-Za-z][-A-Za-z0-9.:_]*$" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "$recursiveRef": { + "type": "string", + "format": "uri-reference" + }, + "$recursiveAnchor": { + "type": "boolean", + "default": false + }, + "$vocabulary": { + "type": "object", + "propertyNames": { + "type": "string", + "format": "uri" + }, + "additionalProperties": { + "type": "boolean" + } + }, + "$comment": { + "type": "string" + }, + "$defs": { + "type": "object", + "additionalProperties": {"$recursiveRef": "#"}, + "default": {} + } + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2019-09/meta/format.json b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2019-09/meta/format.json new file mode 100644 index 0000000000..03ccfce26e --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2019-09/meta/format.json @@ -0,0 +1,14 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/format", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/format": true + }, + "$recursiveAnchor": true, + + "title": "Format vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "format": {"type": "string"} + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json new file mode 100644 index 0000000000..0e194326fa --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json @@ -0,0 +1,37 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/meta-data", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/meta-data": true + }, + "$recursiveAnchor": true, + + "title": "Meta-data vocabulary meta-schema", + + "type": ["object", "boolean"], + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "deprecated": { + "type": "boolean", + "default": false + }, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + } + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2019-09/meta/validation.json b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2019-09/meta/validation.json new file mode 100644 index 0000000000..7027a1279a --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2019-09/meta/validation.json @@ -0,0 +1,90 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/validation", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/validation": true + }, + "$recursiveAnchor": true, + + "title": "Validation vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": {"$ref": "#/$defs/nonNegativeInteger"}, + "minLength": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, + "pattern": { + "type": "string", + "format": "regex" + }, + "maxItems": {"$ref": "#/$defs/nonNegativeInteger"}, + "minItems": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "maxContains": {"$ref": "#/$defs/nonNegativeInteger"}, + "minContains": { + "$ref": "#/$defs/nonNegativeInteger", + "default": 1 + }, + "maxProperties": {"$ref": "#/$defs/nonNegativeInteger"}, + "minProperties": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, + "required": {"$ref": "#/$defs/stringArray"}, + "dependentRequired": { + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/stringArray" + } + }, + "const": true, + "enum": { + "type": "array", + "items": true + }, + "type": { + "anyOf": [ + {"$ref": "#/$defs/simpleTypes"}, + { + "type": "array", + "items": {"$ref": "#/$defs/simpleTypes"}, + "minItems": 1, + "uniqueItems": true + } + ] + } + }, + "$defs": { + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "$ref": "#/$defs/nonNegativeInteger", + "default": 0 + }, + "simpleTypes": { + "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] + }, + "stringArray": { + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true, + "default": [] + } + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2019-09/schema.json b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2019-09/schema.json new file mode 100644 index 0000000000..54eb7157af --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2019-09/schema.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/schema", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/core": true, + "https://json-schema.org/draft/2019-09/vocab/applicator": true, + "https://json-schema.org/draft/2019-09/vocab/validation": true, + "https://json-schema.org/draft/2019-09/vocab/meta-data": true, + "https://json-schema.org/draft/2019-09/vocab/format": false, + "https://json-schema.org/draft/2019-09/vocab/content": true + }, + "$recursiveAnchor": true, + + "title": "Core and Validation specifications meta-schema", + "allOf": [ + {"$ref": "meta/core"}, + {"$ref": "meta/applicator"}, + {"$ref": "meta/validation"}, + {"$ref": "meta/meta-data"}, + {"$ref": "meta/format"}, + {"$ref": "meta/content"} + ], + "type": ["object", "boolean"], + "properties": { + "definitions": { + "$comment": "While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.", + "type": "object", + "additionalProperties": {"$recursiveRef": "#"}, + "default": {} + }, + "dependencies": { + "$comment": "\"dependencies\" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to \"dependentSchemas\" and \"dependentRequired\"", + "type": "object", + "additionalProperties": { + "anyOf": [{"$recursiveRef": "#"}, {"$ref": "meta/validation#/$defs/stringArray"}] + } + } + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/index.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/index.d.ts new file mode 100644 index 0000000000..c232ab05c7 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/index.d.ts @@ -0,0 +1,2 @@ +import type Ajv from "../../core"; +export default function addMetaSchema2020(this: Ajv, $data?: boolean): Ajv; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/index.js b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/index.js new file mode 100644 index 0000000000..d92567564f --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/index.js @@ -0,0 +1,30 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const metaSchema = require("./schema.json"); +const applicator = require("./meta/applicator.json"); +const unevaluated = require("./meta/unevaluated.json"); +const content = require("./meta/content.json"); +const core = require("./meta/core.json"); +const format = require("./meta/format-annotation.json"); +const metadata = require("./meta/meta-data.json"); +const validation = require("./meta/validation.json"); +const META_SUPPORT_DATA = ["/properties"]; +function addMetaSchema2020($data) { + ; + [ + metaSchema, + applicator, + unevaluated, + content, + core, + with$data(this, format), + metadata, + with$data(this, validation), + ].forEach((sch) => this.addMetaSchema(sch, undefined, false)); + return this; + function with$data(ajv, sch) { + return $data ? ajv.$dataMetaSchema(sch, META_SUPPORT_DATA) : sch; + } +} +exports.default = addMetaSchema2020; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/index.js.map b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/index.js.map new file mode 100644 index 0000000000..eb90027dde --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/refs/json-schema-2020-12/index.ts"],"names":[],"mappings":";;AAEA,4CAA2C;AAC3C,qDAAoD;AACpD,uDAAsD;AACtD,+CAA8C;AAC9C,yCAAwC;AACxC,wDAAuD;AACvD,kDAAiD;AACjD,qDAAoD;AAEpD,MAAM,iBAAiB,GAAG,CAAC,aAAa,CAAC,CAAA;AAEzC,SAAwB,iBAAiB,CAAY,KAAe;IAClE,CAAC;IAAA;QACC,UAAU;QACV,UAAU;QACV,WAAW;QACX,OAAO;QACP,IAAI;QACJ,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC;QACvB,QAAQ;QACR,SAAS,CAAC,IAAI,EAAE,UAAU,CAAC;KAC5B,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC,CAAA;IAC7D,OAAO,IAAI,CAAA;IAEX,SAAS,SAAS,CAAC,GAAQ,EAAE,GAAoB;QAC/C,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC,GAAG,CAAA;IAClE,CAAC;AACH,CAAC;AAhBD,oCAgBC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/meta/applicator.json b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/meta/applicator.json new file mode 100644 index 0000000000..674c913dab --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/meta/applicator.json @@ -0,0 +1,48 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json-schema.org/draft/2020-12/meta/applicator", + "$vocabulary": { + "https://json-schema.org/draft/2020-12/vocab/applicator": true + }, + "$dynamicAnchor": "meta", + + "title": "Applicator vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "prefixItems": {"$ref": "#/$defs/schemaArray"}, + "items": {"$dynamicRef": "#meta"}, + "contains": {"$dynamicRef": "#meta"}, + "additionalProperties": {"$dynamicRef": "#meta"}, + "properties": { + "type": "object", + "additionalProperties": {"$dynamicRef": "#meta"}, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": {"$dynamicRef": "#meta"}, + "propertyNames": {"format": "regex"}, + "default": {} + }, + "dependentSchemas": { + "type": "object", + "additionalProperties": {"$dynamicRef": "#meta"}, + "default": {} + }, + "propertyNames": {"$dynamicRef": "#meta"}, + "if": {"$dynamicRef": "#meta"}, + "then": {"$dynamicRef": "#meta"}, + "else": {"$dynamicRef": "#meta"}, + "allOf": {"$ref": "#/$defs/schemaArray"}, + "anyOf": {"$ref": "#/$defs/schemaArray"}, + "oneOf": {"$ref": "#/$defs/schemaArray"}, + "not": {"$dynamicRef": "#meta"} + }, + "$defs": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": {"$dynamicRef": "#meta"} + } + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/meta/content.json b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/meta/content.json new file mode 100644 index 0000000000..2ae23ddb5c --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/meta/content.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json-schema.org/draft/2020-12/meta/content", + "$vocabulary": { + "https://json-schema.org/draft/2020-12/vocab/content": true + }, + "$dynamicAnchor": "meta", + + "title": "Content vocabulary meta-schema", + + "type": ["object", "boolean"], + "properties": { + "contentEncoding": {"type": "string"}, + "contentMediaType": {"type": "string"}, + "contentSchema": {"$dynamicRef": "#meta"} + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/meta/core.json b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/meta/core.json new file mode 100644 index 0000000000..4c8e5cb616 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/meta/core.json @@ -0,0 +1,51 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json-schema.org/draft/2020-12/meta/core", + "$vocabulary": { + "https://json-schema.org/draft/2020-12/vocab/core": true + }, + "$dynamicAnchor": "meta", + + "title": "Core vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "$id": { + "$ref": "#/$defs/uriReferenceString", + "$comment": "Non-empty fragments not allowed.", + "pattern": "^[^#]*#?$" + }, + "$schema": {"$ref": "#/$defs/uriString"}, + "$ref": {"$ref": "#/$defs/uriReferenceString"}, + "$anchor": {"$ref": "#/$defs/anchorString"}, + "$dynamicRef": {"$ref": "#/$defs/uriReferenceString"}, + "$dynamicAnchor": {"$ref": "#/$defs/anchorString"}, + "$vocabulary": { + "type": "object", + "propertyNames": {"$ref": "#/$defs/uriString"}, + "additionalProperties": { + "type": "boolean" + } + }, + "$comment": { + "type": "string" + }, + "$defs": { + "type": "object", + "additionalProperties": {"$dynamicRef": "#meta"} + } + }, + "$defs": { + "anchorString": { + "type": "string", + "pattern": "^[A-Za-z_][-A-Za-z0-9._]*$" + }, + "uriString": { + "type": "string", + "format": "uri" + }, + "uriReferenceString": { + "type": "string", + "format": "uri-reference" + } + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json new file mode 100644 index 0000000000..83c26e35f0 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json @@ -0,0 +1,14 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json-schema.org/draft/2020-12/meta/format-annotation", + "$vocabulary": { + "https://json-schema.org/draft/2020-12/vocab/format-annotation": true + }, + "$dynamicAnchor": "meta", + + "title": "Format vocabulary meta-schema for annotation results", + "type": ["object", "boolean"], + "properties": { + "format": {"type": "string"} + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json new file mode 100644 index 0000000000..11946fb501 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json @@ -0,0 +1,37 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json-schema.org/draft/2020-12/meta/meta-data", + "$vocabulary": { + "https://json-schema.org/draft/2020-12/vocab/meta-data": true + }, + "$dynamicAnchor": "meta", + + "title": "Meta-data vocabulary meta-schema", + + "type": ["object", "boolean"], + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "deprecated": { + "type": "boolean", + "default": false + }, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + } + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json new file mode 100644 index 0000000000..5e4b203b2c --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json @@ -0,0 +1,15 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json-schema.org/draft/2020-12/meta/unevaluated", + "$vocabulary": { + "https://json-schema.org/draft/2020-12/vocab/unevaluated": true + }, + "$dynamicAnchor": "meta", + + "title": "Unevaluated applicator vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "unevaluatedItems": {"$dynamicRef": "#meta"}, + "unevaluatedProperties": {"$dynamicRef": "#meta"} + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/meta/validation.json b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/meta/validation.json new file mode 100644 index 0000000000..e0ae13d9d2 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/meta/validation.json @@ -0,0 +1,90 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json-schema.org/draft/2020-12/meta/validation", + "$vocabulary": { + "https://json-schema.org/draft/2020-12/vocab/validation": true + }, + "$dynamicAnchor": "meta", + + "title": "Validation vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "type": { + "anyOf": [ + {"$ref": "#/$defs/simpleTypes"}, + { + "type": "array", + "items": {"$ref": "#/$defs/simpleTypes"}, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "const": true, + "enum": { + "type": "array", + "items": true + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": {"$ref": "#/$defs/nonNegativeInteger"}, + "minLength": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, + "pattern": { + "type": "string", + "format": "regex" + }, + "maxItems": {"$ref": "#/$defs/nonNegativeInteger"}, + "minItems": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "maxContains": {"$ref": "#/$defs/nonNegativeInteger"}, + "minContains": { + "$ref": "#/$defs/nonNegativeInteger", + "default": 1 + }, + "maxProperties": {"$ref": "#/$defs/nonNegativeInteger"}, + "minProperties": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, + "required": {"$ref": "#/$defs/stringArray"}, + "dependentRequired": { + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/stringArray" + } + } + }, + "$defs": { + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "$ref": "#/$defs/nonNegativeInteger", + "default": 0 + }, + "simpleTypes": { + "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] + }, + "stringArray": { + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true, + "default": [] + } + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/schema.json b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/schema.json new file mode 100644 index 0000000000..1c68270fdc --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-2020-12/schema.json @@ -0,0 +1,55 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json-schema.org/draft/2020-12/schema", + "$vocabulary": { + "https://json-schema.org/draft/2020-12/vocab/core": true, + "https://json-schema.org/draft/2020-12/vocab/applicator": true, + "https://json-schema.org/draft/2020-12/vocab/unevaluated": true, + "https://json-schema.org/draft/2020-12/vocab/validation": true, + "https://json-schema.org/draft/2020-12/vocab/meta-data": true, + "https://json-schema.org/draft/2020-12/vocab/format-annotation": true, + "https://json-schema.org/draft/2020-12/vocab/content": true + }, + "$dynamicAnchor": "meta", + + "title": "Core and Validation specifications meta-schema", + "allOf": [ + {"$ref": "meta/core"}, + {"$ref": "meta/applicator"}, + {"$ref": "meta/unevaluated"}, + {"$ref": "meta/validation"}, + {"$ref": "meta/meta-data"}, + {"$ref": "meta/format-annotation"}, + {"$ref": "meta/content"} + ], + "type": ["object", "boolean"], + "$comment": "This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.", + "properties": { + "definitions": { + "$comment": "\"definitions\" has been replaced by \"$defs\".", + "type": "object", + "additionalProperties": {"$dynamicRef": "#meta"}, + "deprecated": true, + "default": {} + }, + "dependencies": { + "$comment": "\"dependencies\" has been split and replaced by \"dependentSchemas\" and \"dependentRequired\" in order to serve their differing semantics.", + "type": "object", + "additionalProperties": { + "anyOf": [{"$dynamicRef": "#meta"}, {"$ref": "meta/validation#/$defs/stringArray"}] + }, + "deprecated": true, + "default": {} + }, + "$recursiveAnchor": { + "$comment": "\"$recursiveAnchor\" has been replaced by \"$dynamicAnchor\".", + "$ref": "meta/core#/$defs/anchorString", + "deprecated": true + }, + "$recursiveRef": { + "$comment": "\"$recursiveRef\" has been replaced by \"$dynamicRef\".", + "$ref": "meta/core#/$defs/uriReferenceString", + "deprecated": true + } + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-draft-06.json b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-draft-06.json new file mode 100644 index 0000000000..5410064ba8 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-draft-06.json @@ -0,0 +1,137 @@ +{ + "$schema": "http://json-schema.org/draft-06/schema#", + "$id": "http://json-schema.org/draft-06/schema#", + "title": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": {"$ref": "#"} + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [{"$ref": "#/definitions/nonNegativeInteger"}, {"default": 0}] + }, + "simpleTypes": { + "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] + }, + "stringArray": { + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true, + "default": [] + } + }, + "type": ["object", "boolean"], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": {}, + "examples": { + "type": "array", + "items": {} + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": {"$ref": "#/definitions/nonNegativeInteger"}, + "minLength": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": {"$ref": "#"}, + "items": { + "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}], + "default": {} + }, + "maxItems": {"$ref": "#/definitions/nonNegativeInteger"}, + "minItems": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "contains": {"$ref": "#"}, + "maxProperties": {"$ref": "#/definitions/nonNegativeInteger"}, + "minProperties": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "required": {"$ref": "#/definitions/stringArray"}, + "additionalProperties": {"$ref": "#"}, + "definitions": { + "type": "object", + "additionalProperties": {"$ref": "#"}, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": {"$ref": "#"}, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": {"$ref": "#"}, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/stringArray"}] + } + }, + "propertyNames": {"$ref": "#"}, + "const": {}, + "enum": { + "type": "array", + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + {"$ref": "#/definitions/simpleTypes"}, + { + "type": "array", + "items": {"$ref": "#/definitions/simpleTypes"}, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "format": {"type": "string"}, + "allOf": {"$ref": "#/definitions/schemaArray"}, + "anyOf": {"$ref": "#/definitions/schemaArray"}, + "oneOf": {"$ref": "#/definitions/schemaArray"}, + "not": {"$ref": "#"} + }, + "default": {} +} diff --git a/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-draft-07.json b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-draft-07.json new file mode 100644 index 0000000000..6a74851043 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-draft-07.json @@ -0,0 +1,151 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://json-schema.org/draft-07/schema#", + "title": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": {"$ref": "#"} + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [{"$ref": "#/definitions/nonNegativeInteger"}, {"default": 0}] + }, + "simpleTypes": { + "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] + }, + "stringArray": { + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true, + "default": [] + } + }, + "type": ["object", "boolean"], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "readOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": {"$ref": "#/definitions/nonNegativeInteger"}, + "minLength": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": {"$ref": "#"}, + "items": { + "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}], + "default": true + }, + "maxItems": {"$ref": "#/definitions/nonNegativeInteger"}, + "minItems": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "contains": {"$ref": "#"}, + "maxProperties": {"$ref": "#/definitions/nonNegativeInteger"}, + "minProperties": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "required": {"$ref": "#/definitions/stringArray"}, + "additionalProperties": {"$ref": "#"}, + "definitions": { + "type": "object", + "additionalProperties": {"$ref": "#"}, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": {"$ref": "#"}, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": {"$ref": "#"}, + "propertyNames": {"format": "regex"}, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/stringArray"}] + } + }, + "propertyNames": {"$ref": "#"}, + "const": true, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + {"$ref": "#/definitions/simpleTypes"}, + { + "type": "array", + "items": {"$ref": "#/definitions/simpleTypes"}, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "format": {"type": "string"}, + "contentMediaType": {"type": "string"}, + "contentEncoding": {"type": "string"}, + "if": {"$ref": "#"}, + "then": {"$ref": "#"}, + "else": {"$ref": "#"}, + "allOf": {"$ref": "#/definitions/schemaArray"}, + "anyOf": {"$ref": "#/definitions/schemaArray"}, + "oneOf": {"$ref": "#/definitions/schemaArray"}, + "not": {"$ref": "#"} + }, + "default": true +} diff --git a/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-secure.json b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-secure.json new file mode 100644 index 0000000000..3968abd5d9 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/refs/json-schema-secure.json @@ -0,0 +1,88 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/json-schema-secure.json#", + "title": "Meta-schema for the security assessment of JSON Schemas", + "description": "If a JSON AnySchema fails validation against this meta-schema, it may be unsafe to validate untrusted data", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": {"$ref": "#"} + } + }, + "dependencies": { + "patternProperties": { + "description": "prevent slow validation of large property names", + "required": ["propertyNames"], + "properties": { + "propertyNames": { + "required": ["maxLength"] + } + } + }, + "uniqueItems": { + "description": "prevent slow validation of large non-scalar arrays", + "if": { + "properties": { + "uniqueItems": {"const": true}, + "items": { + "properties": { + "type": { + "anyOf": [ + { + "enum": ["object", "array"] + }, + { + "type": "array", + "contains": {"enum": ["object", "array"]} + } + ] + } + } + } + } + }, + "then": { + "required": ["maxItems"] + } + }, + "pattern": { + "description": "prevent slow pattern matching of large strings", + "required": ["maxLength"] + }, + "format": { + "description": "prevent slow format validation of large strings", + "required": ["maxLength"] + } + }, + "properties": { + "additionalItems": {"$ref": "#"}, + "additionalProperties": {"$ref": "#"}, + "dependencies": { + "additionalProperties": { + "anyOf": [{"type": "array"}, {"$ref": "#"}] + } + }, + "items": { + "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}] + }, + "definitions": { + "additionalProperties": {"$ref": "#"} + }, + "patternProperties": { + "additionalProperties": {"$ref": "#"} + }, + "properties": { + "additionalProperties": {"$ref": "#"} + }, + "if": {"$ref": "#"}, + "then": {"$ref": "#"}, + "else": {"$ref": "#"}, + "allOf": {"$ref": "#/definitions/schemaArray"}, + "anyOf": {"$ref": "#/definitions/schemaArray"}, + "oneOf": {"$ref": "#/definitions/schemaArray"}, + "not": {"$ref": "#"}, + "contains": {"$ref": "#"}, + "propertyNames": {"$ref": "#"} + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/dist/refs/jtd-schema.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/refs/jtd-schema.d.ts new file mode 100644 index 0000000000..932797a387 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/refs/jtd-schema.d.ts @@ -0,0 +1,3 @@ +import { SchemaObject } from "../types"; +declare const jtdMetaSchema: SchemaObject; +export default jtdMetaSchema; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/refs/jtd-schema.js b/front_end/third_party/mcp-sdk/ajv/dist/refs/jtd-schema.js new file mode 100644 index 0000000000..1ee940afb2 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/refs/jtd-schema.js @@ -0,0 +1,118 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const shared = (root) => { + const sch = { + nullable: { type: "boolean" }, + metadata: { + optionalProperties: { + union: { elements: { ref: "schema" } }, + }, + additionalProperties: true, + }, + }; + if (root) + sch.definitions = { values: { ref: "schema" } }; + return sch; +}; +const emptyForm = (root) => ({ + optionalProperties: shared(root), +}); +const refForm = (root) => ({ + properties: { + ref: { type: "string" }, + }, + optionalProperties: shared(root), +}); +const typeForm = (root) => ({ + properties: { + type: { + enum: [ + "boolean", + "timestamp", + "string", + "float32", + "float64", + "int8", + "uint8", + "int16", + "uint16", + "int32", + "uint32", + ], + }, + }, + optionalProperties: shared(root), +}); +const enumForm = (root) => ({ + properties: { + enum: { elements: { type: "string" } }, + }, + optionalProperties: shared(root), +}); +const elementsForm = (root) => ({ + properties: { + elements: { ref: "schema" }, + }, + optionalProperties: shared(root), +}); +const propertiesForm = (root) => ({ + properties: { + properties: { values: { ref: "schema" } }, + }, + optionalProperties: { + optionalProperties: { values: { ref: "schema" } }, + additionalProperties: { type: "boolean" }, + ...shared(root), + }, +}); +const optionalPropertiesForm = (root) => ({ + properties: { + optionalProperties: { values: { ref: "schema" } }, + }, + optionalProperties: { + additionalProperties: { type: "boolean" }, + ...shared(root), + }, +}); +const discriminatorForm = (root) => ({ + properties: { + discriminator: { type: "string" }, + mapping: { + values: { + metadata: { + union: [propertiesForm(false), optionalPropertiesForm(false)], + }, + }, + }, + }, + optionalProperties: shared(root), +}); +const valuesForm = (root) => ({ + properties: { + values: { ref: "schema" }, + }, + optionalProperties: shared(root), +}); +const schema = (root) => ({ + metadata: { + union: [ + emptyForm, + refForm, + typeForm, + enumForm, + elementsForm, + propertiesForm, + optionalPropertiesForm, + discriminatorForm, + valuesForm, + ].map((s) => s(root)), + }, +}); +const jtdMetaSchema = { + definitions: { + schema: schema(false), + }, + ...schema(true), +}; +exports.default = jtdMetaSchema; +//# sourceMappingURL=jtd-schema.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/refs/jtd-schema.js.map b/front_end/third_party/mcp-sdk/ajv/dist/refs/jtd-schema.js.map new file mode 100644 index 0000000000..d46755b213 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/refs/jtd-schema.js.map @@ -0,0 +1 @@ +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AE,sBAAsB,CAAC,KAAK,CAAC,CAAC;iBAC9D;aACF;SACF;KACF;IACD,kBAAkB,EAAE,MAAM,CAAC,IAAI,CAAC;CACjC,CAAC,CAAA;AAEF,MAAM,UAAU,GAAe,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACxC,UAAU,EAAE;QACV,MAAM,EAAE,EAAC,GAAG,EAAE,QAAQ,EAAC;KACxB;IACD,kBAAkB,EAAE,MAAM,CAAC,IAAI,CAAC;CACjC,CAAC,CAAA;AAEF,MAAM,MAAM,GAAe,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACpC,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,SAAS;YACT,OAAO;YACP,QAAQ;YACR,QAAQ;YACR,YAAY;YACZ,cAAc;YACd,sBAAsB;YACtB,iBAAiB;YACjB,UAAU;SACX,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;KACtB;CACF,CAAC,CAAA;AAEF,MAAM,aAAa,GAAiB;IAClC,WAAW,EAAE;QACX,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC;KACtB;IACD,GAAG,MAAM,CAAC,IAAI,CAAC;CAChB,CAAA;AAED,kBAAe,aAAa,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/runtime/equal.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/runtime/equal.d.ts new file mode 100644 index 0000000000..777cae20e9 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/runtime/equal.d.ts @@ -0,0 +1,6 @@ +import * as equal from "fast-deep-equal"; +type Equal = typeof equal & { + code: string; +}; +declare const _default: Equal; +export default _default; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/runtime/equal.js b/front_end/third_party/mcp-sdk/ajv/dist/runtime/equal.js new file mode 100644 index 0000000000..774bba05af --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/runtime/equal.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +// https://github.com/ajv-validator/ajv/issues/889 +const equal = require("fast-deep-equal"); +equal.code = 'require("ajv/dist/runtime/equal").default'; +exports.default = equal; +//# sourceMappingURL=equal.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/runtime/equal.js.map b/front_end/third_party/mcp-sdk/ajv/dist/runtime/equal.js.map new file mode 100644 index 0000000000..0e17901c3d --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/runtime/equal.js.map @@ -0,0 +1 @@ +{"version":3,"file":"equal.js","sourceRoot":"","sources":["../../lib/runtime/equal.ts"],"names":[],"mappings":";;AAAA,kDAAkD;AAClD,yCAAwC;AAGtC,KAAe,CAAC,IAAI,GAAG,2CAA2C,CAAA;AAEpE,kBAAe,KAAc,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/runtime/parseJson.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/runtime/parseJson.d.ts new file mode 100644 index 0000000000..85f1d5670b --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/runtime/parseJson.d.ts @@ -0,0 +1,18 @@ +export declare function parseJson(s: string, pos: number): unknown; +export declare namespace parseJson { + var message: string | undefined; + var position: number; + var code: string; +} +export declare function parseJsonNumber(s: string, pos: number, maxDigits?: number): number | undefined; +export declare namespace parseJsonNumber { + var message: string | undefined; + var position: number; + var code: string; +} +export declare function parseJsonString(s: string, pos: number): string | undefined; +export declare namespace parseJsonString { + var message: string | undefined; + var position: number; + var code: string; +} diff --git a/front_end/third_party/mcp-sdk/ajv/dist/runtime/parseJson.js b/front_end/third_party/mcp-sdk/ajv/dist/runtime/parseJson.js new file mode 100644 index 0000000000..eaa2838182 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/runtime/parseJson.js @@ -0,0 +1,185 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.parseJsonString = exports.parseJsonNumber = exports.parseJson = void 0; +const rxParseJson = /position\s(\d+)(?: \(line \d+ column \d+\))?$/; +function parseJson(s, pos) { + let endPos; + parseJson.message = undefined; + let matches; + if (pos) + s = s.slice(pos); + try { + parseJson.position = pos + s.length; + return JSON.parse(s); + } + catch (e) { + matches = rxParseJson.exec(e.message); + if (!matches) { + parseJson.message = "unexpected end"; + return undefined; + } + endPos = +matches[1]; + const c = s[endPos]; + s = s.slice(0, endPos); + parseJson.position = pos + endPos; + try { + return JSON.parse(s); + } + catch (e1) { + parseJson.message = `unexpected token ${c}`; + return undefined; + } + } +} +exports.parseJson = parseJson; +parseJson.message = undefined; +parseJson.position = 0; +parseJson.code = 'require("ajv/dist/runtime/parseJson").parseJson'; +function parseJsonNumber(s, pos, maxDigits) { + let numStr = ""; + let c; + parseJsonNumber.message = undefined; + if (s[pos] === "-") { + numStr += "-"; + pos++; + } + if (s[pos] === "0") { + numStr += "0"; + pos++; + } + else { + if (!parseDigits(maxDigits)) { + errorMessage(); + return undefined; + } + } + if (maxDigits) { + parseJsonNumber.position = pos; + return +numStr; + } + if (s[pos] === ".") { + numStr += "."; + pos++; + if (!parseDigits()) { + errorMessage(); + return undefined; + } + } + if (((c = s[pos]), c === "e" || c === "E")) { + numStr += "e"; + pos++; + if (((c = s[pos]), c === "+" || c === "-")) { + numStr += c; + pos++; + } + if (!parseDigits()) { + errorMessage(); + return undefined; + } + } + parseJsonNumber.position = pos; + return +numStr; + function parseDigits(maxLen) { + let digit = false; + while (((c = s[pos]), c >= "0" && c <= "9" && (maxLen === undefined || maxLen-- > 0))) { + digit = true; + numStr += c; + pos++; + } + return digit; + } + function errorMessage() { + parseJsonNumber.position = pos; + parseJsonNumber.message = pos < s.length ? `unexpected token ${s[pos]}` : "unexpected end"; + } +} +exports.parseJsonNumber = parseJsonNumber; +parseJsonNumber.message = undefined; +parseJsonNumber.position = 0; +parseJsonNumber.code = 'require("ajv/dist/runtime/parseJson").parseJsonNumber'; +const escapedChars = { + b: "\b", + f: "\f", + n: "\n", + r: "\r", + t: "\t", + '"': '"', + "/": "/", + "\\": "\\", +}; +const CODE_A = "a".charCodeAt(0); +const CODE_0 = "0".charCodeAt(0); +function parseJsonString(s, pos) { + let str = ""; + let c; + parseJsonString.message = undefined; + // eslint-disable-next-line no-constant-condition, @typescript-eslint/no-unnecessary-condition + while (true) { + c = s[pos++]; + if (c === '"') + break; + if (c === "\\") { + c = s[pos]; + if (c in escapedChars) { + str += escapedChars[c]; + pos++; + } + else if (c === "u") { + pos++; + let count = 4; + let code = 0; + while (count--) { + code <<= 4; + c = s[pos]; + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + if (c === undefined) { + errorMessage("unexpected end"); + return undefined; + } + c = c.toLowerCase(); + if (c >= "a" && c <= "f") { + code += c.charCodeAt(0) - CODE_A + 10; + } + else if (c >= "0" && c <= "9") { + code += c.charCodeAt(0) - CODE_0; + } + else { + errorMessage(`unexpected token ${c}`); + return undefined; + } + pos++; + } + str += String.fromCharCode(code); + } + else { + errorMessage(`unexpected token ${c}`); + return undefined; + } + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + } + else if (c === undefined) { + errorMessage("unexpected end"); + return undefined; + } + else { + if (c.charCodeAt(0) >= 0x20) { + str += c; + } + else { + errorMessage(`unexpected token ${c}`); + return undefined; + } + } + } + parseJsonString.position = pos; + return str; + function errorMessage(msg) { + parseJsonString.position = pos; + parseJsonString.message = msg; + } +} +exports.parseJsonString = parseJsonString; +parseJsonString.message = undefined; +parseJsonString.position = 0; +parseJsonString.code = 'require("ajv/dist/runtime/parseJson").parseJsonString'; +//# sourceMappingURL=parseJson.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/runtime/parseJson.js.map b/front_end/third_party/mcp-sdk/ajv/dist/runtime/parseJson.js.map new file mode 100644 index 0000000000..7c125f87ef --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/runtime/parseJson.js.map @@ -0,0 +1 @@ +{"version":3,"file":"parseJson.js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GAAG,uDAAuD,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/runtime/quote.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/runtime/quote.d.ts new file mode 100644 index 0000000000..0579dd3c63 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/runtime/quote.d.ts @@ -0,0 +1,5 @@ +declare function quote(s: string): string; +declare namespace quote { + var code: string; +} +export default quote; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/runtime/quote.js b/front_end/third_party/mcp-sdk/ajv/dist/runtime/quote.js new file mode 100644 index 0000000000..ebf78f70d2 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/runtime/quote.js @@ -0,0 +1,30 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const rxEscapable = +// eslint-disable-next-line no-control-regex, no-misleading-character-class +/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; +const escaped = { + "\b": "\\b", + "\t": "\\t", + "\n": "\\n", + "\f": "\\f", + "\r": "\\r", + '"': '\\"', + "\\": "\\\\", +}; +function quote(s) { + rxEscapable.lastIndex = 0; + return ('"' + + (rxEscapable.test(s) + ? s.replace(rxEscapable, (a) => { + const c = escaped[a]; + return typeof c === "string" + ? c + : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4); + }) + : s) + + '"'); +} +exports.default = quote; +quote.code = 'require("ajv/dist/runtime/quote").default'; +//# sourceMappingURL=quote.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/runtime/quote.js.map b/front_end/third_party/mcp-sdk/ajv/dist/runtime/quote.js.map new file mode 100644 index 0000000000..4d226252d1 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/runtime/quote.js.map @@ -0,0 +1 @@ +{"version":3,"file":"quote.js","sourceRoot":"","sources":["../../lib/runtime/quote.ts"],"names":[],"mappings":";;AAAA,MAAM,WAAW;AACf,2EAA2E;AAC3E,iIAAiI,CAAA;AAEnI,MAAM,OAAO,GAA6B;IACxC,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,KAAK;IACX,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;CACb,CAAA;AAED,SAAwB,KAAK,CAAC,CAAS;IACrC,WAAW,CAAC,SAAS,GAAG,CAAC,CAAA;IACzB,OAAO,CACL,GAAG;QACH,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;YAClB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE;gBAC3B,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;gBACpB,OAAO,OAAO,CAAC,KAAK,QAAQ;oBAC1B,CAAC,CAAC,CAAC;oBACH,CAAC,CAAC,KAAK,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;YAC/D,CAAC,CAAC;YACJ,CAAC,CAAC,CAAC,CAAC;QACN,GAAG,CACJ,CAAA;AACH,CAAC;AAdD,wBAcC;AAED,KAAK,CAAC,IAAI,GAAG,2CAA2C,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/runtime/re2.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/runtime/re2.d.ts new file mode 100644 index 0000000000..c34a98f2f9 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/runtime/re2.d.ts @@ -0,0 +1,6 @@ +import * as re2 from "re2"; +type Re2 = typeof re2 & { + code: string; +}; +declare const _default: Re2; +export default _default; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/runtime/re2.js b/front_end/third_party/mcp-sdk/ajv/dist/runtime/re2.js new file mode 100644 index 0000000000..4b1ee25370 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/runtime/re2.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const re2 = require("re2"); +re2.code = 'require("ajv/dist/runtime/re2").default'; +exports.default = re2; +//# sourceMappingURL=re2.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/runtime/re2.js.map b/front_end/third_party/mcp-sdk/ajv/dist/runtime/re2.js.map new file mode 100644 index 0000000000..bb938a2c4a --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/runtime/re2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"re2.js","sourceRoot":"","sources":["../../lib/runtime/re2.ts"],"names":[],"mappings":";;AAAA,2BAA0B;AAGxB,GAAW,CAAC,IAAI,GAAG,yCAAyC,CAAA;AAE9D,kBAAe,GAAU,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/runtime/timestamp.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/runtime/timestamp.d.ts new file mode 100644 index 0000000000..cd48326886 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/runtime/timestamp.d.ts @@ -0,0 +1,5 @@ +declare function validTimestamp(str: string, allowDate: boolean): boolean; +declare namespace validTimestamp { + var code: string; +} +export default validTimestamp; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/runtime/timestamp.js b/front_end/third_party/mcp-sdk/ajv/dist/runtime/timestamp.js new file mode 100644 index 0000000000..5e0f06564b --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/runtime/timestamp.js @@ -0,0 +1,42 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const DT_SEPARATOR = /t|\s/i; +const DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/; +const TIME = /^(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:z|([+-]\d\d)(?::?(\d\d))?)$/i; +const DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; +function validTimestamp(str, allowDate) { + // http://tools.ietf.org/html/rfc3339#section-5.6 + const dt = str.split(DT_SEPARATOR); + return ((dt.length === 2 && validDate(dt[0]) && validTime(dt[1])) || + (allowDate && dt.length === 1 && validDate(dt[0]))); +} +exports.default = validTimestamp; +function validDate(str) { + const matches = DATE.exec(str); + if (!matches) + return false; + const y = +matches[1]; + const m = +matches[2]; + const d = +matches[3]; + return (m >= 1 && + m <= 12 && + d >= 1 && + (d <= DAYS[m] || + // leap year: https://tools.ietf.org/html/rfc3339#appendix-C + (m === 2 && d === 29 && (y % 100 === 0 ? y % 400 === 0 : y % 4 === 0)))); +} +function validTime(str) { + const matches = TIME.exec(str); + if (!matches) + return false; + const hr = +matches[1]; + const min = +matches[2]; + const sec = +matches[3]; + const tzH = +(matches[4] || 0); + const tzM = +(matches[5] || 0); + return ((hr <= 23 && min <= 59 && sec <= 59) || + // leap second + (hr - tzH === 23 && min - tzM === 59 && sec === 60)); +} +validTimestamp.code = 'require("ajv/dist/runtime/timestamp").default'; +//# sourceMappingURL=timestamp.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/runtime/timestamp.js.map b/front_end/third_party/mcp-sdk/ajv/dist/runtime/timestamp.js.map new file mode 100644 index 0000000000..6b0eee0399 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/runtime/timestamp.js.map @@ -0,0 +1 @@ +{"version":3,"file":"timestamp.js","sourceRoot":"","sources":["../../lib/runtime/timestamp.ts"],"names":[],"mappings":";;AAAA,MAAM,YAAY,GAAG,OAAO,CAAA;AAC5B,MAAM,IAAI,GAAG,4BAA4B,CAAA;AACzC,MAAM,IAAI,GAAG,gEAAgE,CAAA;AAC7E,MAAM,IAAI,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,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CAAC;AAED,SAAS,SAAS,CAAC,GAAW;IAC5B,MAAM,OAAO,GAAoB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IAC/C,IAAI,CAAC,OAAO;QAAE,OAAO,KAAK,CAAA;IAC1B,MAAM,EAAE,GAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IAC9B,MAAM,GAAG,GAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IAC/B,MAAM,GAAG,GAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IAC/B,MAAM,GAAG,GAAW,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAA;IACtC,MAAM,GAAG,GAAW,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAA;IACtC,OAAO,CACL,CAAC,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,IAAI,EAAE,CAAC;QACpC,cAAc;QACd,CAAC,EAAE,GAAG,GAAG,KAAK,EAAE,IAAI,GAAG,GAAG,GAAG,KAAK,EAAE,IAAI,GAAG,KAAK,EAAE,CAAC,CACpD,CAAA;AACH,CAAC;AAED,cAAc,CAAC,IAAI,GAAG,+CAA+C,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/runtime/ucs2length.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/runtime/ucs2length.d.ts new file mode 100644 index 0000000000..ecbee69c5d --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/runtime/ucs2length.d.ts @@ -0,0 +1,5 @@ +declare function ucs2length(str: string): number; +declare namespace ucs2length { + var code: string; +} +export default ucs2length; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/runtime/ucs2length.js b/front_end/third_party/mcp-sdk/ajv/dist/runtime/ucs2length.js new file mode 100644 index 0000000000..92ea0c08a2 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/runtime/ucs2length.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +// https://mathiasbynens.be/notes/javascript-encoding +// https://github.com/bestiejs/punycode.js - punycode.ucs2.decode +function ucs2length(str) { + const len = str.length; + let length = 0; + let pos = 0; + let value; + while (pos < len) { + length++; + value = str.charCodeAt(pos++); + if (value >= 0xd800 && value <= 0xdbff && pos < len) { + // high surrogate, and there is a next character + value = str.charCodeAt(pos); + if ((value & 0xfc00) === 0xdc00) + pos++; // low surrogate + } + } + return length; +} +exports.default = ucs2length; +ucs2length.code = 'require("ajv/dist/runtime/ucs2length").default'; +//# sourceMappingURL=ucs2length.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/runtime/ucs2length.js.map b/front_end/third_party/mcp-sdk/ajv/dist/runtime/ucs2length.js.map new file mode 100644 index 0000000000..a5ceb6b10e --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/runtime/ucs2length.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ucs2length.js","sourceRoot":"","sources":["../../lib/runtime/ucs2length.ts"],"names":[],"mappings":";;AAAA,qDAAqD;AACrD,iEAAiE;AACjE,SAAwB,UAAU,CAAC,GAAW;IAC5C,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,CAAA;IACtB,IAAI,MAAM,GAAG,CAAC,CAAA;IACd,IAAI,GAAG,GAAG,CAAC,CAAA;IACX,IAAI,KAAa,CAAA;IACjB,OAAO,GAAG,GAAG,GAAG,EAAE,CAAC;QACjB,MAAM,EAAE,CAAA;QACR,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,CAAA;QAC7B,IAAI,KAAK,IAAI,MAAM,IAAI,KAAK,IAAI,MAAM,IAAI,GAAG,GAAG,GAAG,EAAE,CAAC;YACpD,gDAAgD;YAChD,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;YAC3B,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,MAAM;gBAAE,GAAG,EAAE,CAAA,CAAC,gBAAgB;QACzD,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC;AAfD,6BAeC;AAED,UAAU,CAAC,IAAI,GAAG,gDAAgD,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/runtime/uri.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/runtime/uri.d.ts new file mode 100644 index 0000000000..8e9e079f9e --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/runtime/uri.d.ts @@ -0,0 +1,6 @@ +import * as uri from "fast-uri"; +type URI = typeof uri & { + code: string; +}; +declare const _default: URI; +export default _default; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/runtime/uri.js b/front_end/third_party/mcp-sdk/ajv/dist/runtime/uri.js new file mode 100644 index 0000000000..bbd2f05244 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/runtime/uri.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const uri = require("fast-uri"); +uri.code = 'require("ajv/dist/runtime/uri").default'; +exports.default = uri; +//# sourceMappingURL=uri.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/runtime/uri.js.map b/front_end/third_party/mcp-sdk/ajv/dist/runtime/uri.js.map new file mode 100644 index 0000000000..3f80a4c305 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/runtime/uri.js.map @@ -0,0 +1 @@ +{"version":3,"file":"uri.js","sourceRoot":"","sources":["../../lib/runtime/uri.ts"],"names":[],"mappings":";;AAAA,gCAA+B;AAG7B,GAAW,CAAC,IAAI,GAAG,yCAAyC,CAAA;AAE9D,kBAAe,GAAU,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/runtime/validation_error.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/runtime/validation_error.d.ts new file mode 100644 index 0000000000..b0ee9698f2 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/runtime/validation_error.d.ts @@ -0,0 +1,7 @@ +import type { ErrorObject } from "../types"; +export default class ValidationError extends Error { + readonly errors: Partial[]; + readonly ajv: true; + readonly validation: true; + constructor(errors: Partial[]); +} diff --git a/front_end/third_party/mcp-sdk/ajv/dist/runtime/validation_error.js b/front_end/third_party/mcp-sdk/ajv/dist/runtime/validation_error.js new file mode 100644 index 0000000000..353502c089 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/runtime/validation_error.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class ValidationError extends Error { + constructor(errors) { + super("validation failed"); + this.errors = errors; + this.ajv = this.validation = true; + } +} +exports.default = ValidationError; +//# sourceMappingURL=validation_error.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/runtime/validation_error.js.map b/front_end/third_party/mcp-sdk/ajv/dist/runtime/validation_error.js.map new file mode 100644 index 0000000000..70206fbc18 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/runtime/validation_error.js.map @@ -0,0 +1 @@ +{"version":3,"file":"validation_error.js","sourceRoot":"","sources":["../../lib/runtime/validation_error.ts"],"names":[],"mappings":";;AAEA,MAAqB,eAAgB,SAAQ,KAAK;IAKhD,YAAY,MAA8B;QACxC,KAAK,CAAC,mBAAmB,CAAC,CAAA;QAC1B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,UAAU,GAAG,IAAI,CAAA;IACnC,CAAC;CACF;AAVD,kCAUC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/standalone/index.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/standalone/index.d.ts new file mode 100644 index 0000000000..a9141c3d2e --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/standalone/index.d.ts @@ -0,0 +1,6 @@ +import type AjvCore from "../core"; +import type { AnyValidateFunction } from "../types"; +declare function standaloneCode(ajv: AjvCore, refsOrFunc?: { + [K in string]?: string; +} | AnyValidateFunction): string; +export default standaloneCode; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/standalone/index.js b/front_end/third_party/mcp-sdk/ajv/dist/standalone/index.js new file mode 100644 index 0000000000..b44bb5db5c --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/standalone/index.js @@ -0,0 +1,90 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const scope_1 = require("../compile/codegen/scope"); +const code_1 = require("../compile/codegen/code"); +function standaloneCode(ajv, refsOrFunc) { + if (!ajv.opts.code.source) { + throw new Error("moduleCode: ajv instance must have code.source option"); + } + const { _n } = ajv.scope.opts; + return typeof refsOrFunc == "function" + ? funcExportCode(refsOrFunc.source) + : refsOrFunc !== undefined + ? multiExportsCode(refsOrFunc, getValidate) + : multiExportsCode(ajv.schemas, (sch) => sch.meta ? undefined : ajv.compile(sch.schema)); + function getValidate(id) { + const v = ajv.getSchema(id); + if (!v) + throw new Error(`moduleCode: no schema with id ${id}`); + return v; + } + function funcExportCode(source) { + const usedValues = {}; + const n = source === null || source === void 0 ? void 0 : source.validateName; + const vCode = validateCode(usedValues, source); + if (ajv.opts.code.esm) { + // Always do named export as `validate` rather than the variable `n` which is `validateXX` for known export value + return `"use strict";${_n}export const validate = ${n};${_n}export default ${n};${_n}${vCode}`; + } + return `"use strict";${_n}module.exports = ${n};${_n}module.exports.default = ${n};${_n}${vCode}`; + } + function multiExportsCode(schemas, getValidateFunc) { + var _a; + const usedValues = {}; + let code = (0, code_1._) `"use strict";`; + for (const name in schemas) { + const v = getValidateFunc(schemas[name]); + if (v) { + const vCode = validateCode(usedValues, v.source); + const exportSyntax = ajv.opts.code.esm + ? (0, code_1._) `export const ${(0, code_1.getEsmExportName)(name)}` + : (0, code_1._) `exports${(0, code_1.getProperty)(name)}`; + code = (0, code_1._) `${code}${_n}${exportSyntax} = ${(_a = v.source) === null || _a === void 0 ? void 0 : _a.validateName};${_n}${vCode}`; + } + } + return `${code}`; + } + function validateCode(usedValues, s) { + if (!s) + throw new Error('moduleCode: function does not have "source" property'); + if (usedState(s.validateName) === scope_1.UsedValueState.Completed) + return code_1.nil; + setUsedState(s.validateName, scope_1.UsedValueState.Started); + const scopeCode = ajv.scope.scopeCode(s.scopeValues, usedValues, refValidateCode); + const code = new code_1._Code(`${scopeCode}${_n}${s.validateCode}`); + return s.evaluated ? (0, code_1._) `${code}${s.validateName}.evaluated = ${s.evaluated};${_n}` : code; + function refValidateCode(n) { + var _a; + const vRef = (_a = n.value) === null || _a === void 0 ? void 0 : _a.ref; + if (n.prefix === "validate" && typeof vRef == "function") { + const v = vRef; + return validateCode(usedValues, v.source); + } + else if ((n.prefix === "root" || n.prefix === "wrapper") && typeof vRef == "object") { + const { validate, validateName } = vRef; + if (!validateName) + throw new Error("ajv internal error"); + const def = ajv.opts.code.es5 ? scope_1.varKinds.var : scope_1.varKinds.const; + const wrapper = (0, code_1._) `${def} ${n} = {validate: ${validateName}};`; + if (usedState(validateName) === scope_1.UsedValueState.Started) + return wrapper; + const vCode = validateCode(usedValues, validate === null || validate === void 0 ? void 0 : validate.source); + return (0, code_1._) `${wrapper}${_n}${vCode}`; + } + return undefined; + } + function usedState(name) { + var _a; + return (_a = usedValues[name.prefix]) === null || _a === void 0 ? void 0 : _a.get(name); + } + function setUsedState(name, state) { + const { prefix } = name; + const names = (usedValues[prefix] = usedValues[prefix] || new Map()); + names.set(name, state); + } + } +} +module.exports = exports = standaloneCode; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = standaloneCode; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/standalone/index.js.map b/front_end/third_party/mcp-sdk/ajv/dist/standalone/index.js.map new file mode 100644 index 0000000000..8551fe910e --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/standalone/index.js.map @@ -0,0 +1 @@ +{"version":3,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AC,CAAC,gBAAQ,CAAC,KAAK,CAAA;gBAC7D,MAAM,OAAO,GAAG,IAAA,QAAC,EAAA,GAAG,GAAG,IAAI,CAAC,iBAAiB,YAAY,IAAI,CAAA;gBAC7D,IAAI,SAAS,CAAC,YAAY,CAAC,KAAK,sBAAc,CAAC,OAAO;oBAAE,OAAO,OAAO,CAAA;gBACtE,MAAM,KAAK,GAAG,YAAY,CAAC,UAAU,EAAE,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,MAAM,CAAC,CAAA;gBACxD,OAAO,IAAA,QAAC,EAAA,GAAG,OAAO,GAAG,EAAE,GAAG,KAAK,EAAE,CAAA;YACnC,CAAC;YACD,OAAO,SAAS,CAAA;QAClB,CAAC;QAED,SAAS,SAAS,CAAC,IAAoB;;YACrC,OAAO,MAAA,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,0CAAE,GAAG,CAAC,IAAI,CAAC,CAAA;QAC3C,CAAC;QAED,SAAS,YAAY,CAAC,IAAoB,EAAE,KAAqB;YAC/D,MAAM,EAAC,MAAM,EAAC,GAAG,IAAI,CAAA;YACrB,MAAM,KAAK,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,IAAI,GAAG,EAAE,CAAC,CAAA;YACpE,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QACxB,CAAC;IACH,CAAC;AACH,CAAC;AAED,MAAM,CAAC,OAAO,GAAG,OAAO,GAAG,cAAc,CAAA;AACzC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC,CAAA;AAE3D,kBAAe,cAAc,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/standalone/instance.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/standalone/instance.d.ts new file mode 100644 index 0000000000..156ac3226f --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/standalone/instance.d.ts @@ -0,0 +1,12 @@ +import Ajv, { AnySchema, AnyValidateFunction, ErrorObject } from "../core"; +export default class AjvPack { + readonly ajv: Ajv; + errors?: ErrorObject[] | null; + constructor(ajv: Ajv); + validate(schemaKeyRef: AnySchema | string, data: unknown): boolean | Promise; + compile(schema: AnySchema, meta?: boolean): AnyValidateFunction; + getSchema(keyRef: string): AnyValidateFunction | undefined; + private getStandalone; + addSchema(...args: Parameters): AjvPack; + addKeyword(...args: Parameters): AjvPack; +} diff --git a/front_end/third_party/mcp-sdk/ajv/dist/standalone/instance.js b/front_end/third_party/mcp-sdk/ajv/dist/standalone/instance.js new file mode 100644 index 0000000000..35e5c9925a --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/standalone/instance.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const core_1 = require("../core"); +const _1 = require("."); +const requireFromString = require("require-from-string"); +class AjvPack { + constructor(ajv) { + this.ajv = ajv; + } + validate(schemaKeyRef, data) { + return core_1.default.prototype.validate.call(this, schemaKeyRef, data); + } + compile(schema, meta) { + return this.getStandalone(this.ajv.compile(schema, meta)); + } + getSchema(keyRef) { + const v = this.ajv.getSchema(keyRef); + if (!v) + return undefined; + return this.getStandalone(v); + } + getStandalone(v) { + return requireFromString((0, _1.default)(this.ajv, v)); + } + addSchema(...args) { + this.ajv.addSchema.call(this.ajv, ...args); + return this; + } + addKeyword(...args) { + this.ajv.addKeyword.call(this.ajv, ...args); + return this; + } +} +exports.default = AjvPack; +//# sourceMappingURL=instance.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/standalone/instance.js.map b/front_end/third_party/mcp-sdk/ajv/dist/standalone/instance.js.map new file mode 100644 index 0000000000..6ac33b1140 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/standalone/instance.js.map @@ -0,0 +1 @@ +{"version":3,"file":"instance.js","sourceRoot":"","sources":["../../lib/standalone/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front_end/third_party/mcp-sdk/ajv/dist/types/index.d.ts new file mode 100644 index 0000000000..49903cd329 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/types/index.d.ts @@ -0,0 +1,183 @@ +import { URIComponent } from "fast-uri"; +import type { CodeGen, Code, Name, ScopeValueSets, ValueScopeName } from "../compile/codegen"; +import type { SchemaEnv, SchemaCxt, SchemaObjCxt } from "../compile"; +import type { JSONType } from "../compile/rules"; +import type { KeywordCxt } from "../compile/validate"; +import type Ajv from "../core"; +interface _SchemaObject { + id?: string; + $id?: string; + $schema?: string; + [x: string]: any; +} +export interface SchemaObject extends _SchemaObject { + id?: string; + $id?: string; + $schema?: string; + $async?: false; + [x: string]: any; +} +export interface AsyncSchema extends _SchemaObject { + $async: true; +} +export type AnySchemaObject = SchemaObject | AsyncSchema; +export type Schema = SchemaObject | boolean; +export type AnySchema = Schema | AsyncSchema; +export type SchemaMap = { + [Key in string]?: AnySchema; +}; +export interface SourceCode { + validateName: ValueScopeName; + validateCode: string; + scopeValues: ScopeValueSets; + evaluated?: Code; +} +export interface DataValidationCxt { + instancePath: string; + parentData: { + [K in T]: any; + }; + parentDataProperty: T; + rootData: Record | any[]; + dynamicAnchors: { + [Ref in string]?: ValidateFunction; + }; +} +export interface ValidateFunction { + (this: Ajv | any, data: any, dataCxt?: DataValidationCxt): data is T; + errors?: null | ErrorObject[]; + evaluated?: Evaluated; + schema: AnySchema; + schemaEnv: SchemaEnv; + source?: SourceCode; +} +export interface JTDParser { + (json: string): T | undefined; + message?: string; + position?: number; +} +export type EvaluatedProperties = { + [K in string]?: true; +} | true; +export type EvaluatedItems = number | true; +export interface Evaluated { + props?: EvaluatedProperties; + items?: EvaluatedItems; + dynamicProps: boolean; + dynamicItems: boolean; +} +export interface AsyncValidateFunction extends ValidateFunction { + (...args: Parameters>): Promise; + $async: true; +} +export type AnyValidateFunction = ValidateFunction | AsyncValidateFunction; +export interface ErrorObject, S = unknown> { + keyword: K; + instancePath: string; + schemaPath: string; + params: P; + propertyName?: string; + message?: string; + schema?: S; + parentSchema?: AnySchemaObject; + data?: unknown; +} +export type ErrorNoParams = ErrorObject, S>; +interface _KeywordDef { + keyword: string | string[]; + type?: JSONType | JSONType[]; + schemaType?: JSONType | JSONType[]; + allowUndefined?: boolean; + $data?: boolean; + implements?: string[]; + before?: string; + post?: boolean; + metaSchema?: AnySchemaObject; + validateSchema?: AnyValidateFunction; + dependencies?: string[]; + error?: KeywordErrorDefinition; + $dataError?: KeywordErrorDefinition; +} +export interface CodeKeywordDefinition extends _KeywordDef { + code: (cxt: KeywordCxt, ruleType?: string) => void; + trackErrors?: boolean; +} +export type MacroKeywordFunc = (schema: any, parentSchema: AnySchemaObject, it: SchemaCxt) => AnySchema; +export type CompileKeywordFunc = (schema: any, parentSchema: AnySchemaObject, it: SchemaObjCxt) => DataValidateFunction; +export interface DataValidateFunction { + (...args: Parameters): boolean | Promise; + errors?: Partial[]; +} +export interface SchemaValidateFunction { + (schema: any, data: any, parentSchema?: AnySchemaObject, dataCxt?: DataValidationCxt): boolean | Promise; + errors?: Partial[]; +} +export interface FuncKeywordDefinition extends _KeywordDef { + validate?: SchemaValidateFunction | DataValidateFunction; + compile?: CompileKeywordFunc; + schema?: boolean; + modifying?: boolean; + async?: boolean; + valid?: boolean; + errors?: boolean | "full"; +} +export interface MacroKeywordDefinition extends FuncKeywordDefinition { + macro: MacroKeywordFunc; +} +export type KeywordDefinition = CodeKeywordDefinition | FuncKeywordDefinition | MacroKeywordDefinition; +export type AddedKeywordDefinition = KeywordDefinition & { + type: JSONType[]; + schemaType: JSONType[]; +}; +export interface KeywordErrorDefinition { + message: string | Code | ((cxt: KeywordErrorCxt) => string | Code); + params?: Code | ((cxt: KeywordErrorCxt) => Code); +} +export type Vocabulary = (KeywordDefinition | string)[]; +export interface KeywordErrorCxt { + gen: CodeGen; + keyword: string; + data: Name; + $data?: string | false; + schema: any; + parentSchema?: AnySchemaObject; + schemaCode: Code | number | boolean; + schemaValue: Code | number | boolean; + schemaType?: JSONType[]; + errsCount?: Name; + params: KeywordCxtParams; + it: SchemaCxt; +} +export type KeywordCxtParams = { + [P in string]?: Code | string | number; +}; +export type FormatValidator = (data: T) => boolean; +export type FormatCompare = (data1: T, data2: T) => number | undefined; +export type AsyncFormatValidator = (data: T) => Promise; +export interface FormatDefinition { + type?: T extends string ? "string" | undefined : "number"; + validate: FormatValidator | (T extends string ? string | RegExp : never); + async?: false | undefined; + compare?: FormatCompare; +} +export interface AsyncFormatDefinition { + type?: T extends string ? "string" | undefined : "number"; + validate: AsyncFormatValidator; + async: true; + compare?: FormatCompare; +} +export type AddedFormat = true | RegExp | FormatValidator | FormatDefinition | FormatDefinition | AsyncFormatDefinition | AsyncFormatDefinition; +export type Format = AddedFormat | string; +export interface RegExpEngine { + (pattern: string, u: string): RegExpLike; + code: string; +} +export interface RegExpLike { + test: (s: string) => boolean; +} +export interface UriResolver { + parse(uri: string): URIComponent; + resolve(base: string, path: string): string; + serialize(component: URIComponent): string; +} +export {}; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/types/index.js b/front_end/third_party/mcp-sdk/ajv/dist/types/index.js new file mode 100644 index 0000000000..aa219d8f2a --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/types/index.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/types/index.js.map b/front_end/third_party/mcp-sdk/ajv/dist/types/index.js.map new file mode 100644 index 0000000000..1f80f85ec7 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/types/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/types/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/types/json-schema.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/types/json-schema.d.ts new file mode 100644 index 0000000000..a391fef722 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/types/json-schema.d.ts @@ -0,0 +1,125 @@ +type StrictNullChecksWrapper = undefined extends null ? `strictNullChecks must be true in tsconfig to use ${Name}` : Type; +type UnionToIntersection = (U extends any ? (_: U) => void : never) extends (_: infer I) => void ? I : never; +export type SomeJSONSchema = UncheckedJSONSchemaType; +type UncheckedPartialSchema = Partial>; +export type PartialSchema = StrictNullChecksWrapper<"PartialSchema", UncheckedPartialSchema>; +type JSONType = IsPartial extends true ? T | undefined : T; +interface NumberKeywords { + minimum?: number; + maximum?: number; + exclusiveMinimum?: number; + exclusiveMaximum?: number; + multipleOf?: number; + format?: string; +} +interface StringKeywords { + minLength?: number; + maxLength?: number; + pattern?: string; + format?: string; +} +type UncheckedJSONSchemaType = (// these two unions allow arbitrary unions of types +{ + anyOf: readonly UncheckedJSONSchemaType[]; +} | { + oneOf: readonly UncheckedJSONSchemaType[]; +} | ({ + type: readonly (T extends number ? JSONType<"number" | "integer", IsPartial> : T extends string ? JSONType<"string", IsPartial> : T extends boolean ? JSONType<"boolean", IsPartial> : never)[]; +} & UnionToIntersection) | ((T extends number ? { + type: JSONType<"number" | "integer", IsPartial>; +} & NumberKeywords : T extends string ? { + type: JSONType<"string", IsPartial>; +} & StringKeywords : T extends boolean ? { + type: JSONType<"boolean", IsPartial>; +} : T extends readonly [any, ...any[]] ? { + type: JSONType<"array", IsPartial>; + items: { + readonly [K in keyof T]-?: UncheckedJSONSchemaType & Nullable; + } & { + length: T["length"]; + }; + minItems: T["length"]; +} & ({ + maxItems: T["length"]; +} | { + additionalItems: false; +}) : T extends readonly any[] ? { + type: JSONType<"array", IsPartial>; + items: UncheckedJSONSchemaType; + contains?: UncheckedPartialSchema; + minItems?: number; + maxItems?: number; + minContains?: number; + maxContains?: number; + uniqueItems?: true; + additionalItems?: never; +} : T extends Record ? { + type: JSONType<"object", IsPartial>; + additionalProperties?: boolean | UncheckedJSONSchemaType; + unevaluatedProperties?: boolean | UncheckedJSONSchemaType; + properties?: IsPartial extends true ? Partial> : UncheckedPropertiesSchema; + patternProperties?: Record>; + propertyNames?: Omit, "type"> & { + type?: "string"; + }; + dependencies?: { + [K in keyof T]?: readonly (keyof T)[] | UncheckedPartialSchema; + }; + dependentRequired?: { + [K in keyof T]?: readonly (keyof T)[]; + }; + dependentSchemas?: { + [K in keyof T]?: UncheckedPartialSchema; + }; + minProperties?: number; + maxProperties?: number; +} & (IsPartial extends true ? { + required: readonly (keyof T)[]; +} : [UncheckedRequiredMembers] extends [never] ? { + required?: readonly UncheckedRequiredMembers[]; +} : { + required: readonly UncheckedRequiredMembers[]; +}) : T extends null ? { + type: JSONType<"null", IsPartial>; + nullable: true; +} : never) & { + allOf?: readonly UncheckedPartialSchema[]; + anyOf?: readonly UncheckedPartialSchema[]; + oneOf?: readonly UncheckedPartialSchema[]; + if?: UncheckedPartialSchema; + then?: UncheckedPartialSchema; + else?: UncheckedPartialSchema; + not?: UncheckedPartialSchema; +})) & { + [keyword: string]: any; + $id?: string; + $ref?: string; + $defs?: Record>; + definitions?: Record>; +}; +export type JSONSchemaType = StrictNullChecksWrapper<"JSONSchemaType", UncheckedJSONSchemaType>; +type Known = { + [key: string]: Known; +} | [Known, ...Known[]] | Known[] | number | string | boolean | null; +type UncheckedPropertiesSchema = { + [K in keyof T]-?: (UncheckedJSONSchemaType & Nullable) | { + $ref: string; + }; +}; +export type PropertiesSchema = StrictNullChecksWrapper<"PropertiesSchema", UncheckedPropertiesSchema>; +type UncheckedRequiredMembers = { + [K in keyof T]-?: undefined extends T[K] ? never : K; +}[keyof T]; +export type RequiredMembers = StrictNullChecksWrapper<"RequiredMembers", UncheckedRequiredMembers>; +type Nullable = undefined extends T ? { + nullable: true; + const?: null; + enum?: readonly (T | null)[]; + default?: T | null; +} : { + nullable?: false; + const?: T; + enum?: readonly T[]; + default?: T; +}; +export {}; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/types/json-schema.js b/front_end/third_party/mcp-sdk/ajv/dist/types/json-schema.js new file mode 100644 index 0000000000..2d8f98dc53 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/types/json-schema.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=json-schema.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/types/json-schema.js.map b/front_end/third_party/mcp-sdk/ajv/dist/types/json-schema.js.map new file mode 100644 index 0000000000..ae6b4d0fe5 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/types/json-schema.js.map @@ -0,0 +1 @@ +{"version":3,"file":"json-schema.js","sourceRoot":"","sources":["../../lib/types/json-schema.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/types/jtd-schema.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/types/jtd-schema.d.ts new file mode 100644 index 0000000000..80ad3129ab --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/types/jtd-schema.d.ts @@ -0,0 +1,174 @@ +/** numeric strings */ +type NumberType = "float32" | "float64" | "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32"; +/** string strings */ +type StringType = "string" | "timestamp"; +/** Generic JTD Schema without inference of the represented type */ +export type SomeJTDSchemaType = (// ref +{ + ref: string; +} | { + type: NumberType | StringType | "boolean"; +} | { + enum: string[]; +} | { + elements: SomeJTDSchemaType; +} | { + values: SomeJTDSchemaType; +} | { + properties: Record; + optionalProperties?: Record; + additionalProperties?: boolean; +} | { + properties?: Record; + optionalProperties: Record; + additionalProperties?: boolean; +} | { + discriminator: string; + mapping: Record; +} | {}) & { + nullable?: boolean; + metadata?: Record; + definitions?: Record; +}; +/** required keys of an object, not undefined */ +type RequiredKeys = { + [K in keyof T]-?: undefined extends T[K] ? never : K; +}[keyof T]; +/** optional or undifined-able keys of an object */ +type OptionalKeys = { + [K in keyof T]-?: undefined extends T[K] ? K : never; +}[keyof T]; +/** type is true if T is a union type */ +type IsUnion_ = false extends (T extends unknown ? ([U] extends [T] ? false : true) : never) ? false : true; +type IsUnion = IsUnion_; +/** type is true if T is identically E */ +type TypeEquality = [T] extends [E] ? ([E] extends [T] ? true : false) : false; +/** type is true if T or null is identically E or null*/ +type NullTypeEquality = TypeEquality; +/** gets only the string literals of a type or null if a type isn't a string literal */ +type EnumString = [T] extends [never] ? null : T extends string ? string extends T ? null : T : null; +/** true if type is a union of string literals */ +type IsEnum = null extends EnumString ? false : true; +/** true only if all types are array types (not tuples) */ +type IsElements = false extends IsUnion ? [T] extends [readonly unknown[]] ? undefined extends T[0.5] ? false : true : false : false; +/** true if the the type is a values type */ +type IsValues = false extends IsUnion ? TypeEquality : false; +/** true if type is a properties type and Union is false, or type is a discriminator type and Union is true */ +type IsRecord = Union extends IsUnion ? null extends EnumString ? false : true : false; +/** true if type represents an empty record */ +type IsEmptyRecord = [T] extends [Record] ? [T] extends [never] ? false : true : false; +/** actual schema */ +export type JTDSchemaType = Record> = (// refs - where null wasn't specified, must match exactly +(null extends EnumString ? never : ({ + [K in keyof D]: [T] extends [D[K]] ? { + ref: K; + } : never; +}[keyof D] & { + nullable?: false; +}) | (null extends T ? { + [K in keyof D]: [Exclude] extends [Exclude] ? { + ref: K; + } : never; +}[keyof D] & { + nullable: true; +} : never)) | (unknown extends T ? { + nullable?: boolean; +} : never) | ((true extends NullTypeEquality ? { + type: NumberType; +} : true extends NullTypeEquality ? { + type: "boolean"; +} : true extends NullTypeEquality ? { + type: StringType; +} : true extends NullTypeEquality ? { + type: "timestamp"; +} : true extends IsEnum> ? { + enum: EnumString>[]; +} : true extends IsElements> ? T extends readonly (infer E)[] ? { + elements: JTDSchemaType; +} : never : true extends IsEmptyRecord> ? { + properties: Record; + optionalProperties?: Record; +} | { + optionalProperties: Record; +} : true extends IsValues> ? T extends Record ? { + values: JTDSchemaType; +} : never : true extends IsRecord, false> ? ([RequiredKeys>] extends [never] ? { + properties?: Record; +} : { + properties: { + [K in RequiredKeys]: JTDSchemaType; + }; +}) & ([OptionalKeys>] extends [never] ? { + optionalProperties?: Record; +} : { + optionalProperties: { + [K in OptionalKeys]: JTDSchemaType, D>; + }; +}) & { + additionalProperties?: boolean; +} : true extends IsRecord, true> ? { + [K in keyof Exclude]-?: Exclude[K] extends string ? { + discriminator: K; + mapping: { + [M in Exclude[K]]: JTDSchemaType ? T : never, K>, D>; + }; + } : never; +}[keyof Exclude] : never) & (null extends T ? { + nullable: true; +} : { + nullable?: false; +}))) & { + metadata?: Record; + definitions?: { + [K in keyof D]: JTDSchemaType; + }; +}; +type JTDDataDef> = // ref +(S extends { + ref: string; +} ? D extends { + [K in S["ref"]]: infer V; +} ? JTDDataDef : never : S extends { + type: NumberType; +} ? number : S extends { + type: "boolean"; +} ? boolean : S extends { + type: "string"; +} ? string : S extends { + type: "timestamp"; +} ? string | Date : S extends { + enum: readonly (infer E)[]; +} ? string extends E ? never : [E] extends [string] ? E : never : S extends { + elements: infer E; +} ? JTDDataDef[] : S extends { + properties: Record; + optionalProperties?: Record; + additionalProperties?: boolean; +} ? { + -readonly [K in keyof S["properties"]]-?: JTDDataDef; +} & { + -readonly [K in keyof S["optionalProperties"]]+?: JTDDataDef; +} & ([S["additionalProperties"]] extends [true] ? Record : unknown) : S extends { + properties?: Record; + optionalProperties: Record; + additionalProperties?: boolean; +} ? { + -readonly [K in keyof S["properties"]]-?: JTDDataDef; +} & { + -readonly [K in keyof S["optionalProperties"]]+?: JTDDataDef; +} & ([S["additionalProperties"]] extends [true] ? Record : unknown) : S extends { + values: infer V; +} ? Record> : S extends { + discriminator: infer M; + mapping: Record; +} ? [M] extends [string] ? { + [K in keyof S["mapping"]]: JTDDataDef & { + [KM in M]: K; + }; +}[keyof S["mapping"]] : never : unknown) | (S extends { + nullable: true; +} ? null : never); +export type JTDDataType = S extends { + definitions: Record; +} ? JTDDataDef : JTDDataDef>; +export {}; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/types/jtd-schema.js b/front_end/third_party/mcp-sdk/ajv/dist/types/jtd-schema.js new file mode 100644 index 0000000000..11338aa8a8 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/types/jtd-schema.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=jtd-schema.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/types/jtd-schema.js.map b/front_end/third_party/mcp-sdk/ajv/dist/types/jtd-schema.js.map new file mode 100644 index 0000000000..add89bd779 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/types/jtd-schema.js.map @@ -0,0 +1 @@ +{"version":3,"file":"jtd-schema.js","sourceRoot":"","sources":["../../lib/types/jtd-schema.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/additionalItems.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/additionalItems.d.ts new file mode 100644 index 0000000000..607515646f --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/additionalItems.d.ts @@ -0,0 +1,8 @@ +import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types"; +import type { KeywordCxt } from "../../compile/validate"; +export type AdditionalItemsError = ErrorObject<"additionalItems", { + limit: number; +}, AnySchema>; +declare const def: CodeKeywordDefinition; +export declare function validateAdditionalItems(cxt: KeywordCxt, items: AnySchema[]): void; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/additionalItems.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/additionalItems.js new file mode 100644 index 0000000000..608d51eb6a --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/additionalItems.js @@ -0,0 +1,49 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.validateAdditionalItems = void 0; +const codegen_1 = require("../../compile/codegen"); +const util_1 = require("../../compile/util"); +const error = { + message: ({ params: { len } }) => (0, codegen_1.str) `must NOT have more than ${len} items`, + params: ({ params: { len } }) => (0, codegen_1._) `{limit: ${len}}`, +}; +const def = { + keyword: "additionalItems", + type: "array", + schemaType: ["boolean", "object"], + before: "uniqueItems", + error, + code(cxt) { + const { parentSchema, it } = cxt; + const { items } = parentSchema; + if (!Array.isArray(items)) { + (0, util_1.checkStrictMode)(it, '"additionalItems" is ignored when "items" is not an array of schemas'); + return; + } + validateAdditionalItems(cxt, items); + }, +}; +function validateAdditionalItems(cxt, items) { + const { gen, schema, data, keyword, it } = cxt; + it.items = true; + const len = gen.const("len", (0, codegen_1._) `${data}.length`); + if (schema === false) { + cxt.setParams({ len: items.length }); + cxt.pass((0, codegen_1._) `${len} <= ${items.length}`); + } + else if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) { + const valid = gen.var("valid", (0, codegen_1._) `${len} <= ${items.length}`); // TODO var + gen.if((0, codegen_1.not)(valid), () => validateItems(valid)); + cxt.ok(valid); + } + function validateItems(valid) { + gen.forRange("i", items.length, len, (i) => { + cxt.subschema({ keyword, dataProp: i, dataPropType: util_1.Type.Num }, valid); + if (!it.allErrors) + gen.if((0, codegen_1.not)(valid), () => gen.break()); + }); + } +} +exports.validateAdditionalItems = validateAdditionalItems; +exports.default = def; +//# sourceMappingURL=additionalItems.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/additionalItems.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/additionalItems.js.map new file mode 100644 index 0000000000..0091d3142a --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/additionalItems.js.map @@ -0,0 +1 @@ +{"version":3,"file":"additionalItems.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/additionalItems.ts"],"names":[],"mappings":";;;AAOA,mDAAuD;AACvD,6CAA2E;AAI3E,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,MAAM,EA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AM,EAAE,CAAC,CAAA;IACxC,CAAC;SAAM,IAAI,OAAO,MAAM,IAAI,QAAQ,IAAI,CAAC,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC;QACvE,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,IAAA,WAAC,EAAA,GAAG,GAAG,OAAO,KAAK,CAAC,MAAM,EAAE,CAAC,CAAA,CAAC,WAAW;QACxE,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAA;QAC9C,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;IACf,CAAC;IAED,SAAS,aAAa,CAAC,KAAW;QAChC,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE;YACzC,GAAG,CAAC,SAAS,CAAC,EAAC,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,YAAY,EAAE,WAAI,CAAC,GAAG,EAAC,EAAE,KAAK,CAAC,CAAA;YACpE,IAAI,CAAC,EAAE,CAAC,SAAS;gBAAE,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAA;QAC1D,CAAC,CAAC,CAAA;IACJ,CAAC;AACH,CAAC;AAnBD,0DAmBC;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/additionalProperties.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/additionalProperties.d.ts new file mode 100644 index 0000000000..74698c7a2b --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/additionalProperties.d.ts @@ -0,0 +1,6 @@ +import type { CodeKeywordDefinition, AddedKeywordDefinition, ErrorObject, AnySchema } from "../../types"; +export type AdditionalPropertiesError = ErrorObject<"additionalProperties", { + additionalProperty: string; +}, AnySchema>; +declare const def: CodeKeywordDefinition & AddedKeywordDefinition; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/additionalProperties.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/additionalProperties.js new file mode 100644 index 0000000000..1d3374bb76 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/additionalProperties.js @@ -0,0 +1,106 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const code_1 = require("../code"); +const codegen_1 = require("../../compile/codegen"); +const names_1 = require("../../compile/names"); +const util_1 = require("../../compile/util"); +const error = { + message: "must NOT have additional properties", + params: ({ params }) => (0, codegen_1._) `{additionalProperty: ${params.additionalProperty}}`, +}; +const def = { + keyword: "additionalProperties", + type: ["object"], + schemaType: ["boolean", "object"], + allowUndefined: true, + trackErrors: true, + error, + code(cxt) { + const { gen, schema, parentSchema, data, errsCount, it } = cxt; + /* istanbul ignore if */ + if (!errsCount) + throw new Error("ajv implementation error"); + const { allErrors, opts } = it; + it.props = true; + if (opts.removeAdditional !== "all" && (0, util_1.alwaysValidSchema)(it, schema)) + return; + const props = (0, code_1.allSchemaProperties)(parentSchema.properties); + const patProps = (0, code_1.allSchemaProperties)(parentSchema.patternProperties); + checkAdditionalProperties(); + cxt.ok((0, codegen_1._) `${errsCount} === ${names_1.default.errors}`); + function checkAdditionalProperties() { + gen.forIn("key", data, (key) => { + if (!props.length && !patProps.length) + additionalPropertyCode(key); + else + gen.if(isAdditional(key), () => additionalPropertyCode(key)); + }); + } + function isAdditional(key) { + let definedProp; + if (props.length > 8) { + // TODO maybe an option instead of hard-coded 8? + const propsSchema = (0, util_1.schemaRefOrVal)(it, parentSchema.properties, "properties"); + definedProp = (0, code_1.isOwnProperty)(gen, propsSchema, key); + } + else if (props.length) { + definedProp = (0, codegen_1.or)(...props.map((p) => (0, codegen_1._) `${key} === ${p}`)); + } + else { + definedProp = codegen_1.nil; + } + if (patProps.length) { + definedProp = (0, codegen_1.or)(definedProp, ...patProps.map((p) => (0, codegen_1._) `${(0, code_1.usePattern)(cxt, p)}.test(${key})`)); + } + return (0, codegen_1.not)(definedProp); + } + function deleteAdditional(key) { + gen.code((0, codegen_1._) `delete ${data}[${key}]`); + } + function additionalPropertyCode(key) { + if (opts.removeAdditional === "all" || (opts.removeAdditional && schema === false)) { + deleteAdditional(key); + return; + } + if (schema === false) { + cxt.setParams({ additionalProperty: key }); + cxt.error(); + if (!allErrors) + gen.break(); + return; + } + if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) { + const valid = gen.name("valid"); + if (opts.removeAdditional === "failing") { + applyAdditionalSchema(key, valid, false); + gen.if((0, codegen_1.not)(valid), () => { + cxt.reset(); + deleteAdditional(key); + }); + } + else { + applyAdditionalSchema(key, valid); + if (!allErrors) + gen.if((0, codegen_1.not)(valid), () => gen.break()); + } + } + } + function applyAdditionalSchema(key, valid, errors) { + const subschema = { + keyword: "additionalProperties", + dataProp: key, + dataPropType: util_1.Type.Str, + }; + if (errors === false) { + Object.assign(subschema, { + compositeRule: true, + createErrors: false, + allErrors: false, + }); + } + cxt.subschema(subschema, valid); + } + }, +}; +exports.default = def; +//# sourceMappingURL=additionalProperties.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/additionalProperties.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/additionalProperties.js.map new file mode 100644 index 0000000000..649ddae517 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/additionalProperties.js.map @@ -0,0 +1 @@ +{"version":3,"file":"additionalProperties.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/additionalProperties.ts"],"names":[],"mappings":";;AAOA,kCAAsE;AACtE,mDAAiE;AACjE,+CAAmC;AAEnC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C;YACH,CAAC;QACH,CAAC;QAED,SAAS,qBAAqB,CAAC,GAAS,EAAE,KAAW,EAAE,MAAc;YACnE,MAAM,SAAS,GAAkB;gBAC/B,OAAO,EAAE,sBAAsB;gBAC/B,QAAQ,EAAE,GAAG;gBACb,YAAY,EAAE,WAAI,CAAC,GAAG;aACvB,CAAA;YACD,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;gBACrB,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE;oBACvB,aAAa,EAAE,IAAI;oBACnB,YAAY,EAAE,KAAK;oBACnB,SAAS,EAAE,KAAK;iBACjB,CAAC,CAAA;YACJ,CAAC;YACD,GAAG,CAAC,SAAS,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA;QACjC,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/allOf.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/allOf.d.ts new file mode 100644 index 0000000000..cde2aa2700 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/allOf.d.ts @@ -0,0 +1,3 @@ +import type { CodeKeywordDefinition } from "../../types"; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/allOf.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/allOf.js new file mode 100644 index 0000000000..1b1ae73761 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/allOf.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const util_1 = require("../../compile/util"); +const def = { + keyword: "allOf", + schemaType: "array", + code(cxt) { + const { gen, schema, it } = cxt; + /* istanbul ignore if */ + if (!Array.isArray(schema)) + throw new Error("ajv implementation error"); + const valid = gen.name("valid"); + schema.forEach((sch, i) => { + if ((0, util_1.alwaysValidSchema)(it, sch)) + return; + const schCxt = cxt.subschema({ keyword: "allOf", schemaProp: i }, valid); + cxt.ok(valid); + cxt.mergeEvaluated(schCxt); + }); + }, +}; +exports.default = def; +//# sourceMappingURL=allOf.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/allOf.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/allOf.js.map new file mode 100644 index 0000000000..d119d0eae7 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/allOf.js.map @@ -0,0 +1 @@ +{"version":3,"file":"allOf.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/allOf.ts"],"names":[],"mappings":";;AAEA,6CAAoD;AAEpD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE,OAAO;IACnB,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QAC7B,wBAAwB;QACxB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;QACvE,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC/B,MAAM,CAAC,OAAO,CAAC,CAAC,GAAc,EAAE,CAAS,EAAE,EAAE;YAC3C,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,GAAG,CAAC;gBAAE,OAAM;YACtC,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC,EAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,EAAC,EAAE,KAAK,CAAC,CAAA;YACtE,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;YACb,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,CAAA;QAC5B,CAAC,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/anyOf.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/anyOf.d.ts new file mode 100644 index 0000000000..61bca56e0c --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/anyOf.d.ts @@ -0,0 +1,4 @@ +import type { CodeKeywordDefinition, ErrorNoParams, AnySchema } from "../../types"; +export type AnyOfError = ErrorNoParams<"anyOf", AnySchema[]>; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/anyOf.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/anyOf.js new file mode 100644 index 0000000000..66cfce2cc5 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/anyOf.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const code_1 = require("../code"); +const def = { + keyword: "anyOf", + schemaType: "array", + trackErrors: true, + code: code_1.validateUnion, + error: { message: "must match a schema in anyOf" }, +}; +exports.default = def; +//# sourceMappingURL=anyOf.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/anyOf.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/anyOf.js.map new file mode 100644 index 0000000000..537ffcbebe --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/anyOf.js.map @@ -0,0 +1 @@ +{"version":3,"file":"anyOf.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/anyOf.ts"],"names":[],"mappings":";;AACA,kCAAqC;AAIrC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE,OAAO;IACnB,WAAW,EAAE,IAAI;IACjB,IAAI,EAAE,oBAAa;IACnB,KAAK,EAAE,EAAC,OAAO,EAAE,8BAA8B,EAAC;CACjD,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/contains.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/contains.d.ts new file mode 100644 index 0000000000..5493e844f3 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/contains.d.ts @@ -0,0 +1,7 @@ +import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types"; +export type ContainsError = ErrorObject<"contains", { + minContains: number; + maxContains?: number; +}, AnySchema>; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/contains.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/contains.js new file mode 100644 index 0000000000..6c5473f5d9 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/contains.js @@ -0,0 +1,95 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const util_1 = require("../../compile/util"); +const error = { + message: ({ params: { min, max } }) => max === undefined + ? (0, codegen_1.str) `must contain at least ${min} valid item(s)` + : (0, codegen_1.str) `must contain at least ${min} and no more than ${max} valid item(s)`, + params: ({ params: { min, max } }) => max === undefined ? (0, codegen_1._) `{minContains: ${min}}` : (0, codegen_1._) `{minContains: ${min}, maxContains: ${max}}`, +}; +const def = { + keyword: "contains", + type: "array", + schemaType: ["object", "boolean"], + before: "uniqueItems", + trackErrors: true, + error, + code(cxt) { + const { gen, schema, parentSchema, data, it } = cxt; + let min; + let max; + const { minContains, maxContains } = parentSchema; + if (it.opts.next) { + min = minContains === undefined ? 1 : minContains; + max = maxContains; + } + else { + min = 1; + } + const len = gen.const("len", (0, codegen_1._) `${data}.length`); + cxt.setParams({ min, max }); + if (max === undefined && min === 0) { + (0, util_1.checkStrictMode)(it, `"minContains" == 0 without "maxContains": "contains" keyword ignored`); + return; + } + if (max !== undefined && min > max) { + (0, util_1.checkStrictMode)(it, `"minContains" > "maxContains" is always invalid`); + cxt.fail(); + return; + } + if ((0, util_1.alwaysValidSchema)(it, schema)) { + let cond = (0, codegen_1._) `${len} >= ${min}`; + if (max !== undefined) + cond = (0, codegen_1._) `${cond} && ${len} <= ${max}`; + cxt.pass(cond); + return; + } + it.items = true; + const valid = gen.name("valid"); + if (max === undefined && min === 1) { + validateItems(valid, () => gen.if(valid, () => gen.break())); + } + else if (min === 0) { + gen.let(valid, true); + if (max !== undefined) + gen.if((0, codegen_1._) `${data}.length > 0`, validateItemsWithCount); + } + else { + gen.let(valid, false); + validateItemsWithCount(); + } + cxt.result(valid, () => cxt.reset()); + function validateItemsWithCount() { + const schValid = gen.name("_valid"); + const count = gen.let("count", 0); + validateItems(schValid, () => gen.if(schValid, () => checkLimits(count))); + } + function validateItems(_valid, block) { + gen.forRange("i", 0, len, (i) => { + cxt.subschema({ + keyword: "contains", + dataProp: i, + dataPropType: util_1.Type.Num, + compositeRule: true, + }, _valid); + block(); + }); + } + function checkLimits(count) { + gen.code((0, codegen_1._) `${count}++`); + if (max === undefined) { + gen.if((0, codegen_1._) `${count} >= ${min}`, () => gen.assign(valid, true).break()); + } + else { + gen.if((0, codegen_1._) `${count} > ${max}`, () => gen.assign(valid, false).break()); + if (min === 1) + gen.assign(valid, true); + else + gen.if((0, codegen_1._) `${count} >= ${min}`, () => gen.assign(valid, true)); + } + } + }, +}; +exports.default = def; +//# sourceMappingURL=contains.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/contains.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/contains.js.map new file mode 100644 index 0000000000..4157928469 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/contains.js.map @@ -0,0 +1 @@ +{"version":3,"file":"contains.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/contains.ts"],"names":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AAC,EAAE,CAAC,IAAA,WAAC,EAAA,GAAG,KAAK,OAAO,GAAG,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC,CAAA;YACtE,CAAC;iBAAM,CAAC;gBACN,GAAG,CAAC,EAAE,CAAC,IAAA,WAAC,EAAA,GAAG,KAAK,MAAM,GAAG,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC,CAAA;gBACpE,IAAI,GAAG,KAAK,CAAC;oBAAE,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;;oBACjC,GAAG,CAAC,EAAE,CAAC,IAAA,WAAC,EAAA,GAAG,KAAK,OAAO,GAAG,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAA;YACnE,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/dependencies.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/dependencies.d.ts new file mode 100644 index 0000000000..05900e0c50 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/dependencies.d.ts @@ -0,0 +1,21 @@ +import type { CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition, SchemaMap, AnySchema } from "../../types"; +import type { KeywordCxt } from "../../compile/validate"; +export type PropertyDependencies = { + [K in string]?: string[]; +}; +export interface DependenciesErrorParams { + property: string; + missingProperty: string; + depsCount: number; + deps: string; +} +export type DependenciesError = ErrorObject<"dependencies", DependenciesErrorParams, { + [K in string]?: string[] | AnySchema; +}>; +export declare const error: KeywordErrorDefinition; +declare const def: CodeKeywordDefinition; +export declare function validatePropertyDeps(cxt: KeywordCxt, propertyDeps?: { + [K in string]?: string[]; +}): void; +export declare function validateSchemaDeps(cxt: KeywordCxt, schemaDeps?: SchemaMap): void; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/dependencies.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/dependencies.js new file mode 100644 index 0000000000..e81f86d1d9 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/dependencies.js @@ -0,0 +1,85 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.validateSchemaDeps = exports.validatePropertyDeps = exports.error = void 0; +const codegen_1 = require("../../compile/codegen"); +const util_1 = require("../../compile/util"); +const code_1 = require("../code"); +exports.error = { + message: ({ params: { property, depsCount, deps } }) => { + const property_ies = depsCount === 1 ? "property" : "properties"; + return (0, codegen_1.str) `must have ${property_ies} ${deps} when property ${property} is present`; + }, + params: ({ params: { property, depsCount, deps, missingProperty } }) => (0, codegen_1._) `{property: ${property}, + missingProperty: ${missingProperty}, + depsCount: ${depsCount}, + deps: ${deps}}`, // TODO change to reference +}; +const def = { + keyword: "dependencies", + type: "object", + schemaType: "object", + error: exports.error, + code(cxt) { + const [propDeps, schDeps] = splitDependencies(cxt); + validatePropertyDeps(cxt, propDeps); + validateSchemaDeps(cxt, schDeps); + }, +}; +function splitDependencies({ schema }) { + const propertyDeps = {}; + const schemaDeps = {}; + for (const key in schema) { + if (key === "__proto__") + continue; + const deps = Array.isArray(schema[key]) ? propertyDeps : schemaDeps; + deps[key] = schema[key]; + } + return [propertyDeps, schemaDeps]; +} +function validatePropertyDeps(cxt, propertyDeps = cxt.schema) { + const { gen, data, it } = cxt; + if (Object.keys(propertyDeps).length === 0) + return; + const missing = gen.let("missing"); + for (const prop in propertyDeps) { + const deps = propertyDeps[prop]; + if (deps.length === 0) + continue; + const hasProperty = (0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties); + cxt.setParams({ + property: prop, + depsCount: deps.length, + deps: deps.join(", "), + }); + if (it.allErrors) { + gen.if(hasProperty, () => { + for (const depProp of deps) { + (0, code_1.checkReportMissingProp)(cxt, depProp); + } + }); + } + else { + gen.if((0, codegen_1._) `${hasProperty} && (${(0, code_1.checkMissingProp)(cxt, deps, missing)})`); + (0, code_1.reportMissingProp)(cxt, missing); + gen.else(); + } + } +} +exports.validatePropertyDeps = validatePropertyDeps; +function validateSchemaDeps(cxt, schemaDeps = cxt.schema) { + const { gen, data, keyword, it } = cxt; + const valid = gen.name("valid"); + for (const prop in schemaDeps) { + if ((0, util_1.alwaysValidSchema)(it, schemaDeps[prop])) + continue; + gen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties), () => { + const schCxt = cxt.subschema({ keyword, schemaProp: prop }, valid); + cxt.mergeValidEvaluated(schCxt, valid); + }, () => gen.var(valid, true) // TODO var + ); + cxt.ok(valid); + } +} +exports.validateSchemaDeps = validateSchemaDeps; +exports.default = def; +//# sourceMappingURL=dependencies.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/dependencies.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/dependencies.js.map new file mode 100644 index 0000000000..50d7ca3486 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/dependencies.js.map @@ -0,0 +1 @@ +{"version":3,"file":"dependencies.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/dependencies.ts"],"names":[],"mappings":";;;AAQA,mDAA4C;AAC5C,6CAAoD;AACpD,kCAAmG;AAmBtF,QAAA,KAAK,GAA2B;IAC3C,OAAO,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAC,EAAC,EAAE,EAAE;QACjD,MAAM,YAAY,GAAG,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,CAAA;QAChE,OAAO,IA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,CAAC,MAAM;IACpF,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;IACpC,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAC/B,KAAK,MAAM,IAAI,IAAI,UAAU,EAAE,CAAC;QAC9B,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,UAAU,CAAC,IAAI,CAAc,CAAC;YAAE,SAAQ;QAClE,GAAG,CAAC,EAAE,CACJ,IAAA,qBAAc,EAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,EACtD,GAAG,EAAE;YACH,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC,EAAC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAC,EAAE,KAAK,CAAC,CAAA;YAChE,GAAG,CAAC,mBAAmB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;QACxC,CAAC,EACD,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,WAAW;SACvC,CAAA;QACD,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;IACf,CAAC;AACH,CAAC;AAfD,gDAeC;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/dependentSchemas.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/dependentSchemas.d.ts new file mode 100644 index 0000000000..cde2aa2700 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/dependentSchemas.d.ts @@ -0,0 +1,3 @@ +import type { CodeKeywordDefinition } from "../../types"; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/dependentSchemas.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/dependentSchemas.js new file mode 100644 index 0000000000..66ef2e843f --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/dependentSchemas.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const dependencies_1 = require("./dependencies"); +const def = { + keyword: "dependentSchemas", + type: "object", + schemaType: "object", + code: (cxt) => (0, dependencies_1.validateSchemaDeps)(cxt), +}; +exports.default = def; +//# sourceMappingURL=dependentSchemas.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/dependentSchemas.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/dependentSchemas.js.map new file mode 100644 index 0000000000..17712e6fb3 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/dependentSchemas.js.map @@ -0,0 +1 @@ +{"version":3,"file":"dependentSchemas.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/dependentSchemas.ts"],"names":[],"mappings":";;AACA,iDAAiD;AAEjD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,kBAAkB;IAC3B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,iCAAkB,EAAC,GAAG,CAAC;CACvC,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/if.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/if.d.ts new file mode 100644 index 0000000000..8f602e33fc --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/if.d.ts @@ -0,0 +1,6 @@ +import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types"; +export type IfKeywordError = ErrorObject<"if", { + failingKeyword: string; +}, AnySchema>; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/if.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/if.js new file mode 100644 index 0000000000..2c42a3e9c5 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/if.js @@ -0,0 +1,66 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const util_1 = require("../../compile/util"); +const error = { + message: ({ params }) => (0, codegen_1.str) `must match "${params.ifClause}" schema`, + params: ({ params }) => (0, codegen_1._) `{failingKeyword: ${params.ifClause}}`, +}; +const def = { + keyword: "if", + schemaType: ["object", "boolean"], + trackErrors: true, + error, + code(cxt) { + const { gen, parentSchema, it } = cxt; + if (parentSchema.then === undefined && parentSchema.else === undefined) { + (0, util_1.checkStrictMode)(it, '"if" without "then" and "else" is ignored'); + } + const hasThen = hasSchema(it, "then"); + const hasElse = hasSchema(it, "else"); + if (!hasThen && !hasElse) + return; + const valid = gen.let("valid", true); + const schValid = gen.name("_valid"); + validateIf(); + cxt.reset(); + if (hasThen && hasElse) { + const ifClause = gen.let("ifClause"); + cxt.setParams({ ifClause }); + gen.if(schValid, validateClause("then", ifClause), validateClause("else", ifClause)); + } + else if (hasThen) { + gen.if(schValid, validateClause("then")); + } + else { + gen.if((0, codegen_1.not)(schValid), validateClause("else")); + } + cxt.pass(valid, () => cxt.error(true)); + function validateIf() { + const schCxt = cxt.subschema({ + keyword: "if", + compositeRule: true, + createErrors: false, + allErrors: false, + }, schValid); + cxt.mergeEvaluated(schCxt); + } + function validateClause(keyword, ifClause) { + return () => { + const schCxt = cxt.subschema({ keyword }, schValid); + gen.assign(valid, schValid); + cxt.mergeValidEvaluated(schCxt, valid); + if (ifClause) + gen.assign(ifClause, (0, codegen_1._) `${keyword}`); + else + cxt.setParams({ ifClause: keyword }); + }; + } + }, +}; +function hasSchema(it, keyword) { + const schema = it.schema[keyword]; + return schema !== undefined && !(0, util_1.alwaysValidSchema)(it, schema); +} +exports.default = def; +//# sourceMappingURL=if.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/if.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/if.js.map new file mode 100644 index 0000000000..54efb1dcc9 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/if.js.map @@ -0,0 +1 @@ +{"version":3,"file":"if.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/if.ts"],"names":[],"mappings":";;AAQA,mDAAuD;AACvD,6CAAqE;AAIrE,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,IAAA,aAAG,EAAA,eAAe,MAAM,CAAC,QAAQ,UAAU;IAClE,MAAM,EAAE,CAAC,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,oBAAoB,MAAM,CAAC,QAAQ,GAAG;CAC9D,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,IAAI;IACb,UAAU,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;IACjC,WAAW,EAAE,IAAI;IACjB,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,YAAY,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACnC,IAAI,YAAY,CAAC,IAAI,KAAK,SAAS,IAAI,YAAY,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YACvE,IAAA,sBAAe,EAAC,EAAE,EAAE,2CAA2C,CAAC,CAAA;QAClE,CAAC;QACD,MAAM,OAAO,GAAG,SAAS,CAAC,EAAE,EAAE,MAAM,CAAC,CAAA;QACrC,MAAM,OAAO,GAAG,SAAS,CAAC,EAAE,EAAE,MAAM,CAAC,CAAA;QACrC,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO;YAAE,OAAM;QAEhC,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC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AQ,CAAC,CAAA;gBACjD,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;gBAC3B,GAAG,CAAC,mBAAmB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;gBACtC,IAAI,QAAQ;oBAAE,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAA,WAAC,EAAA,GAAG,OAAO,EAAE,CAAC,CAAA;;oBAC5C,GAAG,CAAC,SAAS,CAAC,EAAC,QAAQ,EAAE,OAAO,EAAC,CAAC,CAAA;YACzC,CAAC,CAAA;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,SAAS,SAAS,CAAC,EAAgB,EAAE,OAAe;IAClD,MAAM,MAAM,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;IACjC,OAAO,MAAM,KAAK,SAAS,IAAI,CAAC,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC,CAAA;AAC/D,CAAC;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/index.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/index.d.ts new file mode 100644 index 0000000000..b9cc5f5c89 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/index.d.ts @@ -0,0 +1,13 @@ +import type { ErrorNoParams, Vocabulary } from "../../types"; +import { AdditionalItemsError } from "./additionalItems"; +import { ItemsError } from "./items2020"; +import { ContainsError } from "./contains"; +import { DependenciesError } from "./dependencies"; +import { PropertyNamesError } from "./propertyNames"; +import { AdditionalPropertiesError } from "./additionalProperties"; +import { NotKeywordError } from "./not"; +import { AnyOfError } from "./anyOf"; +import { OneOfError } from "./oneOf"; +import { IfKeywordError } from "./if"; +export default function getApplicator(draft2020?: boolean): Vocabulary; +export type ApplicatorKeywordError = ErrorNoParams<"false schema"> | AdditionalItemsError | ItemsError | ContainsError | AdditionalPropertiesError | DependenciesError | IfKeywordError | AnyOfError | OneOfError | NotKeywordError | PropertyNamesError; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/index.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/index.js new file mode 100644 index 0000000000..cf592f2795 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/index.js @@ -0,0 +1,44 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const additionalItems_1 = require("./additionalItems"); +const prefixItems_1 = require("./prefixItems"); +const items_1 = require("./items"); +const items2020_1 = require("./items2020"); +const contains_1 = require("./contains"); +const dependencies_1 = require("./dependencies"); +const propertyNames_1 = require("./propertyNames"); +const additionalProperties_1 = require("./additionalProperties"); +const properties_1 = require("./properties"); +const patternProperties_1 = require("./patternProperties"); +const not_1 = require("./not"); +const anyOf_1 = require("./anyOf"); +const oneOf_1 = require("./oneOf"); +const allOf_1 = require("./allOf"); +const if_1 = require("./if"); +const thenElse_1 = require("./thenElse"); +function getApplicator(draft2020 = false) { + const applicator = [ + // any + not_1.default, + anyOf_1.default, + oneOf_1.default, + allOf_1.default, + if_1.default, + thenElse_1.default, + // object + propertyNames_1.default, + additionalProperties_1.default, + dependencies_1.default, + properties_1.default, + patternProperties_1.default, + ]; + // array + if (draft2020) + applicator.push(prefixItems_1.default, items2020_1.default); + else + applicator.push(additionalItems_1.default, items_1.default); + applicator.push(contains_1.default); + return applicator; +} +exports.default = getApplicator; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/index.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/index.js.map new file mode 100644 index 0000000000..ebcb8534d5 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/index.ts"],"names":[],"mappings":";;AACA,uDAAuE;AACvE,+CAAuC;AACvC,mCAA2B;AAC3B,2CAAiD;AACjD,yCAAkD;AAClD,iDAA8D;AAC9D,mDAAiE;AACjE,iEAAsF;AACtF,6CAAqC;AACrC,2DAAmD;AACnD,+BAAiD;AACjD,mCAAyC;AACzC,mCAAyC;AACzC,mCAA2B;AAC3B,6BAA8C;AAC9C,yCAAiC;AAEjC,SAAwB,aAAa,CAAC,SAAS,GAAG,KAAK;IACrD,MAAM,UAAU,GAAG;QACjB,MAAM;QACN,aAAU;QACV,eAAK;QACL,eAAK;QACL,eAAK;QACL,YAAS;QACT,kBAAQ;QACR,SAAS;QACT,uBAAa;QACb,8BAAoB;QACpB,sBAAY;QACZ,oBAAU;QACV,2BAAiB;KAClB,CAAA;IACD,QAAQ;IACR,IAAI,SAAS;QAAE,UAAU,CAAC,IAAI,CAAC,qBAAW,EAAE,mBAAS,CAAC,CAAA;;QACjD,UAAU,CAAC,IAAI,CAAC,yBAAe,EAAE,eAAK,CAAC,CAAA;IAC5C,UAAU,CAAC,IAAI,CAAC,kBAAQ,CAAC,CAAA;IACzB,OAAO,UAAU,CAAA;AACnB,CAAC;AArBD,gCAqBC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/items.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/items.d.ts new file mode 100644 index 0000000000..8e608ca9c4 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/items.d.ts @@ -0,0 +1,5 @@ +import type { CodeKeywordDefinition, AnySchema } from "../../types"; +import type { KeywordCxt } from "../../compile/validate"; +declare const def: CodeKeywordDefinition; +export declare function validateTuple(cxt: KeywordCxt, extraItems: string, schArr?: AnySchema[]): void; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/items.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/items.js new file mode 100644 index 0000000000..26f527bc69 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/items.js @@ -0,0 +1,52 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.validateTuple = void 0; +const codegen_1 = require("../../compile/codegen"); +const util_1 = require("../../compile/util"); +const code_1 = require("../code"); +const def = { + keyword: "items", + type: "array", + schemaType: ["object", "array", "boolean"], + before: "uniqueItems", + code(cxt) { + const { schema, it } = cxt; + if (Array.isArray(schema)) + return validateTuple(cxt, "additionalItems", schema); + it.items = true; + if ((0, util_1.alwaysValidSchema)(it, schema)) + return; + cxt.ok((0, code_1.validateArray)(cxt)); + }, +}; +function validateTuple(cxt, extraItems, schArr = cxt.schema) { + const { gen, parentSchema, data, keyword, it } = cxt; + checkStrictTuple(parentSchema); + if (it.opts.unevaluated && schArr.length && it.items !== true) { + it.items = util_1.mergeEvaluated.items(gen, schArr.length, it.items); + } + const valid = gen.name("valid"); + const len = gen.const("len", (0, codegen_1._) `${data}.length`); + schArr.forEach((sch, i) => { + if ((0, util_1.alwaysValidSchema)(it, sch)) + return; + gen.if((0, codegen_1._) `${len} > ${i}`, () => cxt.subschema({ + keyword, + schemaProp: i, + dataProp: i, + }, valid)); + cxt.ok(valid); + }); + function checkStrictTuple(sch) { + const { opts, errSchemaPath } = it; + const l = schArr.length; + const fullTuple = l === sch.minItems && (l === sch.maxItems || sch[extraItems] === false); + if (opts.strictTuples && !fullTuple) { + const msg = `"${keyword}" is ${l}-tuple, but minItems or maxItems/${extraItems} are not specified or different at path "${errSchemaPath}"`; + (0, util_1.checkStrictMode)(it, msg, opts.strictTuples); + } + } +} +exports.validateTuple = validateTuple; +exports.default = def; +//# sourceMappingURL=items.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/items.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/items.js.map new file mode 100644 index 0000000000..ef55118790 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/items.js.map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ocabularies/applicator/items2020.d.ts new file mode 100644 index 0000000000..a2565b2c2b --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/items2020.d.ts @@ -0,0 +1,6 @@ +import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types"; +export type ItemsError = ErrorObject<"items", { + limit: number; +}, AnySchema>; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/items2020.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/items2020.js new file mode 100644 index 0000000000..f2387d7d20 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/items2020.js @@ -0,0 +1,30 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const util_1 = require("../../compile/util"); +const code_1 = require("../code"); +const additionalItems_1 = require("./additionalItems"); +const error = { + message: ({ params: { len } }) => (0, codegen_1.str) `must NOT have more than ${len} items`, + params: ({ params: { len } }) => (0, codegen_1._) `{limit: ${len}}`, +}; +const def = { + keyword: "items", + type: "array", + schemaType: ["object", "boolean"], + before: "uniqueItems", + error, + code(cxt) { + const { schema, parentSchema, it } = cxt; + const { prefixItems } = parentSchema; + it.items = true; + if ((0, util_1.alwaysValidSchema)(it, schema)) + return; + if (prefixItems) + (0, additionalItems_1.validateAdditionalItems)(cxt, prefixItems); + else + cxt.ok((0, code_1.validateArray)(cxt)); + }, +}; +exports.default = def; +//# sourceMappingURL=items2020.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/items2020.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/items2020.js.map new file mode 100644 index 0000000000..5034acda65 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/items2020.js.map @@ -0,0 +1 @@ +{"version":3,"file":"items2020.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/items2020.ts"],"names":[],"mappings":";;AAOA,mDAA4C;AAC5C,6CAAoD;AACpD,kCAAqC;AACrC,uDAAyD;AAIzD,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,GAAG,EAAC,EAAC,EAAE,EAAE,CAAC,IAAA,aAAG,EAAA,2BAA2B,GAAG,QAAQ;IACvE,MAAM,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,GAAG,EAAC,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,WAAW,GAAG,GAAG;CAChD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,OAAO;IAChB,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;IACjC,MAAM,EAAE,aAAa;IACrB,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,MAAM,EAAE,YAAY,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACtC,MAAM,EAAC,WAAW,EAAC,GAAG,YAAY,CAAA;QAClC,EAAE,CAAC,KAAK,GAAG,IAAI,CAAA;QACf,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC;YAAE,OAAM;QACzC,IAAI,WAAW;YAAE,IAAA,yCAAuB,EAAC,GAAG,EAAE,WAAW,CAAC,CAAA;;YACrD,GAAG,CAAC,EAAE,CAAC,IAAA,oBAAa,EAAC,GAAG,CAAC,CAAC,CAAA;IACjC,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/not.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/not.d.ts new file mode 100644 index 0000000000..d2f4888f3d --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/not.d.ts @@ -0,0 +1,4 @@ +import type { CodeKeywordDefinition, ErrorNoParams, AnySchema } from "../../types"; +export type NotKeywordError = ErrorNoParams<"not", AnySchema>; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/not.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/not.js new file mode 100644 index 0000000000..89f6fddacf --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/not.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const util_1 = require("../../compile/util"); +const def = { + keyword: "not", + schemaType: ["object", "boolean"], + trackErrors: true, + code(cxt) { + const { gen, schema, it } = cxt; + if ((0, util_1.alwaysValidSchema)(it, schema)) { + cxt.fail(); + return; + } + const valid = gen.name("valid"); + cxt.subschema({ + keyword: "not", + compositeRule: true, + createErrors: false, + allErrors: false, + }, valid); + cxt.failResult(valid, () => cxt.reset(), () => cxt.error()); + }, + error: { message: "must NOT be valid" }, +}; +exports.default = def; +//# sourceMappingURL=not.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/not.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/not.js.map new file mode 100644 index 0000000000..d99e6ea87a --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/not.js.map @@ -0,0 +1 @@ +{"version":3,"file":"not.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/not.ts"],"names":[],"mappings":";;AAEA,6CAAoD;AAIpD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,KAAK;IACd,UAAU,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;IACjC,WAAW,EAAE,IAAI;IACjB,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QAC7B,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC;YAClC,GAAG,CAAC,IAAI,EAAE,CAAA;YACV,OAAM;QACR,CAAC;QAED,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC/B,GAAG,CAAC,SAAS,CACX;YACE,OAAO,EAAE,KAAK;YACd,aAAa,EAAE,IAAI;YACnB,YAAY,EAAE,KAAK;YACnB,SAAS,EAAE,KAAK;SACjB,EACD,KAAK,CACN,CAAA;QAED,GAAG,CAAC,UAAU,CACZ,KAAK,EACL,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,EACjB,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAClB,CAAA;IACH,CAAC;IACD,KAAK,EAAE,EAAC,OAAO,EAAE,mBAAmB,EAAC;CACtC,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/oneOf.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/oneOf.d.ts new file mode 100644 index 0000000000..1e1d34f725 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/oneOf.d.ts @@ -0,0 +1,6 @@ +import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types"; +export type OneOfError = ErrorObject<"oneOf", { + passingSchemas: [number, number] | null; +}, AnySchema[]>; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/oneOf.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/oneOf.js new file mode 100644 index 0000000000..441db2ac0b --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/oneOf.js @@ -0,0 +1,60 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const util_1 = require("../../compile/util"); +const error = { + message: "must match exactly one schema in oneOf", + params: ({ params }) => (0, codegen_1._) `{passingSchemas: ${params.passing}}`, +}; +const def = { + keyword: "oneOf", + schemaType: "array", + trackErrors: true, + error, + code(cxt) { + const { gen, schema, parentSchema, it } = cxt; + /* istanbul ignore if */ + if (!Array.isArray(schema)) + throw new Error("ajv implementation error"); + if (it.opts.discriminator && parentSchema.discriminator) + return; + const schArr = schema; + const valid = gen.let("valid", false); + const passing = gen.let("passing", null); + const schValid = gen.name("_valid"); + cxt.setParams({ passing }); + // TODO possibly fail straight away (with warning or exception) if there are two empty always valid schemas + gen.block(validateOneOf); + cxt.result(valid, () => cxt.reset(), () => cxt.error(true)); + function validateOneOf() { + schArr.forEach((sch, i) => { + let schCxt; + if ((0, util_1.alwaysValidSchema)(it, sch)) { + gen.var(schValid, true); + } + else { + schCxt = cxt.subschema({ + keyword: "oneOf", + schemaProp: i, + compositeRule: true, + }, schValid); + } + if (i > 0) { + gen + .if((0, codegen_1._) `${schValid} && ${valid}`) + .assign(valid, false) + .assign(passing, (0, codegen_1._) `[${passing}, ${i}]`) + .else(); + } + gen.if(schValid, () => { + gen.assign(valid, true); + gen.assign(passing, i); + if (schCxt) + cxt.mergeEvaluated(schCxt, codegen_1.Name); + }); + }); + } + }, +}; +exports.default = def; +//# sourceMappingURL=oneOf.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/oneOf.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/oneOf.js.map new file mode 100644 index 0000000000..13b8bfe9f1 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/oneOf.js.map @@ -0,0 +1 @@ +{"version":3,"file":"oneOf.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/oneOf.ts"],"names":[],"mappings":";;AAOA,mDAA6C;AAC7C,6CAAoD;AASpD,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,wCAAwC;IACjD,MAAM,EAAE,CAAC,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,oBAA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C,CAAA;gBACzB,CAAC;qBAAM,CAAC;oBACN,MAAM,GAAG,GAAG,CAAC,SAAS,CACpB;wBACE,OAAO,EAAE,OAAO;wBAChB,UAAU,EAAE,CAAC;wBACb,aAAa,EAAE,IAAI;qBACpB,EACD,QAAQ,CACT,CAAA;gBACH,CAAC;gBAED,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;oBACV,GAAG;yBACA,EAAE,CAAC,IAAA,WAAC,EAAA,GAAG,QAAQ,OAAO,KAAK,EAAE,CAAC;yBAC9B,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC;yBACpB,MAAM,CAAC,OAAO,EAAE,IAAA,WAAC,EAAA,IAAI,OAAO,KAAK,CAAC,GAAG,CAAC;yBACtC,IAAI,EAAE,CAAA;gBACX,CAAC;gBAED,GAAG,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;oBACpB,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;oBACvB,GAAG,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,CAAA;oBACtB,IAAI,MAAM;wBAAE,GAAG,CAAC,cAAc,CAAC,MAAM,EAAE,cAAI,CAAC,CAAA;gBAC9C,CAAC,CAAC,CAAA;YACJ,CAAC,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/patternProperties.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/patternProperties.d.ts new file mode 100644 index 0000000000..cde2aa2700 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/patternProperties.d.ts @@ -0,0 +1,3 @@ +import type { CodeKeywordDefinition } from "../../types"; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/patternProperties.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/patternProperties.js new file mode 100644 index 0000000000..48501c6e33 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/patternProperties.js @@ -0,0 +1,75 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const code_1 = require("../code"); +const codegen_1 = require("../../compile/codegen"); +const util_1 = require("../../compile/util"); +const util_2 = require("../../compile/util"); +const def = { + keyword: "patternProperties", + type: "object", + schemaType: "object", + code(cxt) { + const { gen, schema, data, parentSchema, it } = cxt; + const { opts } = it; + const patterns = (0, code_1.allSchemaProperties)(schema); + const alwaysValidPatterns = patterns.filter((p) => (0, util_1.alwaysValidSchema)(it, schema[p])); + if (patterns.length === 0 || + (alwaysValidPatterns.length === patterns.length && + (!it.opts.unevaluated || it.props === true))) { + return; + } + const checkProperties = opts.strictSchema && !opts.allowMatchingProperties && parentSchema.properties; + const valid = gen.name("valid"); + if (it.props !== true && !(it.props instanceof codegen_1.Name)) { + it.props = (0, util_2.evaluatedPropsToName)(gen, it.props); + } + const { props } = it; + validatePatternProperties(); + function validatePatternProperties() { + for (const pat of patterns) { + if (checkProperties) + checkMatchingProperties(pat); + if (it.allErrors) { + validateProperties(pat); + } + else { + gen.var(valid, true); // TODO var + validateProperties(pat); + gen.if(valid); + } + } + } + function checkMatchingProperties(pat) { + for (const prop in checkProperties) { + if (new RegExp(pat).test(prop)) { + (0, util_1.checkStrictMode)(it, `property ${prop} matches pattern ${pat} (use allowMatchingProperties)`); + } + } + } + function validateProperties(pat) { + gen.forIn("key", data, (key) => { + gen.if((0, codegen_1._) `${(0, code_1.usePattern)(cxt, pat)}.test(${key})`, () => { + const alwaysValid = alwaysValidPatterns.includes(pat); + if (!alwaysValid) { + cxt.subschema({ + keyword: "patternProperties", + schemaProp: pat, + dataProp: key, + dataPropType: util_2.Type.Str, + }, valid); + } + if (it.opts.unevaluated && props !== true) { + gen.assign((0, codegen_1._) `${props}[${key}]`, true); + } + else if (!alwaysValid && !it.allErrors) { + // can short-circuit if `unevaluatedProperties` is not supported (opts.next === false) + // or if all properties were evaluated (props === true) + gen.if((0, codegen_1.not)(valid), () => gen.break()); + } + }); + }); + } + }, +}; +exports.default = def; +//# sourceMappingURL=patternProperties.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/patternProperties.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/patternProperties.js.map new file mode 100644 index 0000000000..231b08164b --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/patternProperties.js.map @@ -0,0 +1 @@ +{"version":3,"file":"patternProperties.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/patternProperties.ts"],"names":[],"mappings":";;AAEA,kCAAuD;AACvD,mDAAkD;AAClD,6CAAqE;AACrE,6CAA6D;AAG7D,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,mBAAmB;IAC5B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACjD,MAAM,EAAC,IAAI,EAAC,GAAG,EAAE,CAAA;QACjB,MAAM,QAAQ,GAAG,IAAA,0BAAmB,EAAC,MAAM,CAAC,CAAA;QAC5C,MAAM,mBAAmB,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAChD,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CAAc,CAAC,CAC9C,CAAA;QAED,IACE,QAAQ,CAAC,MAAM,KAAK,CAAC;YACrB,CAAC,mBAAmB,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM;gBAC7C,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,IAAI,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,EAC9C,CAAC;YACD,OAAM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,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE;gBAC7B,GAAG,CAAC,EAAE,CAAC,IAAA,WAAC,EAAA,GAAG,IAAA,iBAAU,EAAC,GAAG,EAAE,GAAG,CAAC,SAAS,GAAG,GAAG,EAAE,GAAG,EAAE;oBACnD,MAAM,WAAW,GAAG,mBAAmB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;oBACrD,IAAI,CAAC,WAAW,EAAE,CAAC;wBACjB,GAAG,CAAC,SAAS,CACX;4BACE,OAAO,EAAE,mBAAmB;4BAC5B,UAAU,EAAE,GAAG;4BACf,QAAQ,EAAE,GAAG;4BACb,YAAY,EAAE,WAAI,CAAC,GAAG;yBACvB,EACD,KAAK,CACN,CAAA;oBACH,CAAC;oBAED,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;wBAC1C,GAAG,CAAC,MAAM,CAAC,IAAA,WAAC,EAAA,GAAG,KAAK,IAAI,GAAG,GAAG,EAAE,IAAI,CAAC,CAAA;oBACvC,CAAC;yBAAM,IAAI,CAAC,WAAW,IAAI,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC;wBACzC,sFAAsF;wBACtF,uDAAuD;wBACvD,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAA;oBACvC,CAAC;gBACH,CAAC,CAAC,CAAA;YACJ,CAAC,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/prefixItems.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/prefixItems.d.ts new file mode 100644 index 0000000000..cde2aa2700 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/prefixItems.d.ts @@ -0,0 +1,3 @@ +import type { CodeKeywordDefinition } from "../../types"; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/prefixItems.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/prefixItems.js new file mode 100644 index 0000000000..727bc23ce0 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/prefixItems.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const items_1 = require("./items"); +const def = { + keyword: "prefixItems", + type: "array", + schemaType: ["array"], + before: "uniqueItems", + code: (cxt) => (0, items_1.validateTuple)(cxt, "items"), +}; +exports.default = def; +//# sourceMappingURL=prefixItems.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/prefixItems.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/prefixItems.js.map new file mode 100644 index 0000000000..deef718e6e --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/prefixItems.js.map @@ -0,0 +1 @@ +{"version":3,"file":"prefixItems.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/prefixItems.ts"],"names":[],"mappings":";;AACA,mCAAqC;AAErC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,aAAa;IACtB,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,CAAC,OAAO,CAAC;IACrB,MAAM,EAAE,aAAa;IACrB,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,qBAAa,EAAC,GAAG,EAAE,OAAO,CAAC;CAC3C,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/properties.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/properties.d.ts new file mode 100644 index 0000000000..cde2aa2700 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/properties.d.ts @@ -0,0 +1,3 @@ +import type { CodeKeywordDefinition } from "../../types"; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/properties.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/properties.js new file mode 100644 index 0000000000..7347358e29 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/properties.js @@ -0,0 +1,54 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const validate_1 = require("../../compile/validate"); +const code_1 = require("../code"); +const util_1 = require("../../compile/util"); +const additionalProperties_1 = require("./additionalProperties"); +const def = { + keyword: "properties", + type: "object", + schemaType: "object", + code(cxt) { + const { gen, schema, parentSchema, data, it } = cxt; + if (it.opts.removeAdditional === "all" && parentSchema.additionalProperties === undefined) { + additionalProperties_1.default.code(new validate_1.KeywordCxt(it, additionalProperties_1.default, "additionalProperties")); + } + const allProps = (0, code_1.allSchemaProperties)(schema); + for (const prop of allProps) { + it.definedProperties.add(prop); + } + if (it.opts.unevaluated && allProps.length && it.props !== true) { + it.props = util_1.mergeEvaluated.props(gen, (0, util_1.toHash)(allProps), it.props); + } + const properties = allProps.filter((p) => !(0, util_1.alwaysValidSchema)(it, schema[p])); + if (properties.length === 0) + return; + const valid = gen.name("valid"); + for (const prop of properties) { + if (hasDefault(prop)) { + applyPropertySchema(prop); + } + else { + gen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties)); + applyPropertySchema(prop); + if (!it.allErrors) + gen.else().var(valid, true); + gen.endIf(); + } + cxt.it.definedProperties.add(prop); + cxt.ok(valid); + } + function hasDefault(prop) { + return it.opts.useDefaults && !it.compositeRule && schema[prop].default !== undefined; + } + function applyPropertySchema(prop) { + cxt.subschema({ + keyword: "properties", + schemaProp: prop, + dataProp: prop, + }, valid); + } + }, +}; +exports.default = def; +//# sourceMappingURL=properties.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/properties.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/properties.js.map new file mode 100644 index 0000000000..13cd34774c --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/properties.js.map @@ -0,0 +1 @@ +{"version":3,"file":"properties.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/properties.ts"],"names":[],"mappings":";;AACA,qDAAiD;AACjD,kCAA2D;AAC3D,6CAA4E;AAC5E,iEAA0C;AAE1C,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,YAAY;IACrB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACjD,IAAI,EAAE,CAAC,IAAI,CAAC,gBAAgB,KAAK,KAAK,IAAI,YAAY,CAAC,oBAAoB,KAAK,SAAS,EAAE,CAAC;YAC1F,8BAAK,CAAC,IAAI,CAAC,IAAI,qBAAU,CAAC,EAAE,EAAE,8BAAK,EAAE,sBAAsB,CAAC,CAAC,CAAA;QAC/D,CAAC;QACD,MAAM,QAAQ,GAAG,IAAA,0BAAmB,EAAC,MAAM,CAAC,CAAA;QAC5C,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;YAC5B,EAAE,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QAChC,CAAC;QACD,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,IAAI,QAAQ,CAAC,MAAM,IAAI,EAAE,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;YAChE,EAAE,CAAC,KAAK,GAAG,qBAAc,CAAC,KAAK,CAAC,GAAG,EAAE,IAAA,aAAM,EAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,KAAK,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,QAAQ,EAAE,IAAI;aACf,EACD,KAAK,CACN,CAAA;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/propertyNames.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/propertyNames.d.ts new file mode 100644 index 0000000000..a806da32f0 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/propertyNames.d.ts @@ -0,0 +1,6 @@ +import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types"; +export type PropertyNamesError = ErrorObject<"propertyNames", { + propertyName: string; +}, AnySchema>; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/propertyNames.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/propertyNames.js new file mode 100644 index 0000000000..f3871152de --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/propertyNames.js @@ -0,0 +1,38 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const util_1 = require("../../compile/util"); +const error = { + message: "property name must be valid", + params: ({ params }) => (0, codegen_1._) `{propertyName: ${params.propertyName}}`, +}; +const def = { + keyword: "propertyNames", + type: "object", + schemaType: ["object", "boolean"], + error, + code(cxt) { + const { gen, schema, data, it } = cxt; + if ((0, util_1.alwaysValidSchema)(it, schema)) + return; + const valid = gen.name("valid"); + gen.forIn("key", data, (key) => { + cxt.setParams({ propertyName: key }); + cxt.subschema({ + keyword: "propertyNames", + data: key, + dataTypes: ["string"], + propertyName: key, + compositeRule: true, + }, valid); + gen.if((0, codegen_1.not)(valid), () => { + cxt.error(true); + if (!it.allErrors) + gen.break(); + }); + }); + cxt.ok(valid); + }, +}; +exports.default = def; +//# sourceMappingURL=propertyNames.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/propertyNames.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/propertyNames.js.map new file mode 100644 index 0000000000..835b2bb132 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/propertyNames.js.map @@ -0,0 +1 @@ +{"version":3,"file":"propertyNames.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/propertyNames.ts"],"names":[],"mappings":";;AAOA,mDAA4C;AAC5C,6CAAoD;AAIpD,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,6BAA6B;IACtC,MAAM,EAAE,CAAC,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,kBAAkB,MAAM,CAAC,YAAY,GAAG;CAChE,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,eAAe;IACxB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;IACjC,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACnC,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC;YAAE,OAAM;QACzC,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAE/B,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE;YAC7B,GAAG,CAAC,SAAS,CAAC,EAAC,YAAY,EAAE,GAAG,EAAC,CAAC,CAAA;YAClC,GAAG,CAAC,SAAS,CACX;gBACE,OAAO,EAAE,eAAe;gBACxB,IAAI,EAAE,GAAG;gBACT,SAAS,EAAE,CAAC,QAAQ,CAAC;gBACrB,YAAY,EAAE,GAAG;gBACjB,aAAa,EAAE,IAAI;aACpB,EACD,KAAK,CACN,CAAA;YACD,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,EAAE,GAAG,EAAE;gBACtB,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;gBACf,IAAI,CAAC,EAAE,CAAC,SAAS;oBAAE,GAAG,CAAC,KAAK,EAAE,CAAA;YAChC,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;QAEF,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;IACf,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/thenElse.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/thenElse.d.ts new file mode 100644 index 0000000000..cde2aa2700 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/thenElse.d.ts @@ -0,0 +1,3 @@ +import type { CodeKeywordDefinition } from "../../types"; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/thenElse.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/thenElse.js new file mode 100644 index 0000000000..1ae6390215 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/thenElse.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const util_1 = require("../../compile/util"); +const def = { + keyword: ["then", "else"], + schemaType: ["object", "boolean"], + code({ keyword, parentSchema, it }) { + if (parentSchema.if === undefined) + (0, util_1.checkStrictMode)(it, `"${keyword}" without "if" is ignored`); + }, +}; +exports.default = def; +//# sourceMappingURL=thenElse.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/thenElse.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/thenElse.js.map new file mode 100644 index 0000000000..2629f4fce0 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/applicator/thenElse.js.map @@ -0,0 +1 @@ +{"version":3,"file":"thenElse.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/thenElse.ts"],"names":[],"mappings":";;AAEA,6CAAkD;AAElD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;IACjC,IAAI,CAAC,EAAC,OAAO,EAAE,YAAY,EAAE,EAAE,EAAa;QAC1C,IAAI,YAAY,CAAC,EAAE,KAAK,SAAS;YAAE,IAAA,sBAAe,EAAC,EAAE,EAAE,IAAI,OAAO,2BAA2B,CAAC,CAAA;IAChG,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/code.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/code.d.ts new file mode 100644 index 0000000000..f914baca5c --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/code.d.ts @@ -0,0 +1,17 @@ +import type { SchemaMap } from "../types"; +import type { SchemaCxt } from "../compile"; +import type { KeywordCxt } from "../compile/validate"; +import { CodeGen, Code, Name } from "../compile/codegen"; +export declare function checkReportMissingProp(cxt: KeywordCxt, prop: string): void; +export declare function checkMissingProp({ gen, data, it: { opts } }: KeywordCxt, properties: string[], missing: Name): Code; +export declare function reportMissingProp(cxt: KeywordCxt, missing: Name): void; +export declare function hasPropFunc(gen: CodeGen): Name; +export declare function isOwnProperty(gen: CodeGen, data: Name, property: Name | string): Code; +export declare function propertyInData(gen: CodeGen, data: Name, property: Name | string, ownProperties?: boolean): Code; +export declare function noPropertyInData(gen: CodeGen, data: Name, property: Name | string, ownProperties?: boolean): Code; +export declare function allSchemaProperties(schemaMap?: SchemaMap): string[]; +export declare function schemaProperties(it: SchemaCxt, schemaMap: SchemaMap): string[]; +export declare function callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }: KeywordCxt, func: Code, context: Code, passSchema?: boolean): Code; +export declare function usePattern({ gen, it: { opts } }: KeywordCxt, pattern: string): Name; +export declare function validateArray(cxt: KeywordCxt): Name; +export declare function validateUnion(cxt: KeywordCxt): void; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/code.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/code.js new file mode 100644 index 0000000000..8cb899324c --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/code.js @@ -0,0 +1,131 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.validateUnion = exports.validateArray = exports.usePattern = exports.callValidateCode = exports.schemaProperties = exports.allSchemaProperties = exports.noPropertyInData = exports.propertyInData = exports.isOwnProperty = exports.hasPropFunc = exports.reportMissingProp = exports.checkMissingProp = exports.checkReportMissingProp = void 0; +const codegen_1 = require("../compile/codegen"); +const util_1 = require("../compile/util"); +const names_1 = require("../compile/names"); +const util_2 = require("../compile/util"); +function checkReportMissingProp(cxt, prop) { + const { gen, data, it } = cxt; + gen.if(noPropertyInData(gen, data, prop, it.opts.ownProperties), () => { + cxt.setParams({ missingProperty: (0, codegen_1._) `${prop}` }, true); + cxt.error(); + }); +} +exports.checkReportMissingProp = checkReportMissingProp; +function checkMissingProp({ gen, data, it: { opts } }, properties, missing) { + return (0, codegen_1.or)(...properties.map((prop) => (0, codegen_1.and)(noPropertyInData(gen, data, prop, opts.ownProperties), (0, codegen_1._) `${missing} = ${prop}`))); +} +exports.checkMissingProp = checkMissingProp; +function reportMissingProp(cxt, missing) { + cxt.setParams({ missingProperty: missing }, true); + cxt.error(); +} +exports.reportMissingProp = reportMissingProp; +function hasPropFunc(gen) { + return gen.scopeValue("func", { + // eslint-disable-next-line @typescript-eslint/unbound-method + ref: Object.prototype.hasOwnProperty, + code: (0, codegen_1._) `Object.prototype.hasOwnProperty`, + }); +} +exports.hasPropFunc = hasPropFunc; +function isOwnProperty(gen, data, property) { + return (0, codegen_1._) `${hasPropFunc(gen)}.call(${data}, ${property})`; +} +exports.isOwnProperty = isOwnProperty; +function propertyInData(gen, data, property, ownProperties) { + const cond = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(property)} !== undefined`; + return ownProperties ? (0, codegen_1._) `${cond} && ${isOwnProperty(gen, data, property)}` : cond; +} +exports.propertyInData = propertyInData; +function noPropertyInData(gen, data, property, ownProperties) { + const cond = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(property)} === undefined`; + return ownProperties ? (0, codegen_1.or)(cond, (0, codegen_1.not)(isOwnProperty(gen, data, property))) : cond; +} +exports.noPropertyInData = noPropertyInData; +function allSchemaProperties(schemaMap) { + return schemaMap ? Object.keys(schemaMap).filter((p) => p !== "__proto__") : []; +} +exports.allSchemaProperties = allSchemaProperties; +function schemaProperties(it, schemaMap) { + return allSchemaProperties(schemaMap).filter((p) => !(0, util_1.alwaysValidSchema)(it, schemaMap[p])); +} +exports.schemaProperties = schemaProperties; +function callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }, func, context, passSchema) { + const dataAndSchema = passSchema ? (0, codegen_1._) `${schemaCode}, ${data}, ${topSchemaRef}${schemaPath}` : data; + const valCxt = [ + [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, errorPath)], + [names_1.default.parentData, it.parentData], + [names_1.default.parentDataProperty, it.parentDataProperty], + [names_1.default.rootData, names_1.default.rootData], + ]; + if (it.opts.dynamicRef) + valCxt.push([names_1.default.dynamicAnchors, names_1.default.dynamicAnchors]); + const args = (0, codegen_1._) `${dataAndSchema}, ${gen.object(...valCxt)}`; + return context !== codegen_1.nil ? (0, codegen_1._) `${func}.call(${context}, ${args})` : (0, codegen_1._) `${func}(${args})`; +} +exports.callValidateCode = callValidateCode; +const newRegExp = (0, codegen_1._) `new RegExp`; +function usePattern({ gen, it: { opts } }, pattern) { + const u = opts.unicodeRegExp ? "u" : ""; + const { regExp } = opts.code; + const rx = regExp(pattern, u); + return gen.scopeValue("pattern", { + key: rx.toString(), + ref: rx, + code: (0, codegen_1._) `${regExp.code === "new RegExp" ? newRegExp : (0, util_2.useFunc)(gen, regExp)}(${pattern}, ${u})`, + }); +} +exports.usePattern = usePattern; +function validateArray(cxt) { + const { gen, data, keyword, it } = cxt; + const valid = gen.name("valid"); + if (it.allErrors) { + const validArr = gen.let("valid", true); + validateItems(() => gen.assign(validArr, false)); + return validArr; + } + gen.var(valid, true); + validateItems(() => gen.break()); + return valid; + function validateItems(notValid) { + const len = gen.const("len", (0, codegen_1._) `${data}.length`); + gen.forRange("i", 0, len, (i) => { + cxt.subschema({ + keyword, + dataProp: i, + dataPropType: util_1.Type.Num, + }, valid); + gen.if((0, codegen_1.not)(valid), notValid); + }); + } +} +exports.validateArray = validateArray; +function validateUnion(cxt) { + const { gen, schema, keyword, it } = cxt; + /* istanbul ignore if */ + if (!Array.isArray(schema)) + throw new Error("ajv implementation error"); + const alwaysValid = schema.some((sch) => (0, util_1.alwaysValidSchema)(it, sch)); + if (alwaysValid && !it.opts.unevaluated) + return; + const valid = gen.let("valid", false); + const schValid = gen.name("_valid"); + gen.block(() => schema.forEach((_sch, i) => { + const schCxt = cxt.subschema({ + keyword, + schemaProp: i, + compositeRule: true, + }, schValid); + gen.assign(valid, (0, codegen_1._) `${valid} || ${schValid}`); + const merged = cxt.mergeValidEvaluated(schCxt, schValid); + // can short-circuit if `unevaluatedProperties/Items` not supported (opts.unevaluated !== true) + // or if all properties and items were evaluated (it.props === true && it.items === true) + if (!merged) + gen.if((0, codegen_1.not)(valid)); + })); + cxt.result(valid, () => cxt.reset(), () => cxt.error(true)); +} +exports.validateUnion = validateUnion; +//# sourceMappingURL=code.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/code.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/code.js.map new file mode 100644 index 0000000000..ef06de2703 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/code.js.map @@ -0,0 +1 @@ +{"version":3,"file":"code.js","sourceRoot":"","sources":["../../lib/vocabularies/code.ts"],"names":[],"mappings":";;;AAGA,gDAAoG;AACpG,0CAAuD;AACvD,4CAAgC;AAChC,0CAAuC;AACvC,SAAgB,sBAAsB,CAAC,GAAe,EAAE,IAAY;IAClE,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;IAC3B,GAAG,CAAC,EAAE,CAAC,gBAAgB,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,GAAG,EAAE;QACpE,GAAG,CAAC,SAAS,CAAC,EAAC,eAAe,EAAE,IAAA,WAAC,EAAA,GAAG,IAAI,EAAE,EAAC,EAAE,IAAI,CAAC,CAAA;QAClD,GAAG,CAAC,KAAK,EAAE,CAAA;IACb,CAAC,CAAC,CAAA;AACJ,CAAC;AAND,wDAMC;AAED,SAAgB,gBAAgB,CAC9B,EAAC,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,EAAC,IAAI,EAAC,EAAa,EACnC,UAAoB,EACpB,OAAa;IAEb,OAAO,IAAA,YAAE,EACP,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACzB,IAAA,aAAG,EAAC,gBAAgB,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,EAAE,IAAA,WAAC,EAAA,GAAG,OAAO,MAAM,IAAI,EAAE,CAAC,CACpF,CACF,CAAA;AACH,CAAC;AAVD,4CAUC;AAED,SAAgB,iBAAiB,CAAC,GAAe,EAAE,OAAa;IAC9D,GAAG,CAAC,SAAS,CAAC,EAAC,eAAe,EAAE,OAAO,EAAC,EAAE,IAAI,CAAC,CAAA;IAC/C,GAAG,CAAC,KAAK,EAAE,CAAA;AACb,CAAC;AAHD,8CAGC;AAED,SA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,IAAI,WAAW,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW;QAAE,OAAM;IAE/C,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;IACrC,MAAM,QAAQ,GAAG,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IAEnC,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,CACb,MAAM,CAAC,OAAO,CAAC,CAAC,IAAe,EAAE,CAAS,EAAE,EAAE;QAC5C,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,CAC1B;YACE,OAAO;YACP,UAAU,EAAE,CAAC;YACb,aAAa,EAAE,IAAI;SACpB,EACD,QAAQ,CACT,CAAA;QACD,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,IAAA,WAAC,EAAA,GAAG,KAAK,OAAO,QAAQ,EAAE,CAAC,CAAA;QAC7C,MAAM,MAAM,GAAG,GAAG,CAAC,mBAAmB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;QACxD,+FAA+F;QAC/F,yFAAyF;QACzF,IAAI,CAAC,MAAM;YAAE,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,CAAC,CAAA;IACjC,CAAC,CAAC,CACH,CAAA;IAED,GAAG,CAAC,MAAM,CACR,KAAK,EACL,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,EACjB,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CACtB,CAAA;AACH,CAAC;AAjCD,sCAiCC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/core/id.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/core/id.d.ts new file mode 100644 index 0000000000..cde2aa2700 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/core/id.d.ts @@ -0,0 +1,3 @@ +import type { CodeKeywordDefinition } from "../../types"; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/core/id.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/core/id.js new file mode 100644 index 0000000000..313598aab8 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/core/id.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const def = { + keyword: "id", + code() { + throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID'); + }, +}; +exports.default = def; +//# sourceMappingURL=id.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/core/id.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/core/id.js.map new file mode 100644 index 0000000000..4eb27eb33a --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/core/id.js.map @@ -0,0 +1 @@ +{"version":3,"file":"id.js","sourceRoot":"","sources":["../../../lib/vocabularies/core/id.ts"],"names":[],"mappings":";;AAEA,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,IAAI;IACb,IAAI;QACF,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAA;IACzE,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/core/index.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/core/index.d.ts new file mode 100644 index 0000000000..f2e34ee367 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/core/index.d.ts @@ -0,0 +1,3 @@ +import type { Vocabulary } from "../../types"; +declare const core: Vocabulary; +export default core; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/core/index.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/core/index.js new file mode 100644 index 0000000000..87656d7436 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/core/index.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const id_1 = require("./id"); +const ref_1 = require("./ref"); +const core = [ + "$schema", + "$id", + "$defs", + "$vocabulary", + { keyword: "$comment" }, + "definitions", + id_1.default, + ref_1.default, +]; +exports.default = core; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/core/index.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/core/index.js.map new file mode 100644 index 0000000000..5bf65f9417 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/core/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/core/index.ts"],"names":[],"mappings":";;AACA,6BAA4B;AAC5B,+BAA8B;AAE9B,MAAM,IAAI,GAAe;IACvB,SAAS;IACT,KAAK;IACL,OAAO;IACP,aAAa;IACb,EAAC,OAAO,EAAE,UAAU,EAAC;IACrB,aAAa;IACb,YAAS;IACT,aAAU;CACX,CAAA;AAED,kBAAe,IAAI,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/core/ref.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/core/ref.d.ts new file mode 100644 index 0000000000..6a0967d157 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/core/ref.d.ts @@ -0,0 +1,8 @@ +import type { CodeKeywordDefinition } from "../../types"; +import type { KeywordCxt } from "../../compile/validate"; +import { Code } from "../../compile/codegen"; +import { SchemaEnv } from "../../compile"; +declare const def: CodeKeywordDefinition; +export declare function getValidate(cxt: KeywordCxt, sch: SchemaEnv): Code; +export declare function callRef(cxt: KeywordCxt, v: Code, sch?: SchemaEnv, $async?: boolean): void; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/core/ref.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/core/ref.js new file mode 100644 index 0000000000..bac1ae853f --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/core/ref.js @@ -0,0 +1,122 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.callRef = exports.getValidate = void 0; +const ref_error_1 = require("../../compile/ref_error"); +const code_1 = require("../code"); +const codegen_1 = require("../../compile/codegen"); +const names_1 = require("../../compile/names"); +const compile_1 = require("../../compile"); +const util_1 = require("../../compile/util"); +const def = { + keyword: "$ref", + schemaType: "string", + code(cxt) { + const { gen, schema: $ref, it } = cxt; + const { baseId, schemaEnv: env, validateName, opts, self } = it; + const { root } = env; + if (($ref === "#" || $ref === "#/") && baseId === root.baseId) + return callRootRef(); + const schOrEnv = compile_1.resolveRef.call(self, root, baseId, $ref); + if (schOrEnv === undefined) + throw new ref_error_1.default(it.opts.uriResolver, baseId, $ref); + if (schOrEnv instanceof compile_1.SchemaEnv) + return callValidate(schOrEnv); + return inlineRefSchema(schOrEnv); + function callRootRef() { + if (env === root) + return callRef(cxt, validateName, env, env.$async); + const rootName = gen.scopeValue("root", { ref: root }); + return callRef(cxt, (0, codegen_1._) `${rootName}.validate`, root, root.$async); + } + function callValidate(sch) { + const v = getValidate(cxt, sch); + callRef(cxt, v, sch, sch.$async); + } + function inlineRefSchema(sch) { + const schName = gen.scopeValue("schema", opts.code.source === true ? { ref: sch, code: (0, codegen_1.stringify)(sch) } : { ref: sch }); + const valid = gen.name("valid"); + const schCxt = cxt.subschema({ + schema: sch, + dataTypes: [], + schemaPath: codegen_1.nil, + topSchemaRef: schName, + errSchemaPath: $ref, + }, valid); + cxt.mergeEvaluated(schCxt); + cxt.ok(valid); + } + }, +}; +function getValidate(cxt, sch) { + const { gen } = cxt; + return sch.validate + ? gen.scopeValue("validate", { ref: sch.validate }) + : (0, codegen_1._) `${gen.scopeValue("wrapper", { ref: sch })}.validate`; +} +exports.getValidate = getValidate; +function callRef(cxt, v, sch, $async) { + const { gen, it } = cxt; + const { allErrors, schemaEnv: env, opts } = it; + const passCxt = opts.passContext ? names_1.default.this : codegen_1.nil; + if ($async) + callAsyncRef(); + else + callSyncRef(); + function callAsyncRef() { + if (!env.$async) + throw new Error("async schema referenced by sync schema"); + const valid = gen.let("valid"); + gen.try(() => { + gen.code((0, codegen_1._) `await ${(0, code_1.callValidateCode)(cxt, v, passCxt)}`); + addEvaluatedFrom(v); // TODO will not work with async, it has to be returned with the result + if (!allErrors) + gen.assign(valid, true); + }, (e) => { + gen.if((0, codegen_1._) `!(${e} instanceof ${it.ValidationError})`, () => gen.throw(e)); + addErrorsFrom(e); + if (!allErrors) + gen.assign(valid, false); + }); + cxt.ok(valid); + } + function callSyncRef() { + cxt.result((0, code_1.callValidateCode)(cxt, v, passCxt), () => addEvaluatedFrom(v), () => addErrorsFrom(v)); + } + function addErrorsFrom(source) { + const errs = (0, codegen_1._) `${source}.errors`; + gen.assign(names_1.default.vErrors, (0, codegen_1._) `${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`); // TODO tagged + gen.assign(names_1.default.errors, (0, codegen_1._) `${names_1.default.vErrors}.length`); + } + function addEvaluatedFrom(source) { + var _a; + if (!it.opts.unevaluated) + return; + const schEvaluated = (_a = sch === null || sch === void 0 ? void 0 : sch.validate) === null || _a === void 0 ? void 0 : _a.evaluated; + // TODO refactor + if (it.props !== true) { + if (schEvaluated && !schEvaluated.dynamicProps) { + if (schEvaluated.props !== undefined) { + it.props = util_1.mergeEvaluated.props(gen, schEvaluated.props, it.props); + } + } + else { + const props = gen.var("props", (0, codegen_1._) `${source}.evaluated.props`); + it.props = util_1.mergeEvaluated.props(gen, props, it.props, codegen_1.Name); + } + } + if (it.items !== true) { + if (schEvaluated && !schEvaluated.dynamicItems) { + if (schEvaluated.items !== undefined) { + it.items = util_1.mergeEvaluated.items(gen, schEvaluated.items, it.items); + } + } + else { + const items = gen.var("items", (0, codegen_1._) `${source}.evaluated.items`); + it.items = util_1.mergeEvaluated.items(gen, items, it.items, codegen_1.Name); + } + } + } +} +exports.callRef = callRef; +exports.default = def; +//# sourceMappingURL=ref.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/core/ref.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/core/ref.js.map new file mode 100644 index 0000000000..3125bb8937 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/core/ref.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ref.js","sourceRoot":"","sources":["../../../lib/vocabularies/core/ref.ts"],"names":[],"mappings":";;;AAEA,uDAAqD;AACrD,kCAAwC;AACxC,mDAAmE;AACnE,+CAAmC;AACnC,2CAAmD;AACnD,6CAAiD;AAEjD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,QAAQ;IACpB,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACnC,MAAM,EAAC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAC,GAAG,EAAE,CAAA;QAC7D,MAAM,EAAC,IAAI,EAAC,GAAG,GAAG,CAAA;QAClB,IAAI,CAAC,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,IAAI,CAAC,IAAI,MAAM,KAAK,IAAI,CAAC,MAAM;YAAE,OAAO,WAAW,EAAE,CAAA;QACnF,MAAM,QAAQ,GAAG,oBAAU,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;QAC1D,IAAI,QAAQ,KAAK,SAAS;YAAE,MAAM,IAAI,mBAAe,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;QACxF,IAAI,QAAQ,YAAY,mBAAS;YAAE,OAAO,YAAY,CAAC,QAAQ,CAAC,CAAA;QAChE,OAAO,eAAe,CA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,CAAC;IACH,CAAC;AACH,CAAC;AAhED,0BAgEC;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/discriminator/index.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/discriminator/index.d.ts new file mode 100644 index 0000000000..ab3669a42d --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/discriminator/index.d.ts @@ -0,0 +1,5 @@ +import type { CodeKeywordDefinition } from "../../types"; +import { DiscrError, DiscrErrorObj } from "../discriminator/types"; +export type DiscriminatorError = DiscrErrorObj | DiscrErrorObj; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/discriminator/index.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/discriminator/index.js new file mode 100644 index 0000000000..e113aed701 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/discriminator/index.js @@ -0,0 +1,104 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const types_1 = require("../discriminator/types"); +const compile_1 = require("../../compile"); +const ref_error_1 = require("../../compile/ref_error"); +const util_1 = require("../../compile/util"); +const error = { + message: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag + ? `tag "${tagName}" must be string` + : `value of tag "${tagName}" must be in oneOf`, + params: ({ params: { discrError, tag, tagName } }) => (0, codegen_1._) `{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}`, +}; +const def = { + keyword: "discriminator", + type: "object", + schemaType: "object", + error, + code(cxt) { + const { gen, data, schema, parentSchema, it } = cxt; + const { oneOf } = parentSchema; + if (!it.opts.discriminator) { + throw new Error("discriminator: requires discriminator option"); + } + const tagName = schema.propertyName; + if (typeof tagName != "string") + throw new Error("discriminator: requires propertyName"); + if (schema.mapping) + throw new Error("discriminator: mapping is not supported"); + if (!oneOf) + throw new Error("discriminator: requires oneOf keyword"); + const valid = gen.let("valid", false); + const tag = gen.const("tag", (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(tagName)}`); + gen.if((0, codegen_1._) `typeof ${tag} == "string"`, () => validateMapping(), () => cxt.error(false, { discrError: types_1.DiscrError.Tag, tag, tagName })); + cxt.ok(valid); + function validateMapping() { + const mapping = getMapping(); + gen.if(false); + for (const tagValue in mapping) { + gen.elseIf((0, codegen_1._) `${tag} === ${tagValue}`); + gen.assign(valid, applyTagSchema(mapping[tagValue])); + } + gen.else(); + cxt.error(false, { discrError: types_1.DiscrError.Mapping, tag, tagName }); + gen.endIf(); + } + function applyTagSchema(schemaProp) { + const _valid = gen.name("valid"); + const schCxt = cxt.subschema({ keyword: "oneOf", schemaProp }, _valid); + cxt.mergeEvaluated(schCxt, codegen_1.Name); + return _valid; + } + function getMapping() { + var _a; + const oneOfMapping = {}; + const topRequired = hasRequired(parentSchema); + let tagRequired = true; + for (let i = 0; i < oneOf.length; i++) { + let sch = oneOf[i]; + if ((sch === null || sch === void 0 ? void 0 : sch.$ref) && !(0, util_1.schemaHasRulesButRef)(sch, it.self.RULES)) { + const ref = sch.$ref; + sch = compile_1.resolveRef.call(it.self, it.schemaEnv.root, it.baseId, ref); + if (sch instanceof compile_1.SchemaEnv) + sch = sch.schema; + if (sch === undefined) + throw new ref_error_1.default(it.opts.uriResolver, it.baseId, ref); + } + const propSch = (_a = sch === null || sch === void 0 ? void 0 : sch.properties) === null || _a === void 0 ? void 0 : _a[tagName]; + if (typeof propSch != "object") { + throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${tagName}"`); + } + tagRequired = tagRequired && (topRequired || hasRequired(sch)); + addMappings(propSch, i); + } + if (!tagRequired) + throw new Error(`discriminator: "${tagName}" must be required`); + return oneOfMapping; + function hasRequired({ required }) { + return Array.isArray(required) && required.includes(tagName); + } + function addMappings(sch, i) { + if (sch.const) { + addMapping(sch.const, i); + } + else if (sch.enum) { + for (const tagValue of sch.enum) { + addMapping(tagValue, i); + } + } + else { + throw new Error(`discriminator: "properties/${tagName}" must have "const" or "enum"`); + } + } + function addMapping(tagValue, i) { + if (typeof tagValue != "string" || tagValue in oneOfMapping) { + throw new Error(`discriminator: "${tagName}" values must be unique strings`); + } + oneOfMapping[tagValue] = i; + } + } + }, +}; +exports.default = def; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/discriminator/index.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/discriminator/index.js.map new file mode 100644 index 0000000000..f9d69db267 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/discriminator/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/discriminator/index.ts"],"names":[],"mappings":";;AAEA,mDAA0D;AAC1D,kDAAgE;AAChE,2CAAmD;AACnD,uDAAqD;AACrD,6CAAuD;AAIvD,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,UAAU,EAAE,OAAO,EAAC,EAAC,EAAE,EAAE,CAC3C,UAAU,KAAK,kBAAU,CAAC,GAAG;QAC3B,CAAC,CAAC,QAAQ,OAAO,kBAAkB;QACnC,CAAC,CAAC,iBAAiB,OAAO,oBAAoB;IAClD,MAAM,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,UAAU,EAAE,GAAG,EAAE,OAAO,EAAC,EAAC,EAAE,EAAE,CAC/C,IAAA,WAAC,EAAA,WAAW,UAAU,UAAU,OAAO,eAAe,GAAG,GAAG;CAC/D,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,eAAe;IACxB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QAC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CAAC,CAAA;oBACzB,CAAC;gBACH,CAAC;qBAAM,CAAC;oBACN,MAAM,IAAI,KAAK,CAAC,8BAA8B,OAAO,+BAA+B,CAAC,CAAA;gBACvF,CAAC;YACH,CAAC;YAED,SAAS,UAAU,CAAC,QAAiB,EAAE,CAAS;gBAC9C,IAAI,OAAO,QAAQ,IAAI,QAAQ,IAAI,QAAQ,IAAI,YAAY,EAAE,CAAC;oBAC5D,MAAM,IAAI,KAAK,CAAC,mBAAmB,OAAO,iCAAiC,CAAC,CAAA;gBAC9E,CAAC;gBACD,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;YAC5B,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/discriminator/types.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/discriminator/types.d.ts new file mode 100644 index 0000000000..8550f6d97d --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/discriminator/types.d.ts @@ -0,0 +1,10 @@ +import type { ErrorObject } from "../../types"; +export declare enum DiscrError { + Tag = "tag", + Mapping = "mapping" +} +export type DiscrErrorObj = ErrorObject<"discriminator", { + error: E; + tag: string; + tagValue: unknown; +}, string>; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/discriminator/types.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/discriminator/types.js new file mode 100644 index 0000000000..edf4da5ed1 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/discriminator/types.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DiscrError = void 0; +var DiscrError; +(function (DiscrError) { + DiscrError["Tag"] = "tag"; + DiscrError["Mapping"] = "mapping"; +})(DiscrError || (exports.DiscrError = DiscrError = {})); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/discriminator/types.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/discriminator/types.js.map new file mode 100644 index 0000000000..028633bd36 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/discriminator/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../lib/vocabularies/discriminator/types.ts"],"names":[],"mappings":";;;AAEA,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,yBAAW,CAAA;IACX,iCAAmB,CAAA;AACrB,CAAC,EAHW,UAAU,0BAAV,UAAU,QAGrB"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/draft2020.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/draft2020.d.ts new file mode 100644 index 0000000000..d65752c63f --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/draft2020.d.ts @@ -0,0 +1,3 @@ +import type { Vocabulary } from "../types"; +declare const draft2020Vocabularies: Vocabulary[]; +export default draft2020Vocabularies; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/draft2020.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/draft2020.js new file mode 100644 index 0000000000..23d244aed1 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/draft2020.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const core_1 = require("./core"); +const validation_1 = require("./validation"); +const applicator_1 = require("./applicator"); +const dynamic_1 = require("./dynamic"); +const next_1 = require("./next"); +const unevaluated_1 = require("./unevaluated"); +const format_1 = require("./format"); +const metadata_1 = require("./metadata"); +const draft2020Vocabularies = [ + dynamic_1.default, + core_1.default, + validation_1.default, + (0, applicator_1.default)(true), + format_1.default, + metadata_1.metadataVocabulary, + metadata_1.contentVocabulary, + next_1.default, + unevaluated_1.default, +]; +exports.default = draft2020Vocabularies; +//# sourceMappingURL=draft2020.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/draft2020.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/draft2020.js.map new file mode 100644 index 0000000000..ae1a4d8339 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/draft2020.js.map @@ -0,0 +1 @@ +{"version":3,"file":"draft2020.js","sourceRoot":"","sources":["../../lib/vocabularies/draft2020.ts"],"names":[],"mappings":";;AACA,iCAAmC;AACnC,6CAA+C;AAC/C,6CAAkD;AAClD,uCAAyC;AACzC,iCAAmC;AACnC,+CAAiD;AACjD,qCAAuC;AACvC,yCAAgE;AAEhE,MAAM,qBAAqB,GAAiB;IAC1C,iBAAiB;IACjB,cAAc;IACd,oBAAoB;IACpB,IAAA,oBAAuB,EAAC,IAAI,CAAC;IAC7B,gBAAgB;IAChB,6BAAkB;IAClB,4BAAiB;IACjB,cAAc;IACd,qBAAqB;CACtB,CAAA;AAED,kBAAe,qBAAqB,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/draft7.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/draft7.d.ts new file mode 100644 index 0000000000..469fb84444 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/draft7.d.ts @@ -0,0 +1,3 @@ +import type { Vocabulary } from "../types"; +declare const draft7Vocabularies: Vocabulary[]; +export default draft7Vocabularies; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/draft7.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/draft7.js new file mode 100644 index 0000000000..1e993de0ec --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/draft7.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const core_1 = require("./core"); +const validation_1 = require("./validation"); +const applicator_1 = require("./applicator"); +const format_1 = require("./format"); +const metadata_1 = require("./metadata"); +const draft7Vocabularies = [ + core_1.default, + validation_1.default, + (0, applicator_1.default)(), + format_1.default, + metadata_1.metadataVocabulary, + metadata_1.contentVocabulary, +]; +exports.default = draft7Vocabularies; +//# sourceMappingURL=draft7.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/draft7.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/draft7.js.map new file mode 100644 index 0000000000..bc7389c67d --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/draft7.js.map @@ -0,0 +1 @@ +{"version":3,"file":"draft7.js","sourceRoot":"","sources":["../../lib/vocabularies/draft7.ts"],"names":[],"mappings":";;AACA,iCAAmC;AACnC,6CAA+C;AAC/C,6CAAkD;AAClD,qCAAuC;AACvC,yCAAgE;AAEhE,MAAM,kBAAkB,GAAiB;IACvC,cAAc;IACd,oBAAoB;IACpB,IAAA,oBAAuB,GAAE;IACzB,gBAAgB;IAChB,6BAAkB;IAClB,4BAAiB;CAClB,CAAA;AAED,kBAAe,kBAAkB,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/dynamicAnchor.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/dynamicAnchor.d.ts new file mode 100644 index 0000000000..5621213993 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/dynamicAnchor.d.ts @@ -0,0 +1,5 @@ +import type { CodeKeywordDefinition } from "../../types"; +import type { KeywordCxt } from "../../compile/validate"; +declare const def: CodeKeywordDefinition; +export declare function dynamicAnchor(cxt: KeywordCxt, anchor: string): void; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/dynamicAnchor.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/dynamicAnchor.js new file mode 100644 index 0000000000..972dc35c4b --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/dynamicAnchor.js @@ -0,0 +1,30 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.dynamicAnchor = void 0; +const codegen_1 = require("../../compile/codegen"); +const names_1 = require("../../compile/names"); +const compile_1 = require("../../compile"); +const ref_1 = require("../core/ref"); +const def = { + keyword: "$dynamicAnchor", + schemaType: "string", + code: (cxt) => dynamicAnchor(cxt, cxt.schema), +}; +function dynamicAnchor(cxt, anchor) { + const { gen, it } = cxt; + it.schemaEnv.root.dynamicAnchors[anchor] = true; + const v = (0, codegen_1._) `${names_1.default.dynamicAnchors}${(0, codegen_1.getProperty)(anchor)}`; + const validate = it.errSchemaPath === "#" ? it.validateName : _getValidate(cxt); + gen.if((0, codegen_1._) `!${v}`, () => gen.assign(v, validate)); +} +exports.dynamicAnchor = dynamicAnchor; +function _getValidate(cxt) { + const { schemaEnv, schema, self } = cxt.it; + const { root, baseId, localRefs, meta } = schemaEnv.root; + const { schemaId } = self.opts; + const sch = new compile_1.SchemaEnv({ schema, schemaId, root, baseId, localRefs, meta }); + compile_1.compileSchema.call(self, sch); + return (0, ref_1.getValidate)(cxt, sch); +} +exports.default = def; +//# sourceMappingURL=dynamicAnchor.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/dynamicAnchor.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/dynamicAnchor.js.map new file mode 100644 index 0000000000..e70afe30f0 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/dynamicAnchor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"dynamicAnchor.js","sourceRoot":"","sources":["../../../lib/vocabularies/dynamic/dynamicAnchor.ts"],"names":[],"mappings":";;;AAEA,mDAA0D;AAC1D,+CAAmC;AACnC,2CAAsD;AACtD,qCAAuC;AAEvC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,gBAAgB;IACzB,UAAU,EAAE,QAAQ;IACpB,IAAI,EAAE,CAAC,GAA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A;AAC9B,CAAC;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/dynamicRef.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/dynamicRef.d.ts new file mode 100644 index 0000000000..fa2f2b81d6 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/dynamicRef.d.ts @@ -0,0 +1,5 @@ +import type { CodeKeywordDefinition } from "../../types"; +import type { KeywordCxt } from "../../compile/validate"; +declare const def: CodeKeywordDefinition; +export declare function dynamicRef(cxt: KeywordCxt, ref: string): void; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/dynamicRef.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/dynamicRef.js new file mode 100644 index 0000000000..9f010a0df4 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/dynamicRef.js @@ -0,0 +1,51 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.dynamicRef = void 0; +const codegen_1 = require("../../compile/codegen"); +const names_1 = require("../../compile/names"); +const ref_1 = require("../core/ref"); +const def = { + keyword: "$dynamicRef", + schemaType: "string", + code: (cxt) => dynamicRef(cxt, cxt.schema), +}; +function dynamicRef(cxt, ref) { + const { gen, keyword, it } = cxt; + if (ref[0] !== "#") + throw new Error(`"${keyword}" only supports hash fragment reference`); + const anchor = ref.slice(1); + if (it.allErrors) { + _dynamicRef(); + } + else { + const valid = gen.let("valid", false); + _dynamicRef(valid); + cxt.ok(valid); + } + function _dynamicRef(valid) { + // TODO the assumption here is that `recursiveRef: #` always points to the root + // of the schema object, which is not correct, because there may be $id that + // makes # point to it, and the target schema may not contain dynamic/recursiveAnchor. + // Because of that 2 tests in recursiveRef.json fail. + // This is a similar problem to #815 (`$id` doesn't alter resolution scope for `{ "$ref": "#" }`). + // (This problem is not tested in JSON-Schema-Test-Suite) + if (it.schemaEnv.root.dynamicAnchors[anchor]) { + const v = gen.let("_v", (0, codegen_1._) `${names_1.default.dynamicAnchors}${(0, codegen_1.getProperty)(anchor)}`); + gen.if(v, _callRef(v, valid), _callRef(it.validateName, valid)); + } + else { + _callRef(it.validateName, valid)(); + } + } + function _callRef(validate, valid) { + return valid + ? () => gen.block(() => { + (0, ref_1.callRef)(cxt, validate); + gen.let(valid, true); + }) + : () => (0, ref_1.callRef)(cxt, validate); + } +} +exports.dynamicRef = dynamicRef; +exports.default = def; +//# sourceMappingURL=dynamicRef.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/dynamicRef.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/dynamicRef.js.map new file mode 100644 index 0000000000..69afd4de88 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/dynamicRef.js.map @@ -0,0 +1 @@ +{"version":3,"file":"dynamicRef.js","sourceRoot":"","sources":["../../../lib/vocabularies/dynamic/dynamicRef.ts"],"names":[],"mappings":";;;AAEA,mDAAgE;AAChE,+CAAmC;AACnC,qCAAmC;AAEnC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,aAAa;IACtB,UAAU,EAAE,QAAQ;IACpB,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC;CAC3C,CAAA;AAED,SAAgB,UAAU,CAAC,GAAe,EAAE,GAAW;IACrD,MAAM,EAAC,GAAG,EAAE,OAAO,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;IAC9B,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG;QAAE,MAAM,IAAI,KAAK,CAAC,IAAI,OAAO,yCAAyC,CAAC,CAAA;IACzF,MAAM,MAAM,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAC3B,IAAI,EAAE,CAAC,SAAS,E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CAoCC;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/index.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/index.d.ts new file mode 100644 index 0000000000..0c751d93f0 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/index.d.ts @@ -0,0 +1,3 @@ +import type { Vocabulary } from "../../types"; +declare const dynamic: Vocabulary; +export default dynamic; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/index.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/index.js new file mode 100644 index 0000000000..f2388a7571 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/index.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const dynamicAnchor_1 = require("./dynamicAnchor"); +const dynamicRef_1 = require("./dynamicRef"); +const recursiveAnchor_1 = require("./recursiveAnchor"); +const recursiveRef_1 = require("./recursiveRef"); +const dynamic = [dynamicAnchor_1.default, dynamicRef_1.default, recursiveAnchor_1.default, recursiveRef_1.default]; +exports.default = dynamic; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/index.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/index.js.map new file mode 100644 index 0000000000..f96ba76dd8 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/dynamic/index.ts"],"names":[],"mappings":";;AACA,mDAA2C;AAC3C,6CAAqC;AACrC,uDAA+C;AAC/C,iDAAyC;AAEzC,MAAM,OAAO,GAAe,CAAC,uBAAa,EAAE,oBAAU,EAAE,yBAAe,EAAE,sBAAY,CAAC,CAAA;AAEtF,kBAAe,OAAO,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/recursiveAnchor.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/recursiveAnchor.d.ts new file mode 100644 index 0000000000..cde2aa2700 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/recursiveAnchor.d.ts @@ -0,0 +1,3 @@ +import type { CodeKeywordDefinition } from "../../types"; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/recursiveAnchor.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/recursiveAnchor.js new file mode 100644 index 0000000000..9fd8323535 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/recursiveAnchor.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const dynamicAnchor_1 = require("./dynamicAnchor"); +const util_1 = require("../../compile/util"); +const def = { + keyword: "$recursiveAnchor", + schemaType: "boolean", + code(cxt) { + if (cxt.schema) + (0, dynamicAnchor_1.dynamicAnchor)(cxt, ""); + else + (0, util_1.checkStrictMode)(cxt.it, "$recursiveAnchor: false is ignored"); + }, +}; +exports.default = def; +//# sourceMappingURL=recursiveAnchor.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/recursiveAnchor.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/recursiveAnchor.js.map new file mode 100644 index 0000000000..5d5e381b0d --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/recursiveAnchor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"recursiveAnchor.js","sourceRoot":"","sources":["../../../lib/vocabularies/dynamic/recursiveAnchor.ts"],"names":[],"mappings":";;AACA,mDAA6C;AAC7C,6CAAkD;AAElD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,kBAAkB;IAC3B,UAAU,EAAE,SAAS;IACrB,IAAI,CAAC,GAAG;QACN,IAAI,GAAG,CAAC,MAAM;YAAE,IAAA,6BAAa,EAAC,GAAG,EAAE,EAAE,CAAC,CAAA;;YACjC,IAAA,sBAAe,EAAC,GAAG,CAAC,EAAE,EAAE,oCAAoC,CAAC,CAAA;IACpE,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/recursiveRef.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/recursiveRef.d.ts new file mode 100644 index 0000000000..cde2aa2700 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/recursiveRef.d.ts @@ -0,0 +1,3 @@ +import type { CodeKeywordDefinition } from "../../types"; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/recursiveRef.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/recursiveRef.js new file mode 100644 index 0000000000..8cd5c69690 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/recursiveRef.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const dynamicRef_1 = require("./dynamicRef"); +const def = { + keyword: "$recursiveRef", + schemaType: "string", + code: (cxt) => (0, dynamicRef_1.dynamicRef)(cxt, cxt.schema), +}; +exports.default = def; +//# sourceMappingURL=recursiveRef.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/recursiveRef.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/recursiveRef.js.map new file mode 100644 index 0000000000..f813804467 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/dynamic/recursiveRef.js.map @@ -0,0 +1 @@ +{"version":3,"file":"recursiveRef.js","sourceRoot":"","sources":["../../../lib/vocabularies/dynamic/recursiveRef.ts"],"names":[],"mappings":";;AACA,6CAAuC;AAEvC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,eAAe;IACxB,UAAU,EAAE,QAAQ;IACpB,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,uBAAU,EAAC,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC;CAC3C,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/errors.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/errors.d.ts new file mode 100644 index 0000000000..be67f2e82e --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/errors.d.ts @@ -0,0 +1,9 @@ +import type { TypeError } from "../compile/validate/dataType"; +import type { ApplicatorKeywordError } from "./applicator"; +import type { ValidationKeywordError } from "./validation"; +import type { FormatError } from "./format/format"; +import type { UnevaluatedPropertiesError } from "./unevaluated/unevaluatedProperties"; +import type { UnevaluatedItemsError } from "./unevaluated/unevaluatedItems"; +import type { DependentRequiredError } from "./validation/dependentRequired"; +import type { DiscriminatorError } from "./discriminator"; +export type DefinedError = TypeError | ApplicatorKeywordError | ValidationKeywordError | FormatError | UnevaluatedPropertiesError | UnevaluatedItemsError | DependentRequiredError | DiscriminatorError; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/errors.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/errors.js new file mode 100644 index 0000000000..d4d3fba002 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/errors.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=errors.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/errors.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/errors.js.map new file mode 100644 index 0000000000..56bad7362f --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/errors.js.map @@ -0,0 +1 @@ +{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../lib/vocabularies/errors.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/format/format.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/format/format.d.ts new file mode 100644 index 0000000000..04dc98f648 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/format/format.d.ts @@ -0,0 +1,8 @@ +import type { CodeKeywordDefinition, ErrorObject } from "../../types"; +export type FormatError = ErrorObject<"format", { + format: string; +}, string | { + $data: string; +}>; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/format/format.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/format/format.js new file mode 100644 index 0000000000..aa667c1ef1 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/format/format.js @@ -0,0 +1,92 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const error = { + message: ({ schemaCode }) => (0, codegen_1.str) `must match format "${schemaCode}"`, + params: ({ schemaCode }) => (0, codegen_1._) `{format: ${schemaCode}}`, +}; +const def = { + keyword: "format", + type: ["number", "string"], + schemaType: "string", + $data: true, + error, + code(cxt, ruleType) { + const { gen, data, $data, schema, schemaCode, it } = cxt; + const { opts, errSchemaPath, schemaEnv, self } = it; + if (!opts.validateFormats) + return; + if ($data) + validate$DataFormat(); + else + validateFormat(); + function validate$DataFormat() { + const fmts = gen.scopeValue("formats", { + ref: self.formats, + code: opts.code.formats, + }); + const fDef = gen.const("fDef", (0, codegen_1._) `${fmts}[${schemaCode}]`); + const fType = gen.let("fType"); + const format = gen.let("format"); + // TODO simplify + gen.if((0, codegen_1._) `typeof ${fDef} == "object" && !(${fDef} instanceof RegExp)`, () => gen.assign(fType, (0, codegen_1._) `${fDef}.type || "string"`).assign(format, (0, codegen_1._) `${fDef}.validate`), () => gen.assign(fType, (0, codegen_1._) `"string"`).assign(format, fDef)); + cxt.fail$data((0, codegen_1.or)(unknownFmt(), invalidFmt())); + function unknownFmt() { + if (opts.strictSchema === false) + return codegen_1.nil; + return (0, codegen_1._) `${schemaCode} && !${format}`; + } + function invalidFmt() { + const callFormat = schemaEnv.$async + ? (0, codegen_1._) `(${fDef}.async ? await ${format}(${data}) : ${format}(${data}))` + : (0, codegen_1._) `${format}(${data})`; + const validData = (0, codegen_1._) `(typeof ${format} == "function" ? ${callFormat} : ${format}.test(${data}))`; + return (0, codegen_1._) `${format} && ${format} !== true && ${fType} === ${ruleType} && !${validData}`; + } + } + function validateFormat() { + const formatDef = self.formats[schema]; + if (!formatDef) { + unknownFormat(); + return; + } + if (formatDef === true) + return; + const [fmtType, format, fmtRef] = getFormat(formatDef); + if (fmtType === ruleType) + cxt.pass(validCondition()); + function unknownFormat() { + if (opts.strictSchema === false) { + self.logger.warn(unknownMsg()); + return; + } + throw new Error(unknownMsg()); + function unknownMsg() { + return `unknown format "${schema}" ignored in schema at path "${errSchemaPath}"`; + } + } + function getFormat(fmtDef) { + const code = fmtDef instanceof RegExp + ? (0, codegen_1.regexpCode)(fmtDef) + : opts.code.formats + ? (0, codegen_1._) `${opts.code.formats}${(0, codegen_1.getProperty)(schema)}` + : undefined; + const fmt = gen.scopeValue("formats", { key: schema, ref: fmtDef, code }); + if (typeof fmtDef == "object" && !(fmtDef instanceof RegExp)) { + return [fmtDef.type || "string", fmtDef.validate, (0, codegen_1._) `${fmt}.validate`]; + } + return ["string", fmtDef, fmt]; + } + function validCondition() { + if (typeof formatDef == "object" && !(formatDef instanceof RegExp) && formatDef.async) { + if (!schemaEnv.$async) + throw new Error("async format in sync schema"); + return (0, codegen_1._) `await ${fmtRef}(${data})`; + } + return typeof format == "function" ? (0, codegen_1._) `${fmtRef}(${data})` : (0, codegen_1._) `${fmtRef}.test(${data})`; + } + } + }, +}; +exports.default = def; +//# sourceMappingURL=format.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/format/format.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/format/format.js.map new file mode 100644 index 0000000000..b6d93c9816 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/format/format.js.map @@ -0,0 +1 @@ +{"version":3,"file":"format.js","sourceRoot":"","sources":["../../../lib/vocabularies/format/format.ts"],"names":[],"mappings":";;AASA,mDAAoF;AAapF,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,aAAG,EAAA,sBAAsB,UAAU,GAAG;IACjE,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,YAAY,UAAU,GAAG;CACrD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,QAAQ;IACjB,IAAI,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC1B,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe,EAAE,QAAiB;QACrC,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACtD,MAAM,EAAC,IAAI,EAAE,aAAa,EAAE,SAAS,EAAE,IAAI,EAAC,GAAG,EAAE,CAAA;QACjD,IAAI,CAAC,IAAI,CAAC,eAAe;YAAE,OAAM;QAEjC,IAAI,KAAK;YAAE,mBAAmB,EAAE,CAAA;;YAC3B,cAAc,EAAE,CAAA;QAErB,SAAS,mBAAmB;YAC1B,MAAM,IAAI,GAAG,GAAG,CAAC,UAAU,CAAC,SAAS,EAAE;gBACrC,GAAG,EAAE,IAAI,CAAC,OAAO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EAAC,MAAM,CAAC,EAAE;wBAC/C,CAAC,CAAC,SAAS,CAAA;gBACf,MAAM,GAAG,GAAG,GAAG,CAAC,UAAU,CAAC,SAAS,EAAE,EAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAC,CAAC,CAAA;gBACvE,IAAI,OAAO,MAAM,IAAI,QAAQ,IAAI,CAAC,CAAC,MAAM,YAAY,MAAM,CAAC,EAAE,CAAC;oBAC7D,OAAO,CAAC,MAAM,CAAC,IAAI,IAAI,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,IAAA,WAAC,EAAA,GAAG,GAAG,WAAW,CAAC,CAAA;gBACvE,CAAC;gBAED,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,CAAC,CAAA;YAChC,CAAC;YAED,SAAS,cAAc;gBACrB,IAAI,OAAO,SAAS,IAAI,QAAQ,IAAI,CAAC,CAAC,SAAS,YAAY,MAAM,CAAC,IAAI,SAAS,CAAC,KAAK,EAAE,CAAC;oBACtF,IAAI,CAAC,SAAS,CAAC,MAAM;wBAAE,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAA;oBACrE,OAAO,IAAA,WAAC,EAAA,SAAS,MAAM,IAAI,IAAI,GAAG,CAAA;gBACpC,CAAC;gBACD,OAAO,OAAO,MAAM,IAAI,UAAU,CAAC,CAAC,CAAC,IAAA,WAAC,EAAA,GAAG,MAAM,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,IAAA,WAAC,EAAA,GAAG,MAAM,SAAS,IAAI,GAAG,CAAA;YACzF,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/format/index.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/format/index.d.ts new file mode 100644 index 0000000000..c8019c9d6c --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/format/index.d.ts @@ -0,0 +1,3 @@ +import type { Vocabulary } from "../../types"; +declare const format: Vocabulary; +export default format; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/format/index.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/format/index.js new file mode 100644 index 0000000000..d19023d245 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/format/index.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const format_1 = require("./format"); +const format = [format_1.default]; +exports.default = format; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/format/index.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/format/index.js.map new file mode 100644 index 0000000000..6315bfe1f1 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/format/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/format/index.ts"],"names":[],"mappings":";;AACA,qCAAoC;AAEpC,MAAM,MAAM,GAAe,CAAC,gBAAa,CAAC,CAAA;AAE1C,kBAAe,MAAM,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/discriminator.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/discriminator.d.ts new file mode 100644 index 0000000000..85e16df6a2 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/discriminator.d.ts @@ -0,0 +1,6 @@ +import type { CodeKeywordDefinition } from "../../types"; +import { _JTDTypeError } from "./error"; +import { DiscrError, DiscrErrorObj } from "../discriminator/types"; +export type JTDDiscriminatorError = _JTDTypeError<"discriminator", "object", string> | DiscrErrorObj | DiscrErrorObj; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/discriminator.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/discriminator.js new file mode 100644 index 0000000000..e7074d2794 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/discriminator.js @@ -0,0 +1,71 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const metadata_1 = require("./metadata"); +const nullable_1 = require("./nullable"); +const error_1 = require("./error"); +const types_1 = require("../discriminator/types"); +const error = { + message: (cxt) => { + const { schema, params } = cxt; + return params.discrError + ? params.discrError === types_1.DiscrError.Tag + ? `tag "${schema}" must be string` + : `value of tag "${schema}" must be in mapping` + : (0, error_1.typeErrorMessage)(cxt, "object"); + }, + params: (cxt) => { + const { schema, params } = cxt; + return params.discrError + ? (0, codegen_1._) `{error: ${params.discrError}, tag: ${schema}, tagValue: ${params.tag}}` + : (0, error_1.typeErrorParams)(cxt, "object"); + }, +}; +const def = { + keyword: "discriminator", + schemaType: "string", + implements: ["mapping"], + error, + code(cxt) { + (0, metadata_1.checkMetadata)(cxt); + const { gen, data, schema, parentSchema } = cxt; + const [valid, cond] = (0, nullable_1.checkNullableObject)(cxt, data); + gen.if(cond); + validateDiscriminator(); + gen.elseIf((0, codegen_1.not)(valid)); + cxt.error(); + gen.endIf(); + cxt.ok(valid); + function validateDiscriminator() { + const tag = gen.const("tag", (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(schema)}`); + gen.if((0, codegen_1._) `${tag} === undefined`); + cxt.error(false, { discrError: types_1.DiscrError.Tag, tag }); + gen.elseIf((0, codegen_1._) `typeof ${tag} == "string"`); + validateMapping(tag); + gen.else(); + cxt.error(false, { discrError: types_1.DiscrError.Tag, tag }, { instancePath: schema }); + gen.endIf(); + } + function validateMapping(tag) { + gen.if(false); + for (const tagValue in parentSchema.mapping) { + gen.elseIf((0, codegen_1._) `${tag} === ${tagValue}`); + gen.assign(valid, applyTagSchema(tagValue)); + } + gen.else(); + cxt.error(false, { discrError: types_1.DiscrError.Mapping, tag }, { instancePath: schema, schemaPath: "mapping", parentSchema: true }); + gen.endIf(); + } + function applyTagSchema(schemaProp) { + const _valid = gen.name("valid"); + cxt.subschema({ + keyword: "mapping", + schemaProp, + jtdDiscriminator: schema, + }, _valid); + return _valid; + } + }, +}; +exports.default = def; +//# sourceMappingURL=discriminator.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/discriminator.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/discriminator.js.map new file mode 100644 index 0000000000..ca2a5ab944 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/discriminator.js.map @@ -0,0 +1 @@ +{"version":3,"file":"discriminator.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/discriminator.ts"],"names":[],"mappings":";;AAEA,mDAA+D;AAC/D,yCAAwC;AACxC,yCAA8C;AAC9C,mCAAwE;AACxE,kDAAgE;AAOhE,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;QACf,MAAM,EAAC,MAAM,EAAE,MAAM,EAAC,GAAG,GAAG,CAAA;QAC5B,OAAO,MAAM,CAAC,UAAU;YACtB,CAAC,CAAC,MAAM,CAAC,UAAU,KAAK,kBAAU,CAAC,GAAG;gBACpC,CAAC,CAAC,QAAQ,MAAM,kBAAkB;gBAClC,CAAC,CAAC,iBAAiB,MAAM,sBAAsB;YACjD,CAAC,CAAC,IAAA,wBAAgB,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;IACrC,CAAC;IACD,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE;QACd,MAAM,EAAC,MAAM,EAAE,MAAM,EAAC,GAAG,GAAG,CAAA;QAC5B,OAAO,MAAM,CAAC,UAAU;YACtB,CAAC,CAAC,IAAA,WAAC,EAAA,WAAW,MAAM,CAAC,UAAU,UAAU,MAAM,eAAe,MAAM,CAAC,GAAG,GAAG;YAC3E,CAAC,CAAC,IAAA,uBAAe,EA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C,KAAK,EAAE,EAAC,UAAU,EAAE,kBAAU,CAAC,GAAG,EAAE,GAAG,EAAC,EAAE,EAAC,YAAY,EAAE,MAAM,EAAC,CAAC,CAAA;YAC3E,GAAG,CAAC,KAAK,EAAE,CAAA;QACb,CAAC;QAED,SAAS,eAAe,CAAC,GAAS;YAChC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;YACb,KAAK,MAAM,QAAQ,IAAI,YAAY,CAAC,OAAO,EAAE,CAAC;gBAC5C,GAAG,CAAC,MAAM,CAAC,IAAA,WAAC,EAAA,GAAG,GAAG,QAAQ,QAAQ,EAAE,CAAC,CAAA;gBACrC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAA;YAC7C,CAAC;YACD,GAAG,CAAC,IAAI,EAAE,CAAA;YACV,GAAG,CAAC,KAAK,CACP,KAAK,EACL,EAAC,UAAU,EAAE,kBAAU,CAAC,OAAO,EAAE,GAAG,EAAC,EACrC,EAAC,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,IAAI,EAAC,CAClE,CAAA;YACD,GAAG,CAAC,KAAK,EAAE,CAAA;QACb,CAAC;QAED,SAAS,cAAc,CAAC,UAAkB;YACxC,MAAM,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;YAChC,GAAG,CAAC,SAAS,CACX;gBACE,OAAO,EAAE,SAAS;gBAClB,UAAU;gBACV,gBAAgB,EAAE,MAAM;aACzB,EACD,MAAM,CACP,CAAA;YACD,OAAO,MAAM,CAAA;QACf,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/elements.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/elements.d.ts new file mode 100644 index 0000000000..82c942c35a --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/elements.d.ts @@ -0,0 +1,5 @@ +import type { CodeKeywordDefinition, SchemaObject } from "../../types"; +import { _JTDTypeError } from "./error"; +export type JTDElementsError = _JTDTypeError<"elements", "array", SchemaObject>; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/elements.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/elements.js new file mode 100644 index 0000000000..9b8fb548a4 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/elements.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const util_1 = require("../../compile/util"); +const code_1 = require("../code"); +const codegen_1 = require("../../compile/codegen"); +const metadata_1 = require("./metadata"); +const nullable_1 = require("./nullable"); +const error_1 = require("./error"); +const def = { + keyword: "elements", + schemaType: "object", + error: (0, error_1.typeError)("array"), + code(cxt) { + (0, metadata_1.checkMetadata)(cxt); + const { gen, data, schema, it } = cxt; + if ((0, util_1.alwaysValidSchema)(it, schema)) + return; + const [valid] = (0, nullable_1.checkNullable)(cxt); + gen.if((0, codegen_1.not)(valid), () => gen.if((0, codegen_1._) `Array.isArray(${data})`, () => gen.assign(valid, (0, code_1.validateArray)(cxt)), () => cxt.error())); + cxt.ok(valid); + }, +}; +exports.default = def; +//# sourceMappingURL=elements.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/elements.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/elements.js.map new file mode 100644 index 0000000000..38fe3a1297 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/elements.js.map @@ -0,0 +1 @@ +{"version":3,"file":"elements.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/elements.ts"],"names":[],"mappings":";;AAEA,6CAAoD;AACpD,kCAAqC;AACrC,mDAA4C;AAC5C,yCAAwC;AACxC,yCAAwC;AACxC,mCAAgD;AAIhD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,UAAU;IACnB,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAA,iBAAS,EAAC,OAAO,CAAC;IACzB,IAAI,CAAC,GAAe;QAClB,IAAA,wBAAa,EAAC,GAAG,CAAC,CAAA;QAClB,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACnC,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC;YAAE,OAAM;QACzC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAA,wBAAa,EAAC,GAAG,CAAC,CAAA;QAClC,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CACtB,GAAG,CAAC,EAAE,CACJ,IAAA,WAAC,EAAA,iBAAiB,IAAI,GAAG,EACzB,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,IAAA,oBAAa,EAAC,GAAG,CAAC,CAAC,EAC3C,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAClB,CACF,CAAA;QACD,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;IACf,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/enum.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/enum.d.ts new file mode 100644 index 0000000000..8ba1790d73 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/enum.d.ts @@ -0,0 +1,6 @@ +import type { CodeKeywordDefinition, ErrorObject } from "../../types"; +export type JTDEnumError = ErrorObject<"enum", { + allowedValues: string[]; +}, string[]>; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/enum.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/enum.js new file mode 100644 index 0000000000..78b01ee376 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/enum.js @@ -0,0 +1,43 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const metadata_1 = require("./metadata"); +const nullable_1 = require("./nullable"); +const error = { + message: "must be equal to one of the allowed values", + params: ({ schemaCode }) => (0, codegen_1._) `{allowedValues: ${schemaCode}}`, +}; +const def = { + keyword: "enum", + schemaType: "array", + error, + code(cxt) { + (0, metadata_1.checkMetadata)(cxt); + const { gen, data, schema, schemaValue, parentSchema, it } = cxt; + if (schema.length === 0) + throw new Error("enum must have non-empty array"); + if (schema.length !== new Set(schema).size) + throw new Error("enum items must be unique"); + let valid; + const isString = (0, codegen_1._) `typeof ${data} == "string"`; + if (schema.length >= it.opts.loopEnum) { + let cond; + [valid, cond] = (0, nullable_1.checkNullable)(cxt, isString); + gen.if(cond, loopEnum); + } + else { + /* istanbul ignore if */ + if (!Array.isArray(schema)) + throw new Error("ajv implementation error"); + valid = (0, codegen_1.and)(isString, (0, codegen_1.or)(...schema.map((value) => (0, codegen_1._) `${data} === ${value}`))); + if (parentSchema.nullable) + valid = (0, codegen_1.or)((0, codegen_1._) `${data} === null`, valid); + } + cxt.pass(valid); + function loopEnum() { + gen.forOf("v", schemaValue, (v) => gen.if((0, codegen_1._) `${valid} = ${data} === ${v}`, () => gen.break())); + } + }, +}; +exports.default = def; +//# sourceMappingURL=enum.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/enum.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/enum.js.map new file mode 100644 index 0000000000..06ee9e2061 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/enum.js.map @@ -0,0 +1 @@ +{"version":3,"file":"enum.js","sourceRo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;YACvE,KAAK,GAAG,IAAA,aAAG,EAAC,QAAQ,EAAE,IAAA,YAAE,EAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAa,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,GAAG,IAAI,QAAQ,KAAK,EAAE,CAAC,CAAC,CAAC,CAAA;YACpF,IAAI,YAAY,CAAC,QAAQ;gBAAE,KAAK,GAAG,IAAA,YAAE,EAAC,IAAA,WAAC,EAAA,GAAG,IAAI,WAAW,EAAE,KAAK,CAAC,CAAA;QACnE,CAAC;QACD,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAEf,SAAS,QAAQ;YACf,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,WAAmB,EAAE,CAAC,CAAC,EAAE,EAAE,CACxC,GAAG,CAAC,EAAE,CAAC,IAAA,WAAC,EAAA,GAAG,KAAK,MAAM,IAAI,QAAQ,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAC1D,CAAA;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/error.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/error.d.ts new file mode 100644 index 0000000000..d334ff54cb --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/error.d.ts @@ -0,0 +1,9 @@ +import type { KeywordErrorDefinition, KeywordErrorCxt, ErrorObject } from "../../types"; +import { Code } from "../../compile/codegen"; +export type _JTDTypeError = ErrorObject; +export declare function typeError(t: string): KeywordErrorDefinition; +export declare function typeErrorMessage({ parentSchema }: KeywordErrorCxt, t: string): string; +export declare function typeErrorParams({ parentSchema }: KeywordErrorCxt, t: string): Code; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/error.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/error.js new file mode 100644 index 0000000000..1a3920a7e5 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/error.js @@ -0,0 +1,20 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.typeErrorParams = exports.typeErrorMessage = exports.typeError = void 0; +const codegen_1 = require("../../compile/codegen"); +function typeError(t) { + return { + message: (cxt) => typeErrorMessage(cxt, t), + params: (cxt) => typeErrorParams(cxt, t), + }; +} +exports.typeError = typeError; +function typeErrorMessage({ parentSchema }, t) { + return (parentSchema === null || parentSchema === void 0 ? void 0 : parentSchema.nullable) ? `must be ${t} or null` : `must be ${t}`; +} +exports.typeErrorMessage = typeErrorMessage; +function typeErrorParams({ parentSchema }, t) { + return (0, codegen_1._) `{type: ${t}, nullable: ${!!(parentSchema === null || parentSchema === void 0 ? void 0 : parentSchema.nullable)}}`; +} +exports.typeErrorParams = typeErrorParams; +//# sourceMappingURL=error.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/error.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/error.js.map new file mode 100644 index 0000000000..db55967875 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/error.js.map @@ -0,0 +1 @@ +{"version":3,"file":"error.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/error.ts"],"names":[],"mappings":";;;AACA,mDAA6C;AAQ7C,SAAgB,SAAS,CAAC,CAAS;IACjC,OAAO;QACL,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,gBAAgB,CAAC,GAAG,EAAE,CAAC,CAAC;QAC1C,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,eAAe,CAAC,GAAG,EAAE,CAAC,CAAC;KACzC,CAAA;AACH,CAAC;AALD,8BAKC;AAED,SAAgB,gBAAgB,CAAC,EAAC,YAAY,EAAkB,EAAE,CAAS;IACzE,OAAO,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,QAAQ,EAAC,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,CAAA;AACzE,CAAC;AAFD,4CAEC;AAED,SAAgB,eAAe,CAAC,EAAC,YAAY,EAAkB,EAAE,CAAS;IACxE,OAAO,IAAA,WAAC,EAAA,UAAU,CAAC,eAAe,CAAC,CAAC,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,QAAQ,CAAA,GAAG,CAAA;AAC/D,CAAC;AAFD,0CAEC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/index.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/index.d.ts new file mode 100644 index 0000000000..c56246b782 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/index.d.ts @@ -0,0 +1,10 @@ +import type { Vocabulary } from "../../types"; +import { JTDTypeError } from "./type"; +import { JTDEnumError } from "./enum"; +import { JTDElementsError } from "./elements"; +import { JTDPropertiesError } from "./properties"; +import { JTDDiscriminatorError } from "./discriminator"; +import { JTDValuesError } from "./values"; +declare const jtdVocabulary: Vocabulary; +export default jtdVocabulary; +export type JTDErrorObject = JTDTypeError | JTDEnumError | JTDElementsError | JTDPropertiesError | JTDDiscriminatorError | JTDValuesError; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/index.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/index.js new file mode 100644 index 0000000000..18f40ab7a8 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/index.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const ref_1 = require("./ref"); +const type_1 = require("./type"); +const enum_1 = require("./enum"); +const elements_1 = require("./elements"); +const properties_1 = require("./properties"); +const optionalProperties_1 = require("./optionalProperties"); +const discriminator_1 = require("./discriminator"); +const values_1 = require("./values"); +const union_1 = require("./union"); +const metadata_1 = require("./metadata"); +const jtdVocabulary = [ + "definitions", + ref_1.default, + type_1.default, + enum_1.default, + elements_1.default, + properties_1.default, + optionalProperties_1.default, + discriminator_1.default, + values_1.default, + union_1.default, + metadata_1.default, + { keyword: "additionalProperties", schemaType: "boolean" }, + { keyword: "nullable", schemaType: "boolean" }, +]; +exports.default = jtdVocabulary; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/index.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/index.js.map new file mode 100644 index 0000000000..713a1875b5 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/index.ts"],"names":[],"mappings":";;AACA,+BAA8B;AAC9B,iCAAgD;AAChD,iCAAgD;AAChD,yCAAqD;AACrD,6CAA2D;AAC3D,6DAAqD;AACrD,mDAAoE;AACpE,qCAA+C;AAC/C,mCAA2B;AAC3B,yCAAiC;AAEjC,MAAM,aAAa,GAAe;IAChC,aAAa;IACb,aAAU;IACV,cAAW;IACX,cAAW;IACX,kBAAQ;IACR,oBAAU;IACV,4BAAkB;IAClB,uBAAa;IACb,gBAAM;IACN,eAAK;IACL,kBAAQ;IACR,EAAC,OAAO,EAAE,sBAAsB,EAAE,UAAU,EAAE,SAAS,EAAC;IACxD,EAAC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAC;CAC7C,CAAA;AAED,kBAAe,aAAa,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/metadata.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/metadata.d.ts new file mode 100644 index 0000000000..86e15a8ede --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/metadata.d.ts @@ -0,0 +1,5 @@ +import { KeywordCxt } from "../../ajv"; +import type { CodeKeywordDefinition } from "../../types"; +declare const def: CodeKeywordDefinition; +export declare function checkMetadata({ it, keyword }: KeywordCxt, metadata?: boolean): void; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/metadata.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/metadata.js new file mode 100644 index 0000000000..eeb3c91cda --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/metadata.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.checkMetadata = void 0; +const util_1 = require("../../compile/util"); +const def = { + keyword: "metadata", + schemaType: "object", + code(cxt) { + checkMetadata(cxt); + const { gen, schema, it } = cxt; + if ((0, util_1.alwaysValidSchema)(it, schema)) + return; + const valid = gen.name("valid"); + cxt.subschema({ keyword: "metadata", jtdMetadata: true }, valid); + cxt.ok(valid); + }, +}; +function checkMetadata({ it, keyword }, metadata) { + if (it.jtdMetadata !== metadata) { + throw new Error(`JTD: "${keyword}" cannot be used in this schema location`); + } +} +exports.checkMetadata = checkMetadata; +exports.default = def; +//# sourceMappingURL=metadata.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/metadata.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/metadata.js.map new file mode 100644 index 0000000000..2fea91ce5d --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/metadata.js.map @@ -0,0 +1 @@ +{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/metadata.ts"],"names":[],"mappings":";;;AAEA,6CAAoD;AAEpD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,UAAU;IACnB,UAAU,EAAE,QAAQ;IACpB,IAAI,CAAC,GAAe;QAClB,aAAa,CAAC,GAAG,CAAC,CAAA;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QAC7B,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC;YAAE,OAAM;QACzC,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC/B,GAAG,CAAC,SAAS,CAAC,EAAC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,IAAI,EAAC,EAAE,KAAK,CAAC,CAAA;QAC9D,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;IACf,CAAC;CACF,CAAA;AAED,SAAgB,aAAa,CAAC,EAAC,EAAE,EAAE,OAAO,EAAa,EAAE,QAAkB;IACzE,IAAI,EAAE,CAAC,WAAW,KAAK,QAAQ,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CAAC,SAAS,OAAO,0CAA0C,CAAC,CAAA;IAC7E,CAAC;AACH,CAAC;AAJD,sCAIC;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/nullable.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/nullable.d.ts new file mode 100644 index 0000000000..254f76023d --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/nullable.d.ts @@ -0,0 +1,4 @@ +import type { KeywordCxt } from "../../compile/validate"; +import { Code, Name } from "../../compile/codegen"; +export declare function checkNullable({ gen, data, parentSchema }: KeywordCxt, cond?: Code): [Name, Code]; +export declare function checkNullableObject(cxt: KeywordCxt, cond: Code): [Name, Code]; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/nullable.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/nullable.js new file mode 100644 index 0000000000..8c92d2cde3 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/nullable.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.checkNullableObject = exports.checkNullable = void 0; +const codegen_1 = require("../../compile/codegen"); +function checkNullable({ gen, data, parentSchema }, cond = codegen_1.nil) { + const valid = gen.name("valid"); + if (parentSchema.nullable) { + gen.let(valid, (0, codegen_1._) `${data} === null`); + cond = (0, codegen_1.not)(valid); + } + else { + gen.let(valid, false); + } + return [valid, cond]; +} +exports.checkNullable = checkNullable; +function checkNullableObject(cxt, cond) { + const [valid, cond_] = checkNullable(cxt, cond); + return [valid, (0, codegen_1._) `${cond_} && typeof ${cxt.data} == "object" && !Array.isArray(${cxt.data})`]; +} +exports.checkNullableObject = checkNullableObject; +//# sourceMappingURL=nullable.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/nullable.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/nullable.js.map new file mode 100644 index 0000000000..7d7a3f192d --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/nullable.js.map @@ -0,0 +1 @@ +{"version":3,"file":"nullable.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/nullable.ts"],"names":[],"mappings":";;;AACA,mDAA6D;AAE7D,SAAgB,aAAa,CAC3B,EAAC,GAAG,EAAE,IAAI,EAAE,YAAY,EAAa,EACrC,OAAa,aAAG;IAEhB,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAC/B,IAAI,YAAY,CAAC,QAAQ,EAAE,CAAC;QAC1B,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,IAAA,WAAC,EAAA,GAAG,IAAI,WAAW,CAAC,CAAA;QACnC,IAAI,GAAG,IAAA,aAAG,EAAC,KAAK,CAAC,CAAA;IACnB,CAAC;SAAM,CAAC;QACN,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;IACvB,CAAC;IACD,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;AACtB,CAAC;AAZD,sCAYC;AAED,SAAgB,mBAAmB,CAAC,GAAe,EAAE,IAAU;IAC7D,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAC/C,OAAO,CAAC,KAAK,EAAE,IAAA,WAAC,EAAA,GAAG,KAAK,cAAc,GAAG,CAAC,IAAI,kCAAkC,GAAG,CAAC,IAAI,GAAG,CAAC,CAAA;AAC9F,CAAC;AAHD,kDAGC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/optionalProperties.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/optionalProperties.d.ts new file mode 100644 index 0000000000..cde2aa2700 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/optionalProperties.d.ts @@ -0,0 +1,3 @@ +import type { CodeKeywordDefinition } from "../../types"; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/optionalProperties.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/optionalProperties.js new file mode 100644 index 0000000000..fe272758f5 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/optionalProperties.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const properties_1 = require("./properties"); +const def = { + keyword: "optionalProperties", + schemaType: "object", + error: properties_1.error, + code(cxt) { + if (cxt.parentSchema.properties) + return; + (0, properties_1.validateProperties)(cxt); + }, +}; +exports.default = def; +//# sourceMappingURL=optionalProperties.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/optionalProperties.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/optionalProperties.js.map new file mode 100644 index 0000000000..21e5f0d473 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/optionalProperties.js.map @@ -0,0 +1 @@ +{"version":3,"file":"optionalProperties.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/optionalProperties.ts"],"names":[],"mappings":";;AAEA,6CAAsD;AAEtD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,oBAAoB;IAC7B,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAL,kBAAK;IACL,IAAI,CAAC,GAAe;QAClB,IAAI,GAAG,CAAC,YAAY,CAAC,UAAU;YAAE,OAAM;QACvC,IAAA,+BAAkB,EAAC,GAAG,CAAC,CAAA;IACzB,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/properties.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/properties.d.ts new file mode 100644 index 0000000000..54e3b347cb --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/properties.d.ts @@ -0,0 +1,22 @@ +import type { CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition, SchemaObject } from "../../types"; +import type { KeywordCxt } from "../../compile/validate"; +import { _JTDTypeError } from "./error"; +declare enum PropError { + Additional = "additional", + Missing = "missing" +} +type PropKeyword = "properties" | "optionalProperties"; +type PropSchema = { + [P in string]?: SchemaObject; +}; +export type JTDPropertiesError = _JTDTypeError | ErrorObject | ErrorObject; +export declare const error: KeywordErrorDefinition; +declare const def: CodeKeywordDefinition; +export declare function validateProperties(cxt: KeywordCxt): void; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/properties.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/properties.js new file mode 100644 index 0000000000..f4e9de4587 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/properties.js @@ -0,0 +1,149 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.validateProperties = exports.error = void 0; +const code_1 = require("../code"); +const util_1 = require("../../compile/util"); +const codegen_1 = require("../../compile/codegen"); +const metadata_1 = require("./metadata"); +const nullable_1 = require("./nullable"); +const error_1 = require("./error"); +var PropError; +(function (PropError) { + PropError["Additional"] = "additional"; + PropError["Missing"] = "missing"; +})(PropError || (PropError = {})); +exports.error = { + message: (cxt) => { + const { params } = cxt; + return params.propError + ? params.propError === PropError.Additional + ? "must NOT have additional properties" + : `must have property '${params.missingProperty}'` + : (0, error_1.typeErrorMessage)(cxt, "object"); + }, + params: (cxt) => { + const { params } = cxt; + return params.propError + ? params.propError === PropError.Additional + ? (0, codegen_1._) `{error: ${params.propError}, additionalProperty: ${params.additionalProperty}}` + : (0, codegen_1._) `{error: ${params.propError}, missingProperty: ${params.missingProperty}}` + : (0, error_1.typeErrorParams)(cxt, "object"); + }, +}; +const def = { + keyword: "properties", + schemaType: "object", + error: exports.error, + code: validateProperties, +}; +// const error: KeywordErrorDefinition = { +// message: "should NOT have additional properties", +// params: ({params}) => _`{additionalProperty: ${params.additionalProperty}}`, +// } +function validateProperties(cxt) { + (0, metadata_1.checkMetadata)(cxt); + const { gen, data, parentSchema, it } = cxt; + const { additionalProperties, nullable } = parentSchema; + if (it.jtdDiscriminator && nullable) + throw new Error("JTD: nullable inside discriminator mapping"); + if (commonProperties()) { + throw new Error("JTD: properties and optionalProperties have common members"); + } + const [allProps, properties] = schemaProperties("properties"); + const [allOptProps, optProperties] = schemaProperties("optionalProperties"); + if (properties.length === 0 && optProperties.length === 0 && additionalProperties) { + return; + } + const [valid, cond] = it.jtdDiscriminator === undefined + ? (0, nullable_1.checkNullableObject)(cxt, data) + : [gen.let("valid", false), true]; + gen.if(cond, () => gen.assign(valid, true).block(() => { + validateProps(properties, "properties", true); + validateProps(optProperties, "optionalProperties"); + if (!additionalProperties) + validateAdditional(); + })); + cxt.pass(valid); + function commonProperties() { + const props = parentSchema.properties; + const optProps = parentSchema.optionalProperties; + if (!(props && optProps)) + return false; + for (const p in props) { + if (Object.prototype.hasOwnProperty.call(optProps, p)) + return true; + } + return false; + } + function schemaProperties(keyword) { + const schema = parentSchema[keyword]; + const allPs = schema ? (0, code_1.allSchemaProperties)(schema) : []; + if (it.jtdDiscriminator && allPs.some((p) => p === it.jtdDiscriminator)) { + throw new Error(`JTD: discriminator tag used in ${keyword}`); + } + const ps = allPs.filter((p) => !(0, util_1.alwaysValidSchema)(it, schema[p])); + return [allPs, ps]; + } + function validateProps(props, keyword, required) { + const _valid = gen.var("valid"); + for (const prop of props) { + gen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties), () => applyPropertySchema(prop, keyword, _valid), () => missingProperty(prop)); + cxt.ok(_valid); + } + function missingProperty(prop) { + if (required) { + gen.assign(_valid, false); + cxt.error(false, { propError: PropError.Missing, missingProperty: prop }, { schemaPath: prop }); + } + else { + gen.assign(_valid, true); + } + } + } + function applyPropertySchema(prop, keyword, _valid) { + cxt.subschema({ + keyword, + schemaProp: prop, + dataProp: prop, + }, _valid); + } + function validateAdditional() { + gen.forIn("key", data, (key) => { + const addProp = isAdditional(key, allProps, "properties", it.jtdDiscriminator); + const addOptProp = isAdditional(key, allOptProps, "optionalProperties"); + const extra = addProp === true ? addOptProp : addOptProp === true ? addProp : (0, codegen_1.and)(addProp, addOptProp); + gen.if(extra, () => { + if (it.opts.removeAdditional) { + gen.code((0, codegen_1._) `delete ${data}[${key}]`); + } + else { + cxt.error(false, { propError: PropError.Additional, additionalProperty: key }, { instancePath: key, parentSchema: true }); + if (!it.opts.allErrors) + gen.break(); + } + }); + }); + } + function isAdditional(key, props, keyword, jtdDiscriminator) { + let additional; + if (props.length > 8) { + // TODO maybe an option instead of hard-coded 8? + const propsSchema = (0, util_1.schemaRefOrVal)(it, parentSchema[keyword], keyword); + additional = (0, codegen_1.not)((0, code_1.isOwnProperty)(gen, propsSchema, key)); + if (jtdDiscriminator !== undefined) { + additional = (0, codegen_1.and)(additional, (0, codegen_1._) `${key} !== ${jtdDiscriminator}`); + } + } + else if (props.length || jtdDiscriminator !== undefined) { + const ps = jtdDiscriminator === undefined ? props : [jtdDiscriminator].concat(props); + additional = (0, codegen_1.and)(...ps.map((p) => (0, codegen_1._) `${key} !== ${p}`)); + } + else { + additional = true; + } + return additional; + } +} +exports.validateProperties = validateProperties; +exports.default = def; +//# sourceMappingURL=properties.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/properties.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/properties.js.map new file mode 100644 index 0000000000..184111e062 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/properties.js.map @@ -0,0 +1 @@ +{"version":3,"file":"properties.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/properties.ts"],"names":[],"mappings":";;;AAOA,kCAA0E;AAC1E,6CAAoE;AACpE,mDAA6D;AAC7D,yCAAwC;AACxC,yCAA8C;AAC9C,mCAAwE;AAExE,IAAK,SAGJ;AAHD,WAAK,SAAS;IACZ,sCAAyB,CAAA;IACzB,gCAAmB,CAAA;AACrB,CAAC,EAHI,SAAS,KAAT,SAAS,QAGb;AAWY,QAAA,KAAK,GAA2B;IAC3C,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;QACf,MAAM,EAAC,MAAM,EAAC,GAAG,GAAG,CAAA;QACpB,OAAO,MAAM,CAAC,SAAS;YACrB,CAAC,CAAC,MAAM,CAAC,SAAS,KAAK,SAAS,CAAC,UAAU;gBACzC,CAAC,CAAC,qCAAqC;gBACvC,CAAC,CAAC,uBAAuB,MAAM,CAAC,eAAe,GAAG;YACpD,CAAC,CAAC,IAAA,wBAAgB,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;IACrC,CAAC;IACD,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE;QACd,MAAM,EAAC,MAAM,EAAC,GAAG,GAAG,CAAA;QACpB,OAAO,MAAM,CAAC,SAAS;YACrB,CAAC,CAAC,MAAM,CAAC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/vocabularies/jtd/ref.d.ts new file mode 100644 index 0000000000..ccdf84c0be --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/ref.d.ts @@ -0,0 +1,4 @@ +import type { CodeKeywordDefinition, AnySchemaObject } from "../../types"; +declare const def: CodeKeywordDefinition; +export declare function hasRef(schema: AnySchemaObject): boolean; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/ref.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/ref.js new file mode 100644 index 0000000000..b7c6b02d75 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/ref.js @@ -0,0 +1,67 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.hasRef = void 0; +const compile_1 = require("../../compile"); +const codegen_1 = require("../../compile/codegen"); +const ref_error_1 = require("../../compile/ref_error"); +const names_1 = require("../../compile/names"); +const ref_1 = require("../core/ref"); +const metadata_1 = require("./metadata"); +const def = { + keyword: "ref", + schemaType: "string", + code(cxt) { + (0, metadata_1.checkMetadata)(cxt); + const { gen, data, schema: ref, parentSchema, it } = cxt; + const { schemaEnv: { root }, } = it; + const valid = gen.name("valid"); + if (parentSchema.nullable) { + gen.var(valid, (0, codegen_1._) `${data} === null`); + gen.if((0, codegen_1.not)(valid), validateJtdRef); + } + else { + gen.var(valid, false); + validateJtdRef(); + } + cxt.ok(valid); + function validateJtdRef() { + var _a; + const refSchema = (_a = root.schema.definitions) === null || _a === void 0 ? void 0 : _a[ref]; + if (!refSchema) { + throw new ref_error_1.default(it.opts.uriResolver, "", ref, `No definition ${ref}`); + } + if (hasRef(refSchema) || !it.opts.inlineRefs) + callValidate(refSchema); + else + inlineRefSchema(refSchema); + } + function callValidate(schema) { + const sch = compile_1.compileSchema.call(it.self, new compile_1.SchemaEnv({ schema, root, schemaPath: `/definitions/${ref}` })); + const v = (0, ref_1.getValidate)(cxt, sch); + const errsCount = gen.const("_errs", names_1.default.errors); + (0, ref_1.callRef)(cxt, v, sch, sch.$async); + gen.assign(valid, (0, codegen_1._) `${errsCount} === ${names_1.default.errors}`); + } + function inlineRefSchema(schema) { + const schName = gen.scopeValue("schema", it.opts.code.source === true ? { ref: schema, code: (0, codegen_1.stringify)(schema) } : { ref: schema }); + cxt.subschema({ + schema, + dataTypes: [], + schemaPath: codegen_1.nil, + topSchemaRef: schName, + errSchemaPath: `/definitions/${ref}`, + }, valid); + } + }, +}; +function hasRef(schema) { + for (const key in schema) { + let sch; + if (key === "ref" || (typeof (sch = schema[key]) == "object" && hasRef(sch))) + return true; + } + return false; +} +exports.hasRef = hasRef; +exports.default = def; +//# sourceMappingURL=ref.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/ref.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/ref.js.map new file mode 100644 index 0000000000..c15dbf94b2 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/ref.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ref.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/ref.ts"],"names":[],"mappings":";;;AAEA,2CAAsD;AACtD,mDAA4D;AAC5D,uDAAqD;AACrD,+CAAmC;AACnC,qCAAgD;AAChD,yCAAwC;AAExC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,KAAK;IACd,UAAU,EAAE,QAAQ;IACpB,IAAI,CAAC,GAAe;QAClB,IAAA,wBAAa,EAAC,GAAG,CAAC,CAAA;QAClB,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACtD,MAAM,EACJ,SAAS,EAAE,EAAC,IAAI,EAAC,GAClB,GAAG,EAAE,CAAA;QACN,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC/B,IAAI,YAAY,CAAC,QA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AAE,GAAG,CAAC,MAAM,CAAC,CAAA;YAChC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,IAAA,WAAC,EAAA,GAAG,SAAS,QAAQ,eAAC,CAAC,MAAM,EAAE,CAAC,CAAA;QACpD,CAAC;QAED,SAAS,eAAe,CAAC,MAAuB;YAC9C,MAAM,OAAO,GAAG,GAAG,CAAC,UAAU,CAC5B,QAAQ,EACR,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,EAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,IAAA,mBAAS,EAAC,MAAM,CAAC,EAAC,CAAC,CAAC,CAAC,EAAC,GAAG,EAAE,MAAM,EAAC,CACtF,CAAA;YACD,GAAG,CAAC,SAAS,CACX;gBACE,MAAM;gBACN,SAAS,EAAE,EAAE;gBACb,UAAU,EAAE,aAAG;gBACf,YAAY,EAAE,OAAO;gBACrB,aAAa,EAAE,gBAAgB,GAAG,EAAE;aACrC,EACD,KAAK,CACN,CAAA;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,SAAgB,MAAM,CAAC,MAAuB;IAC5C,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;QACzB,IAAI,GAAoB,CAAA;QACxB,IAAI,GAAG,KAAK,KAAK,IAAI,CAAC,OAAO,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,QAAQ,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC;YAAE,OAAO,IAAI,CAAA;IAC3F,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC;AAND,wBAMC;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/type.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/type.d.ts new file mode 100644 index 0000000000..a115c7dade --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/type.d.ts @@ -0,0 +1,10 @@ +import type { CodeKeywordDefinition } from "../../types"; +import { _JTDTypeError } from "./error"; +export type JTDTypeError = _JTDTypeError<"type", JTDType, JTDType>; +export type IntType = "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32"; +export declare const intRange: { + [T in IntType]: [number, number, number]; +}; +export type JTDType = "boolean" | "string" | "timestamp" | "float32" | "float64" | IntType; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/type.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/type.js new file mode 100644 index 0000000000..17a0b51079 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/type.js @@ -0,0 +1,69 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.intRange = void 0; +const codegen_1 = require("../../compile/codegen"); +const timestamp_1 = require("../../runtime/timestamp"); +const util_1 = require("../../compile/util"); +const metadata_1 = require("./metadata"); +const error_1 = require("./error"); +exports.intRange = { + int8: [-128, 127, 3], + uint8: [0, 255, 3], + int16: [-32768, 32767, 5], + uint16: [0, 65535, 5], + int32: [-2147483648, 2147483647, 10], + uint32: [0, 4294967295, 10], +}; +const error = { + message: (cxt) => (0, error_1.typeErrorMessage)(cxt, cxt.schema), + params: (cxt) => (0, error_1.typeErrorParams)(cxt, cxt.schema), +}; +function timestampCode(cxt) { + const { gen, data, it } = cxt; + const { timestamp, allowDate } = it.opts; + if (timestamp === "date") + return (0, codegen_1._) `${data} instanceof Date `; + const vts = (0, util_1.useFunc)(gen, timestamp_1.default); + const allowDateArg = allowDate ? (0, codegen_1._) `, true` : codegen_1.nil; + const validString = (0, codegen_1._) `typeof ${data} == "string" && ${vts}(${data}${allowDateArg})`; + return timestamp === "string" ? validString : (0, codegen_1.or)((0, codegen_1._) `${data} instanceof Date`, validString); +} +const def = { + keyword: "type", + schemaType: "string", + error, + code(cxt) { + (0, metadata_1.checkMetadata)(cxt); + const { data, schema, parentSchema, it } = cxt; + let cond; + switch (schema) { + case "boolean": + case "string": + cond = (0, codegen_1._) `typeof ${data} == ${schema}`; + break; + case "timestamp": { + cond = timestampCode(cxt); + break; + } + case "float32": + case "float64": + cond = (0, codegen_1._) `typeof ${data} == "number"`; + break; + default: { + const sch = schema; + cond = (0, codegen_1._) `typeof ${data} == "number" && isFinite(${data}) && !(${data} % 1)`; + if (!it.opts.int32range && (sch === "int32" || sch === "uint32")) { + if (sch === "uint32") + cond = (0, codegen_1._) `${cond} && ${data} >= 0`; + } + else { + const [min, max] = exports.intRange[sch]; + cond = (0, codegen_1._) `${cond} && ${data} >= ${min} && ${data} <= ${max}`; + } + } + } + cxt.pass(parentSchema.nullable ? (0, codegen_1.or)((0, codegen_1._) `${data} === null`, cond) : cond); + }, +}; +exports.default = def; +//# sourceMappingURL=type.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/type.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/type.js.map new file mode 100644 index 0000000000..cf538ed032 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/type.js.map @@ -0,0 +1 @@ +{"version":3,"file":"type.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/type.ts"],"names":[],"mappings":";;;AAEA,mDAAsD;AACtD,uDAAoD;AACpD,6CAA0C;AAC1C,yCAAwC;AACxC,mCAAwE;AAM3D,QAAA,QAAQ,GAA+C;IAClE,IAAI,EAAE,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;IACpB,KAAK,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;IAClB,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IACzB,MAAM,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IACrB,KAAK,EAAE,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE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AAC,CAAC,IAAI,CAAC,CAAA;IACxE,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/union.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/union.d.ts new file mode 100644 index 0000000000..cde2aa2700 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/union.d.ts @@ -0,0 +1,3 @@ +import type { CodeKeywordDefinition } from "../../types"; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/union.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/union.js new file mode 100644 index 0000000000..01a943994a --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/union.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const code_1 = require("../code"); +const def = { + keyword: "union", + schemaType: "array", + trackErrors: true, + code: code_1.validateUnion, + error: { message: "must match a schema in union" }, +}; +exports.default = def; +//# sourceMappingURL=union.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/union.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/union.js.map new file mode 100644 index 0000000000..4d6eb4119b --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/union.js.map @@ -0,0 +1 @@ +{"version":3,"file":"union.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/union.ts"],"names":[],"mappings":";;AACA,kCAAqC;AAErC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE,OAAO;IACnB,WAAW,EAAE,IAAI;IACjB,IAAI,EAAE,oBAAa;IACnB,KAAK,EAAE,EAAC,OAAO,EAAE,8BAA8B,EAAC;CACjD,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/values.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/values.d.ts new file mode 100644 index 0000000000..1eaa884a53 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/values.d.ts @@ -0,0 +1,5 @@ +import type { CodeKeywordDefinition, SchemaObject } from "../../types"; +import { _JTDTypeError } from "./error"; +export type JTDValuesError = _JTDTypeError<"values", "object", SchemaObject>; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/values.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/values.js new file mode 100644 index 0000000000..3c2c95f55d --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/values.js @@ -0,0 +1,51 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const util_1 = require("../../compile/util"); +const codegen_1 = require("../../compile/codegen"); +const metadata_1 = require("./metadata"); +const nullable_1 = require("./nullable"); +const error_1 = require("./error"); +const def = { + keyword: "values", + schemaType: "object", + error: (0, error_1.typeError)("object"), + code(cxt) { + (0, metadata_1.checkMetadata)(cxt); + const { gen, data, schema, it } = cxt; + const [valid, cond] = (0, nullable_1.checkNullableObject)(cxt, data); + if ((0, util_1.alwaysValidSchema)(it, schema)) { + gen.if((0, codegen_1.not)((0, codegen_1.or)(cond, valid)), () => cxt.error()); + } + else { + gen.if(cond); + gen.assign(valid, validateMap()); + gen.elseIf((0, codegen_1.not)(valid)); + cxt.error(); + gen.endIf(); + } + cxt.ok(valid); + function validateMap() { + const _valid = gen.name("valid"); + if (it.allErrors) { + const validMap = gen.let("valid", true); + validateValues(() => gen.assign(validMap, false)); + return validMap; + } + gen.var(_valid, true); + validateValues(() => gen.break()); + return _valid; + function validateValues(notValid) { + gen.forIn("key", data, (key) => { + cxt.subschema({ + keyword: "values", + dataProp: key, + dataPropType: util_1.Type.Str, + }, _valid); + gen.if((0, codegen_1.not)(_valid), notValid); + }); + } + } + }, +}; +exports.default = def; +//# sourceMappingURL=values.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/values.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/values.js.map new file mode 100644 index 0000000000..8a1a5c2339 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/jtd/values.js.map @@ -0,0 +1 @@ +{"version":3,"file":"values.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/values.ts"],"names":[],"mappings":";;AAEA,6CAA0D;AAC1D,mDAAmD;AACnD,yCAAwC;AACxC,yCAA8C;AAC9C,mCAAgD;AAIhD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,QAAQ;IACjB,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAA,iBAAS,EAAC,QAAQ,CAAC;IAC1B,IAAI,CAAC,GAAe;QAClB,IAAA,wBAAa,EAAC,GAAG,CAAC,CAAA;QAClB,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACnC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,IAAA,8BAAmB,EAAC,GAAG,EAAE,IAAI,CAAC,CAAA;QACpD,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC;YAClC,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,IAAA,YAAE,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAA;QACjD,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,CAAA;YACZ,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,WAAW,EAAE,CAAC,CAAA;YAChC,GAAG,CAAC,MAAM,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,CAAC,CAAA;YACtB,GAAG,CAAC,KAAK,EAAE,CAAA;YACX,GAAG,CAAC,KAAK,EAAE,CAAA;QACb,CAAC;QACD,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;QAEb,SAAS,WAAW;YAClB,MAAM,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;YAChC,IAAI,EAAE,CAAC,SAAS,EAAE,CAAC;gBACjB,MAAM,QAAQ,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;gBACvC,cAAc,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAA;gBACjD,OAAO,QAAQ,CAAA;YACjB,CAAC;YACD,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;YACrB,cAAc,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAA;YACjC,OAAO,MAAM,CAAA;YAEb,SAAS,cAAc,CAAC,QAAoB;gBAC1C,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE;oBAC7B,GAAG,CAAC,SAAS,CACX;wBACE,OAAO,EAAE,QAAQ;wBACjB,QAAQ,EAAE,GAAG;wBACb,YAAY,EAAE,WAAI,CAAC,GAAG;qBACvB,EACD,MAAM,CACP,CAAA;oBACD,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,CAAA;gBAC/B,CAAC,CAAC,CAAA;YACJ,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/metadata.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/metadata.d.ts new file mode 100644 index 0000000000..df9cc07ca8 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/metadata.d.ts @@ -0,0 +1,3 @@ +import type { Vocabulary } from "../types"; +export declare const metadataVocabulary: Vocabulary; +export declare const contentVocabulary: Vocabulary; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/metadata.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/metadata.js new file mode 100644 index 0000000000..f07bf28b5a --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/metadata.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.contentVocabulary = exports.metadataVocabulary = void 0; +exports.metadataVocabulary = [ + "title", + "description", + "default", + "deprecated", + "readOnly", + "writeOnly", + "examples", +]; +exports.contentVocabulary = [ + "contentMediaType", + "contentEncoding", + "contentSchema", +]; +//# sourceMappingURL=metadata.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/metadata.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/metadata.js.map new file mode 100644 index 0000000000..0d61f08318 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/metadata.js.map @@ -0,0 +1 @@ +{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../lib/vocabularies/metadata.ts"],"names":[],"mappings":";;;AAEa,QAAA,kBAAkB,GAAe;IAC5C,OAAO;IACP,aAAa;IACb,SAAS;IACT,YAAY;IACZ,UAAU;IACV,WAAW;IACX,UAAU;CACX,CAAA;AAEY,QAAA,iBAAiB,GAAe;IAC3C,kBAAkB;IAClB,iBAAiB;IACjB,eAAe;CAChB,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/next.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/next.d.ts new file mode 100644 index 0000000000..7fd5c644b2 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/next.d.ts @@ -0,0 +1,3 @@ +import type { Vocabulary } from "../types"; +declare const next: Vocabulary; +export default next; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/next.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/next.js new file mode 100644 index 0000000000..c861b32433 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/next.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const dependentRequired_1 = require("./validation/dependentRequired"); +const dependentSchemas_1 = require("./applicator/dependentSchemas"); +const limitContains_1 = require("./validation/limitContains"); +const next = [dependentRequired_1.default, dependentSchemas_1.default, limitContains_1.default]; +exports.default = next; +//# sourceMappingURL=next.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/next.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/next.js.map new file mode 100644 index 0000000000..474a6d4e7a --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/next.js.map @@ -0,0 +1 @@ +{"version":3,"file":"next.js","sourceRoot":"","sources":["../../lib/vocabularies/next.ts"],"names":[],"mappings":";;AACA,sEAA8D;AAC9D,oEAA4D;AAC5D,8DAAsD;AAEtD,MAAM,IAAI,GAAe,CAAC,2BAAiB,EAAE,0BAAgB,EAAE,uBAAa,CAAC,CAAA;AAE7E,kBAAe,IAAI,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/unevaluated/index.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/unevaluated/index.d.ts new file mode 100644 index 0000000000..ec67e63ea0 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/unevaluated/index.d.ts @@ -0,0 +1,3 @@ +import type { Vocabulary } from "../../types"; +declare const unevaluated: Vocabulary; +export default unevaluated; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/unevaluated/index.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/unevaluated/index.js new file mode 100644 index 0000000000..30e316748d --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/unevaluated/index.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const unevaluatedProperties_1 = require("./unevaluatedProperties"); +const unevaluatedItems_1 = require("./unevaluatedItems"); +const unevaluated = [unevaluatedProperties_1.default, unevaluatedItems_1.default]; +exports.default = unevaluated; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/unevaluated/index.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/unevaluated/index.js.map new file mode 100644 index 0000000000..a4872ea43a --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/unevaluated/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/unevaluated/index.ts"],"names":[],"mappings":";;AACA,mEAA2D;AAC3D,yDAAiD;AAEjD,MAAM,WAAW,GAAe,CAAC,+BAAqB,EAAE,0BAAgB,CAAC,CAAA;AAEzE,kBAAe,WAAW,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/unevaluated/unevaluatedItems.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/unevaluated/unevaluatedItems.d.ts new file mode 100644 index 0000000000..06f0239266 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/unevaluated/unevaluatedItems.d.ts @@ -0,0 +1,6 @@ +import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types"; +export type UnevaluatedItemsError = ErrorObject<"unevaluatedItems", { + limit: number; +}, AnySchema>; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js new file mode 100644 index 0000000000..0a0cd3aa4f --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js @@ -0,0 +1,40 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const util_1 = require("../../compile/util"); +const error = { + message: ({ params: { len } }) => (0, codegen_1.str) `must NOT have more than ${len} items`, + params: ({ params: { len } }) => (0, codegen_1._) `{limit: ${len}}`, +}; +const def = { + keyword: "unevaluatedItems", + type: "array", + schemaType: ["boolean", "object"], + error, + code(cxt) { + const { gen, schema, data, it } = cxt; + const items = it.items || 0; + if (items === true) + return; + const len = gen.const("len", (0, codegen_1._) `${data}.length`); + if (schema === false) { + cxt.setParams({ len: items }); + cxt.fail((0, codegen_1._) `${len} > ${items}`); + } + else if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) { + const valid = gen.var("valid", (0, codegen_1._) `${len} <= ${items}`); + gen.if((0, codegen_1.not)(valid), () => validateItems(valid, items)); + cxt.ok(valid); + } + it.items = true; + function validateItems(valid, from) { + gen.forRange("i", from, len, (i) => { + cxt.subschema({ keyword: "unevaluatedItems", dataProp: i, dataPropType: util_1.Type.Num }, valid); + if (!it.allErrors) + gen.if((0, codegen_1.not)(valid), () => gen.break()); + }); + } + }, +}; +exports.default = def; +//# sourceMappingURL=unevaluatedItems.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js.map new file mode 100644 index 0000000000..b91f86e272 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js.map @@ -0,0 +1 @@ +{"version":3,"file":"unevaluatedItems.js","sourceRoot":"","sources":["../../../lib/vocabularies/unevaluated/unevaluatedItems.ts"],"names":[],"mappings":";;AA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E,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAA;YACrD,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;QACf,CAAC;QACD,EAAE,CAAC,KAAK,GAAG,IAAI,CAAA;QAEf,SAAS,aAAa,CAAC,KAAW,EAAE,IAAmB;YACrD,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE;gBACjC,GAAG,CAAC,SAAS,CAAC,EAAC,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,CAAC,EAAE,YAAY,EAAE,WAAI,CAAC,GAAG,EAAC,EAAE,KAAK,CAAC,CAAA;gBACxF,IAAI,CAAC,EAAE,CAAC,SAAS;oBAAE,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAA;YAC1D,CAAC,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.d.ts new file mode 100644 index 0000000000..ba63f62e85 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.d.ts @@ -0,0 +1,6 @@ +import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types"; +export type UnevaluatedPropertiesError = ErrorObject<"unevaluatedProperties", { + unevaluatedProperty: string; +}, AnySchema>; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js new file mode 100644 index 0000000000..ad298499f2 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js @@ -0,0 +1,65 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const util_1 = require("../../compile/util"); +const names_1 = require("../../compile/names"); +const error = { + message: "must NOT have unevaluated properties", + params: ({ params }) => (0, codegen_1._) `{unevaluatedProperty: ${params.unevaluatedProperty}}`, +}; +const def = { + keyword: "unevaluatedProperties", + type: "object", + schemaType: ["boolean", "object"], + trackErrors: true, + error, + code(cxt) { + const { gen, schema, data, errsCount, it } = cxt; + /* istanbul ignore if */ + if (!errsCount) + throw new Error("ajv implementation error"); + const { allErrors, props } = it; + if (props instanceof codegen_1.Name) { + gen.if((0, codegen_1._) `${props} !== true`, () => gen.forIn("key", data, (key) => gen.if(unevaluatedDynamic(props, key), () => unevaluatedPropCode(key)))); + } + else if (props !== true) { + gen.forIn("key", data, (key) => props === undefined + ? unevaluatedPropCode(key) + : gen.if(unevaluatedStatic(props, key), () => unevaluatedPropCode(key))); + } + it.props = true; + cxt.ok((0, codegen_1._) `${errsCount} === ${names_1.default.errors}`); + function unevaluatedPropCode(key) { + if (schema === false) { + cxt.setParams({ unevaluatedProperty: key }); + cxt.error(); + if (!allErrors) + gen.break(); + return; + } + if (!(0, util_1.alwaysValidSchema)(it, schema)) { + const valid = gen.name("valid"); + cxt.subschema({ + keyword: "unevaluatedProperties", + dataProp: key, + dataPropType: util_1.Type.Str, + }, valid); + if (!allErrors) + gen.if((0, codegen_1.not)(valid), () => gen.break()); + } + } + function unevaluatedDynamic(evaluatedProps, key) { + return (0, codegen_1._) `!${evaluatedProps} || !${evaluatedProps}[${key}]`; + } + function unevaluatedStatic(evaluatedProps, key) { + const ps = []; + for (const p in evaluatedProps) { + if (evaluatedProps[p] === true) + ps.push((0, codegen_1._) `${key} !== ${p}`); + } + return (0, codegen_1.and)(...ps); + } + }, +}; +exports.default = def; +//# sourceMappingURL=unevaluatedProperties.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js.map new file mode 100644 index 0000000000..f83022ebcf --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js.map @@ -0,0 +1 @@ +{"version":3,"file":"unevaluatedProperties.js","sourceRoot":"","sources":["../../../lib/vocabularies/unevaluated/unevaluatedProperties.ts"],"names":[],"mappings":";;AAMA,mDAA6D;AAC7D,6CAA0D;AAC1D,+CAAmC;AAQnC,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,sCAAsC;IAC/C,MAAM,EAAE,CAAC,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,yBAAyB,MAAM,CAAC,mBAAmB,GAAG;CAC9E,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,uBAAuB;IAChC,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC;IACjC,WAAW,EAAE,IAAI;IACjB,KAAK;IACL,IAAI,CAAC,GAAG;QACN,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QAC9C,wBAAwB;QACxB,IAAI,CAAC,SAAS;YAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;QAC3D,MAAM,EAAC,SAAS,EAAE,KAAK,EAAC,GAAG,EAAE,CAAA;QAC7B,IAAI,KAAK,YAAY,cAAI,EAAE,CAAC;YAC1B,GAAG,CAAC,EAAE,CAAC,IAAA,WAAC,EAAA,GAAG,KAAK,WAAW,EAAE,GAAG,EAAE,CAChC,GAAG,CAAC,KAAK,CAAC,KAA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iBACvB,EACD,KAAK,CACN,CAAA;gBACD,IAAI,CAAC,SAAS;oBAAE,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAA;YACvD,CAAC;QACH,CAAC;QAED,SAAS,kBAAkB,CAAC,cAAoB,EAAE,GAAS;YACzD,OAAO,IAAA,WAAC,EAAA,IAAI,cAAc,QAAQ,cAAc,IAAI,GAAG,GAAG,CAAA;QAC5D,CAAC;QAED,SAAS,iBAAiB,CAAC,cAAsC,EAAE,GAAS;YAC1E,MAAM,EAAE,GAAW,EAAE,CAAA;YACrB,KAAK,MAAM,CAAC,IAAI,cAAc,EAAE,CAAC;gBAC/B,IAAI,cAAc,CAAC,CAAC,CAAC,KAAK,IAAI;oBAAE,EAAE,CAAC,IAAI,CAAC,IAAA,WAAC,EAAA,GAAG,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAA;YAC7D,CAAC;YACD,OAAO,IAAA,aAAG,EAAC,GAAG,EAAE,CAAC,CAAA;QACnB,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/const.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/const.d.ts new file mode 100644 index 0000000000..af91a90070 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/const.d.ts @@ -0,0 +1,6 @@ +import type { CodeKeywordDefinition, ErrorObject } from "../../types"; +export type ConstError = ErrorObject<"const", { + allowedValue: any; +}>; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/const.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/const.js new file mode 100644 index 0000000000..9564496a65 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/const.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const util_1 = require("../../compile/util"); +const equal_1 = require("../../runtime/equal"); +const error = { + message: "must be equal to constant", + params: ({ schemaCode }) => (0, codegen_1._) `{allowedValue: ${schemaCode}}`, +}; +const def = { + keyword: "const", + $data: true, + error, + code(cxt) { + const { gen, data, $data, schemaCode, schema } = cxt; + if ($data || (schema && typeof schema == "object")) { + cxt.fail$data((0, codegen_1._) `!${(0, util_1.useFunc)(gen, equal_1.default)}(${data}, ${schemaCode})`); + } + else { + cxt.fail((0, codegen_1._) `${schema} !== ${data}`); + } + }, +}; +exports.default = def; +//# sourceMappingURL=const.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/const.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/const.js.map new file mode 100644 index 0000000000..63cfe60d62 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/const.js.map @@ -0,0 +1 @@ +{"version":3,"file":"const.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/const.ts"],"names":[],"mappings":";;AAEA,mDAAuC;AACvC,6CAA0C;AAC1C,+CAAuC;AAIvC,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,2BAA2B;IACpC,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,kBAAkB,UAAU,GAAG;CAC3D,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,OAAO;IAChB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAC,GAAG,GAAG,CAAA;QAClD,IAAI,KAAK,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,IAAI,QAAQ,CAAC,EAAE,CAAC;YACnD,GAAG,CAAC,SAAS,CAAC,IAAA,WAAC,EAAA,IAAI,IAAA,cAAO,EAAC,GAAG,EAAE,eAAK,CAAC,IAAI,IAAI,KAAK,UAAU,GAAG,CAAC,CAAA;QACnE,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,IAAI,CAAC,IAAA,WAAC,EAAA,GAAG,MAAM,QAAQ,IAAI,EAAE,CAAC,CAAA;QACpC,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/dependentRequired.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/dependentRequired.d.ts new file mode 100644 index 0000000000..00f0d370f3 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/dependentRequired.d.ts @@ -0,0 +1,5 @@ +import type { CodeKeywordDefinition, ErrorObject } from "../../types"; +import { DependenciesErrorParams, PropertyDependencies } from "../applicator/dependencies"; +export type DependentRequiredError = ErrorObject<"dependentRequired", DependenciesErrorParams, PropertyDependencies>; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/dependentRequired.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/dependentRequired.js new file mode 100644 index 0000000000..09e59639fc --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/dependentRequired.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const dependencies_1 = require("../applicator/dependencies"); +const def = { + keyword: "dependentRequired", + type: "object", + schemaType: "object", + error: dependencies_1.error, + code: (cxt) => (0, dependencies_1.validatePropertyDeps)(cxt), +}; +exports.default = def; +//# sourceMappingURL=dependentRequired.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/dependentRequired.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/dependentRequired.js.map new file mode 100644 index 0000000000..c7e88f885d --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/dependentRequired.js.map @@ -0,0 +1 @@ +{"version":3,"file":"dependentRequired.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/dependentRequired.ts"],"names":[],"mappings":";;AACA,6DAKmC;AAQnC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,mBAAmB;IAC5B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAL,oBAAK;IACL,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,mCAAoB,EAAC,GAAG,CAAC;CACzC,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/enum.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/enum.d.ts new file mode 100644 index 0000000000..6231082fef --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/enum.d.ts @@ -0,0 +1,8 @@ +import type { CodeKeywordDefinition, ErrorObject } from "../../types"; +export type EnumError = ErrorObject<"enum", { + allowedValues: any[]; +}, any[] | { + $data: string; +}>; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/enum.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/enum.js new file mode 100644 index 0000000000..eab6487e99 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/enum.js @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const util_1 = require("../../compile/util"); +const equal_1 = require("../../runtime/equal"); +const error = { + message: "must be equal to one of the allowed values", + params: ({ schemaCode }) => (0, codegen_1._) `{allowedValues: ${schemaCode}}`, +}; +const def = { + keyword: "enum", + schemaType: "array", + $data: true, + error, + code(cxt) { + const { gen, data, $data, schema, schemaCode, it } = cxt; + if (!$data && schema.length === 0) + throw new Error("enum must have non-empty array"); + const useLoop = schema.length >= it.opts.loopEnum; + let eql; + const getEql = () => (eql !== null && eql !== void 0 ? eql : (eql = (0, util_1.useFunc)(gen, equal_1.default))); + let valid; + if (useLoop || $data) { + valid = gen.let("valid"); + cxt.block$data(valid, loopEnum); + } + else { + /* istanbul ignore if */ + if (!Array.isArray(schema)) + throw new Error("ajv implementation error"); + const vSchema = gen.const("vSchema", schemaCode); + valid = (0, codegen_1.or)(...schema.map((_x, i) => equalCode(vSchema, i))); + } + cxt.pass(valid); + function loopEnum() { + gen.assign(valid, false); + gen.forOf("v", schemaCode, (v) => gen.if((0, codegen_1._) `${getEql()}(${data}, ${v})`, () => gen.assign(valid, true).break())); + } + function equalCode(vSchema, i) { + const sch = schema[i]; + return typeof sch === "object" && sch !== null + ? (0, codegen_1._) `${getEql()}(${data}, ${vSchema}[${i}])` + : (0, codegen_1._) `${data} === ${sch}`; + } + }, +}; +exports.default = def; +//# sourceMappingURL=enum.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/enum.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/enum.js.map new file mode 100644 index 0000000000..33afdcf0d8 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/enum.js.map @@ -0,0 +1 @@ +{"version":3,"file":"enum.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/enum.ts"],"names":[],"mappings":";;AAEA,mDAAuD;AACvD,6CAA0C;AAC1C,+CAAuC;AAIvC,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,4CAA4C;IACrD,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,mBAAmB,UAAU,GAAG;CAC5D,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,MAAM;IACf,UA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KAAK,EAAE,KAAK,CAAC,CAAA;YACxB,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,UAAkB,EAAE,CAAC,CAAC,EAAE,EAAE,CACvC,GAAG,CAAC,EAAE,CAAC,IAAA,WAAC,EAAA,GAAG,MAAM,EAAE,IAAI,IAAI,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC,CAC7E,CAAA;QACH,CAAC;QAED,SAAS,SAAS,CAAC,OAAa,EAAE,CAAS;YACzC,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAA;YACrB,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI;gBAC5C,CAAC,CAAC,IAAA,WAAC,EAAA,GAAG,MAAM,EAAE,IAAI,IAAI,KAAK,OAAO,IAAI,CAAC,IAAI;gBAC3C,CAAC,CAAC,IAAA,WAAC,EAAA,GAAG,IAAI,QAAQ,GAAG,EAAE,CAAA;QAC3B,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/index.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/index.d.ts new file mode 100644 index 0000000000..a078be554b --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/index.d.ts @@ -0,0 +1,16 @@ +import type { ErrorObject, Vocabulary } from "../../types"; +import { LimitNumberError } from "./limitNumber"; +import { MultipleOfError } from "./multipleOf"; +import { PatternError } from "./pattern"; +import { RequiredError } from "./required"; +import { UniqueItemsError } from "./uniqueItems"; +import { ConstError } from "./const"; +import { EnumError } from "./enum"; +declare const validation: Vocabulary; +export default validation; +type LimitError = ErrorObject<"maxItems" | "minItems" | "minProperties" | "maxProperties" | "minLength" | "maxLength", { + limit: number; +}, number | { + $data: string; +}>; +export type ValidationKeywordError = LimitError | LimitNumberError | MultipleOfError | PatternError | RequiredError | UniqueItemsError | ConstError | EnumError; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/index.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/index.js new file mode 100644 index 0000000000..7b56b4e453 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/index.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const limitNumber_1 = require("./limitNumber"); +const multipleOf_1 = require("./multipleOf"); +const limitLength_1 = require("./limitLength"); +const pattern_1 = require("./pattern"); +const limitProperties_1 = require("./limitProperties"); +const required_1 = require("./required"); +const limitItems_1 = require("./limitItems"); +const uniqueItems_1 = require("./uniqueItems"); +const const_1 = require("./const"); +const enum_1 = require("./enum"); +const validation = [ + // number + limitNumber_1.default, + multipleOf_1.default, + // string + limitLength_1.default, + pattern_1.default, + // object + limitProperties_1.default, + required_1.default, + // array + limitItems_1.default, + uniqueItems_1.default, + // any + { keyword: "type", schemaType: ["string", "array"] }, + { keyword: "nullable", schemaType: "boolean" }, + const_1.default, + enum_1.default, +]; +exports.default = validation; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/index.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/index.js.map new file mode 100644 index 0000000000..69436fb327 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/index.ts"],"names":[],"mappings":";;AACA,+CAA2D;AAC3D,6CAAwD;AACxD,+CAAuC;AACvC,uCAA+C;AAC/C,uDAA+C;AAC/C,yCAAkD;AAClD,6CAAqC;AACrC,+CAA2D;AAC3D,mCAAgD;AAChD,iCAA6C;AAE7C,MAAM,UAAU,GAAe;IAC7B,SAAS;IACT,qBAAW;IACX,oBAAU;IACV,SAAS;IACT,qBAAW;IACX,iBAAO;IACP,SAAS;IACT,yBAAe;IACf,kBAAQ;IACR,QAAQ;IACR,oBAAU;IACV,qBAAW;IACX,MAAM;IACN,EAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAC;IAClD,EAAC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAC;IAC5C,eAAY;IACZ,cAAW;CACZ,CAAA;AAED,kBAAe,UAAU,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitContains.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitContains.d.ts new file mode 100644 index 0000000000..cde2aa2700 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitContains.d.ts @@ -0,0 +1,3 @@ +import type { CodeKeywordDefinition } from "../../types"; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitContains.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitContains.js new file mode 100644 index 0000000000..c884dae4bb --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitContains.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const util_1 = require("../../compile/util"); +const def = { + keyword: ["maxContains", "minContains"], + type: "array", + schemaType: "number", + code({ keyword, parentSchema, it }) { + if (parentSchema.contains === undefined) { + (0, util_1.checkStrictMode)(it, `"${keyword}" without "contains" is ignored`); + } + }, +}; +exports.default = def; +//# sourceMappingURL=limitContains.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitContains.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitContains.js.map new file mode 100644 index 0000000000..084ee2cd26 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitContains.js.map @@ -0,0 +1 @@ +{"version":3,"file":"limitContains.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/limitContains.ts"],"names":[],"mappings":";;AAEA,6CAAkD;AAElD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,CAAC,aAAa,EAAE,aAAa,CAAC;IACvC,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,QAAQ;IACpB,IAAI,CAAC,EAAC,OAAO,EAAE,YAAY,EAAE,EAAE,EAAa;QAC1C,IAAI,YAAY,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;YACxC,IAAA,sBAAe,EAAC,EAAE,EAAE,IAAI,OAAO,iCAAiC,CAAC,CAAA;QACnE,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitItems.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitItems.d.ts new file mode 100644 index 0000000000..cde2aa2700 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitItems.d.ts @@ -0,0 +1,3 @@ +import type { CodeKeywordDefinition } from "../../types"; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitItems.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitItems.js new file mode 100644 index 0000000000..e1386f887c --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitItems.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const error = { + message({ keyword, schemaCode }) { + const comp = keyword === "maxItems" ? "more" : "fewer"; + return (0, codegen_1.str) `must NOT have ${comp} than ${schemaCode} items`; + }, + params: ({ schemaCode }) => (0, codegen_1._) `{limit: ${schemaCode}}`, +}; +const def = { + keyword: ["maxItems", "minItems"], + type: "array", + schemaType: "number", + $data: true, + error, + code(cxt) { + const { keyword, data, schemaCode } = cxt; + const op = keyword === "maxItems" ? codegen_1.operators.GT : codegen_1.operators.LT; + cxt.fail$data((0, codegen_1._) `${data}.length ${op} ${schemaCode}`); + }, +}; +exports.default = def; +//# sourceMappingURL=limitItems.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitItems.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitItems.js.map new file mode 100644 index 0000000000..690c734567 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitItems.js.map @@ -0,0 +1 @@ +{"version":3,"file":"limitItems.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/limitItems.ts"],"names":[],"mappings":";;AAEA,mDAAuD;AAEvD,MAAM,KAAK,GAA2B;IACpC,OAAO,CAAC,EAAC,OAAO,EAAE,UAAU,EAAC;QAC3B,MAAM,IAAI,GAAG,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAA;QACtD,OAAO,IAAA,aAAG,EAAA,iBAAiB,IAAI,SAAS,UAAU,QAAQ,CAAA;IAC5D,CAAC;IACD,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,WAAW,UAAU,GAAG;CACpD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;IACjC,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAC,GAAG,GAAG,CAAA;QACvC,MAAM,EAAE,GAAG,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,mBAAS,CAAC,EAAE,CAAC,CAAC,CAAC,mBAAS,CAAC,EAAE,CAAA;QAC/D,GAAG,CAAC,SAAS,CAAC,IAAA,WAAC,EAAA,GAAG,IAAI,WAAW,EAAE,IAAI,UAAU,EAAE,CAAC,CAAA;IACtD,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitLength.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitLength.d.ts new file mode 100644 index 0000000000..cde2aa2700 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitLength.d.ts @@ -0,0 +1,3 @@ +import type { CodeKeywordDefinition } from "../../types"; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitLength.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitLength.js new file mode 100644 index 0000000000..6ae5f92e67 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitLength.js @@ -0,0 +1,27 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const util_1 = require("../../compile/util"); +const ucs2length_1 = require("../../runtime/ucs2length"); +const error = { + message({ keyword, schemaCode }) { + const comp = keyword === "maxLength" ? "more" : "fewer"; + return (0, codegen_1.str) `must NOT have ${comp} than ${schemaCode} characters`; + }, + params: ({ schemaCode }) => (0, codegen_1._) `{limit: ${schemaCode}}`, +}; +const def = { + keyword: ["maxLength", "minLength"], + type: "string", + schemaType: "number", + $data: true, + error, + code(cxt) { + const { keyword, data, schemaCode, it } = cxt; + const op = keyword === "maxLength" ? codegen_1.operators.GT : codegen_1.operators.LT; + const len = it.opts.unicode === false ? (0, codegen_1._) `${data}.length` : (0, codegen_1._) `${(0, util_1.useFunc)(cxt.gen, ucs2length_1.default)}(${data})`; + cxt.fail$data((0, codegen_1._) `${len} ${op} ${schemaCode}`); + }, +}; +exports.default = def; +//# sourceMappingURL=limitLength.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitLength.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitLength.js.map new file mode 100644 index 0000000000..f09c35e543 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitLength.js.map @@ -0,0 +1 @@ +{"version":3,"file":"limitLength.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/limitLength.ts"],"names":[],"mappings":";;AAEA,mDAAuD;AACvD,6CAA0C;AAC1C,yDAAiD;AAEjD,MAAM,KAAK,GAA2B;IACpC,OAAO,CAAC,EAAC,OAAO,EAAE,UAAU,EAAC;QAC3B,MAAM,IAAI,GAAG,OAAO,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAA;QACvD,OAAO,IAAA,aAAG,EAAA,iBAAiB,IAAI,SAAS,UAAU,aAAa,CAAA;IACjE,CAAC;IACD,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,WAAW,UAAU,GAAG;CACpD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,CAAC,WAAW,EAAE,WAAW,CAAC;IACnC,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QAC3C,MAAM,EAAE,GAAG,OAAO,KAAK,WAAW,CAAC,CAAC,CAAC,mBAAS,CAAC,EAAE,CAAC,CAAC,CAAC,mBAAS,CAAC,EAAE,CAAA;QAChE,MAAM,GAAG,GACP,EAAE,CAAC,IAAI,CAAC,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,IAAA,WAAC,EAAA,GAAG,IAAI,SAAS,CAAC,CAAC,CAAC,IAAA,WAAC,EAAA,GAAG,IAAA,cAAO,EAAC,GAAG,CAAC,GAAG,EAAE,oBAAU,CAAC,IAAI,IAAI,GAAG,CAAA;QAC7F,GAAG,CAAC,SAAS,CAAC,IAAA,WAAC,EAAA,GAAG,GAAG,IAAI,EAAE,IAAI,UAAU,EAAE,CAAC,CAAA;IAC9C,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitNumber.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitNumber.d.ts new file mode 100644 index 0000000000..7b35096dff --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitNumber.d.ts @@ -0,0 +1,11 @@ +import type { CodeKeywordDefinition, ErrorObject } from "../../types"; +type Kwd = "maximum" | "minimum" | "exclusiveMaximum" | "exclusiveMinimum"; +type Comparison = "<=" | ">=" | "<" | ">"; +export type LimitNumberError = ErrorObject; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitNumber.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitNumber.js new file mode 100644 index 0000000000..a97c0eb9db --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitNumber.js @@ -0,0 +1,27 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const ops = codegen_1.operators; +const KWDs = { + maximum: { okStr: "<=", ok: ops.LTE, fail: ops.GT }, + minimum: { okStr: ">=", ok: ops.GTE, fail: ops.LT }, + exclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE }, + exclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE }, +}; +const error = { + message: ({ keyword, schemaCode }) => (0, codegen_1.str) `must be ${KWDs[keyword].okStr} ${schemaCode}`, + params: ({ keyword, schemaCode }) => (0, codegen_1._) `{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}`, +}; +const def = { + keyword: Object.keys(KWDs), + type: "number", + schemaType: "number", + $data: true, + error, + code(cxt) { + const { keyword, data, schemaCode } = cxt; + cxt.fail$data((0, codegen_1._) `${data} ${KWDs[keyword].fail} ${schemaCode} || isNaN(${data})`); + }, +}; +exports.default = def; +//# sourceMappingURL=limitNumber.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitNumber.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitNumber.js.map new file mode 100644 index 0000000000..18a3653375 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitNumber.js.map @@ -0,0 +1 @@ +{"version":3,"file":"limitNumber.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/limitNumber.ts"],"names":[],"mappings":";;AAEA,mDAA6D;AAE7D,MAAM,GAAG,GAAG,mBAAS,CAAA;AAMrB,MAAM,IAAI,GAA4D;IACpE,OAAO,EAAE,EAAC,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,EAAE,EAAC;IACjD,OAAO,EAAE,EAAC,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,EAAE,EAAC;IACjD,gBAAgB,EAAE,EAAC,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,GAAG,EAAC;IACzD,gBAAgB,EAAE,EAAC,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,GAAG,EAAC;CAC1D,CAAA;AAQD,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,OAAO,EAAE,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,aAAG,EAAA,WAAW,IAAI,CAAC,OAAc,CAAC,CAAC,KAAK,IAAI,UAAU,EAAE;IAC5F,MAAM,EAAE,CAAC,EAAC,OAAO,EAAE,UAAU,EAAC,EAAE,EAAE,CAChC,IAAA,WAAC,EAAA,gBAAgB,IAAI,CAAC,OAAc,CAAC,CAAC,KAAK,YAAY,UAAU,GAAG;CACvE,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;IAC1B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAC,GAAG,GAAG,CAAA;QACvC,GAAG,CAAC,SAAS,CAAC,IAAA,WAAC,EAAA,GAAG,IAAI,IAAI,IAAI,CAAC,OAAc,CAAC,CAAC,IAAI,IAAI,UAAU,aAAa,IAAI,GAAG,CAAC,CAAA;IACxF,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitProperties.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitProperties.d.ts new file mode 100644 index 0000000000..cde2aa2700 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitProperties.d.ts @@ -0,0 +1,3 @@ +import type { CodeKeywordDefinition } from "../../types"; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitProperties.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitProperties.js new file mode 100644 index 0000000000..e6fc40cc67 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitProperties.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const error = { + message({ keyword, schemaCode }) { + const comp = keyword === "maxProperties" ? "more" : "fewer"; + return (0, codegen_1.str) `must NOT have ${comp} than ${schemaCode} properties`; + }, + params: ({ schemaCode }) => (0, codegen_1._) `{limit: ${schemaCode}}`, +}; +const def = { + keyword: ["maxProperties", "minProperties"], + type: "object", + schemaType: "number", + $data: true, + error, + code(cxt) { + const { keyword, data, schemaCode } = cxt; + const op = keyword === "maxProperties" ? codegen_1.operators.GT : codegen_1.operators.LT; + cxt.fail$data((0, codegen_1._) `Object.keys(${data}).length ${op} ${schemaCode}`); + }, +}; +exports.default = def; +//# sourceMappingURL=limitProperties.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitProperties.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitProperties.js.map new file mode 100644 index 0000000000..a695943a97 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/limitProperties.js.map @@ -0,0 +1 @@ +{"version":3,"file":"limitProperties.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/limitProperties.ts"],"names":[],"mappings":";;AAEA,mDAAuD;AAEvD,MAAM,KAAK,GAA2B;IACpC,OAAO,CAAC,EAAC,OAAO,EAAE,UAAU,EAAC;QAC3B,MAAM,IAAI,GAAG,OAAO,KAAK,eAAe,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAA;QAC3D,OAAO,IAAA,aAAG,EAAA,iBAAiB,IAAI,SAAS,UAAU,aAAa,CAAA;IACjE,CAAC;IACD,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,WAAW,UAAU,GAAG;CACpD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,CAAC,eAAe,EAAE,eAAe,CAAC;IAC3C,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAC,GAAG,GAAG,CAAA;QACvC,MAAM,EAAE,GAAG,OAAO,KAAK,eAAe,CAAC,CAAC,CAAC,mBAAS,CAAC,EAAE,CAAC,CAAC,CAAC,mBAAS,CAAC,EAAE,CAAA;QACpE,GAAG,CAAC,SAAS,CAAC,IAAA,WAAC,EAAA,eAAe,IAAI,YAAY,EAAE,IAAI,UAAU,EAAE,CAAC,CAAA;IACnE,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/multipleOf.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/multipleOf.d.ts new file mode 100644 index 0000000000..67685dcd36 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/multipleOf.d.ts @@ -0,0 +1,8 @@ +import type { CodeKeywordDefinition, ErrorObject } from "../../types"; +export type MultipleOfError = ErrorObject<"multipleOf", { + multipleOf: number; +}, number | { + $data: string; +}>; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/multipleOf.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/multipleOf.js new file mode 100644 index 0000000000..43cf67b77b --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/multipleOf.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const error = { + message: ({ schemaCode }) => (0, codegen_1.str) `must be multiple of ${schemaCode}`, + params: ({ schemaCode }) => (0, codegen_1._) `{multipleOf: ${schemaCode}}`, +}; +const def = { + keyword: "multipleOf", + type: "number", + schemaType: "number", + $data: true, + error, + code(cxt) { + const { gen, data, schemaCode, it } = cxt; + // const bdt = bad$DataType(schemaCode, def.schemaType, $data) + const prec = it.opts.multipleOfPrecision; + const res = gen.let("res"); + const invalid = prec + ? (0, codegen_1._) `Math.abs(Math.round(${res}) - ${res}) > 1e-${prec}` + : (0, codegen_1._) `${res} !== parseInt(${res})`; + cxt.fail$data((0, codegen_1._) `(${schemaCode} === 0 || (${res} = ${data}/${schemaCode}, ${invalid}))`); + }, +}; +exports.default = def; +//# sourceMappingURL=multipleOf.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/multipleOf.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/multipleOf.js.map new file mode 100644 index 0000000000..9ef825b747 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/multipleOf.js.map @@ -0,0 +1 @@ +{"version":3,"file":"multipleOf.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/multipleOf.ts"],"names":[],"mappings":";;AAEA,mDAA4C;AAQ5C,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,aAAG,EAAA,uBAAuB,UAAU,EAAE;IACjE,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,gBAAgB,UAAU,GAAG;CACzD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,YAAY;IACrB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACvC,sEAAsE;QACtE,MAAM,IAAI,GAAG,EAAE,CAAC,IAAI,CAAC,mBAAmB,CAAA;QACxC,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;QAC1B,MAAM,OAAO,GAAG,IAAI;YAClB,CAAC,CAAC,IAAA,WAAC,EAAA,uBAAuB,GAAG,OAAO,GAAG,UAAU,IAAI,EAAE;YACvD,CAAC,CAAC,IAAA,WAAC,EAAA,GAAG,GAAG,iBAAiB,GAAG,GAAG,CAAA;QAClC,GAAG,CAAC,SAAS,CAAC,IAAA,WAAC,EAAA,IAAI,UAAU,cAAc,GAAG,MAAM,IAAI,IAAI,UAAU,KAAK,OAAO,IAAI,CAAC,CAAA;IACzF,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/pattern.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/pattern.d.ts new file mode 100644 index 0000000000..7edbfda930 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/pattern.d.ts @@ -0,0 +1,8 @@ +import type { CodeKeywordDefinition, ErrorObject } from "../../types"; +export type PatternError = ErrorObject<"pattern", { + pattern: string; +}, string | { + $data: string; +}>; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/pattern.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/pattern.js new file mode 100644 index 0000000000..f8ccdf2950 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/pattern.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const code_1 = require("../code"); +const codegen_1 = require("../../compile/codegen"); +const error = { + message: ({ schemaCode }) => (0, codegen_1.str) `must match pattern "${schemaCode}"`, + params: ({ schemaCode }) => (0, codegen_1._) `{pattern: ${schemaCode}}`, +}; +const def = { + keyword: "pattern", + type: "string", + schemaType: "string", + $data: true, + error, + code(cxt) { + const { data, $data, schema, schemaCode, it } = cxt; + // TODO regexp should be wrapped in try/catchs + const u = it.opts.unicodeRegExp ? "u" : ""; + const regExp = $data ? (0, codegen_1._) `(new RegExp(${schemaCode}, ${u}))` : (0, code_1.usePattern)(cxt, schema); + cxt.fail$data((0, codegen_1._) `!${regExp}.test(${data})`); + }, +}; +exports.default = def; +//# sourceMappingURL=pattern.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/pattern.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/pattern.js.map new file mode 100644 index 0000000000..82fa5d74c1 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/pattern.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pattern.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/pattern.ts"],"names":[],"mappings":";;AAEA,kCAAkC;AAClC,mDAA4C;AAI5C,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,aAAG,EAAA,uBAAuB,UAAU,GAAG;IAClE,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,aAAa,UAAU,GAAG;CACtD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACjD,8CAA8C;QAC9C,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAA;QAC1C,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,IAAA,WAAC,EAAA,eAAe,UAAU,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAA,iBAAU,EAAC,GAAG,EAAE,MAAM,CAAC,CAAA;QACrF,GAAG,CAAC,SAAS,CAAC,IAAA,WAAC,EAAA,IAAI,MAAM,SAAS,IAAI,GAAG,CAAC,CAAA;IAC5C,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/required.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/required.d.ts new file mode 100644 index 0000000000..c9cffda1ee --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/required.d.ts @@ -0,0 +1,8 @@ +import type { CodeKeywordDefinition, ErrorObject } from "../../types"; +export type RequiredError = ErrorObject<"required", { + missingProperty: string; +}, string[] | { + $data: string; +}>; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/required.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/required.js new file mode 100644 index 0000000000..1d8e29263f --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/required.js @@ -0,0 +1,79 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const code_1 = require("../code"); +const codegen_1 = require("../../compile/codegen"); +const util_1 = require("../../compile/util"); +const error = { + message: ({ params: { missingProperty } }) => (0, codegen_1.str) `must have required property '${missingProperty}'`, + params: ({ params: { missingProperty } }) => (0, codegen_1._) `{missingProperty: ${missingProperty}}`, +}; +const def = { + keyword: "required", + type: "object", + schemaType: "array", + $data: true, + error, + code(cxt) { + const { gen, schema, schemaCode, data, $data, it } = cxt; + const { opts } = it; + if (!$data && schema.length === 0) + return; + const useLoop = schema.length >= opts.loopRequired; + if (it.allErrors) + allErrorsMode(); + else + exitOnErrorMode(); + if (opts.strictRequired) { + const props = cxt.parentSchema.properties; + const { definedProperties } = cxt.it; + for (const requiredKey of schema) { + if ((props === null || props === void 0 ? void 0 : props[requiredKey]) === undefined && !definedProperties.has(requiredKey)) { + const schemaPath = it.schemaEnv.baseId + it.errSchemaPath; + const msg = `required property "${requiredKey}" is not defined at "${schemaPath}" (strictRequired)`; + (0, util_1.checkStrictMode)(it, msg, it.opts.strictRequired); + } + } + } + function allErrorsMode() { + if (useLoop || $data) { + cxt.block$data(codegen_1.nil, loopAllRequired); + } + else { + for (const prop of schema) { + (0, code_1.checkReportMissingProp)(cxt, prop); + } + } + } + function exitOnErrorMode() { + const missing = gen.let("missing"); + if (useLoop || $data) { + const valid = gen.let("valid", true); + cxt.block$data(valid, () => loopUntilMissing(missing, valid)); + cxt.ok(valid); + } + else { + gen.if((0, code_1.checkMissingProp)(cxt, schema, missing)); + (0, code_1.reportMissingProp)(cxt, missing); + gen.else(); + } + } + function loopAllRequired() { + gen.forOf("prop", schemaCode, (prop) => { + cxt.setParams({ missingProperty: prop }); + gen.if((0, code_1.noPropertyInData)(gen, data, prop, opts.ownProperties), () => cxt.error()); + }); + } + function loopUntilMissing(missing, valid) { + cxt.setParams({ missingProperty: missing }); + gen.forOf(missing, schemaCode, () => { + gen.assign(valid, (0, code_1.propertyInData)(gen, data, missing, opts.ownProperties)); + gen.if((0, codegen_1.not)(valid), () => { + cxt.error(); + gen.break(); + }); + }, codegen_1.nil); + } + }, +}; +exports.default = def; +//# sourceMappingURL=required.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/required.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/required.js.map new file mode 100644 index 0000000000..9ec186fa1d --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/required.js.map @@ -0,0 +1 @@ +{"version":3,"file":"required.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/required.ts"],"names":[],"mappings":";;AAEA,kCAMgB;AAChB,mDAAkE;AAClE,6CAAkD;AAQlD,MAA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SAAS,CAAC,EAAC,eAAe,EAAE,IAAI,EAAC,CAAC,CAAA;gBACtC,GAAG,CAAC,EAAE,CAAC,IAAA,uBAAgB,EAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAA;YAClF,CAAC,CAAC,CAAA;QACJ,CAAC;QAED,SAAS,gBAAgB,CAAC,OAAa,EAAE,KAAW;YAClD,GAAG,CAAC,SAAS,CAAC,EAAC,eAAe,EAAE,OAAO,EAAC,CAAC,CAAA;YACzC,GAAG,CAAC,KAAK,CACP,OAAO,EACP,UAAkB,EAClB,GAAG,EAAE;gBACH,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,IAAA,qBAAc,EAAC,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,CAAA;gBACzE,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,EAAE,GAAG,EAAE;oBACtB,GAAG,CAAC,KAAK,EAAE,CAAA;oBACX,GAAG,CAAC,KAAK,EAAE,CAAA;gBACb,CAAC,CAAC,CAAA;YACJ,CAAC,EACD,aAAG,CACJ,CAAA;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/uniqueItems.d.ts b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/uniqueItems.d.ts new file mode 100644 index 0000000000..e7c241b984 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/uniqueItems.d.ts @@ -0,0 +1,9 @@ +import type { CodeKeywordDefinition, ErrorObject } from "../../types"; +export type UniqueItemsError = ErrorObject<"uniqueItems", { + i: number; + j: number; +}, boolean | { + $data: string; +}>; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/uniqueItems.js b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/uniqueItems.js new file mode 100644 index 0000000000..cdbecea122 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/uniqueItems.js @@ -0,0 +1,64 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const dataType_1 = require("../../compile/validate/dataType"); +const codegen_1 = require("../../compile/codegen"); +const util_1 = require("../../compile/util"); +const equal_1 = require("../../runtime/equal"); +const error = { + message: ({ params: { i, j } }) => (0, codegen_1.str) `must NOT have duplicate items (items ## ${j} and ${i} are identical)`, + params: ({ params: { i, j } }) => (0, codegen_1._) `{i: ${i}, j: ${j}}`, +}; +const def = { + keyword: "uniqueItems", + type: "array", + schemaType: "boolean", + $data: true, + error, + code(cxt) { + const { gen, data, $data, schema, parentSchema, schemaCode, it } = cxt; + if (!$data && !schema) + return; + const valid = gen.let("valid"); + const itemTypes = parentSchema.items ? (0, dataType_1.getSchemaTypes)(parentSchema.items) : []; + cxt.block$data(valid, validateUniqueItems, (0, codegen_1._) `${schemaCode} === false`); + cxt.ok(valid); + function validateUniqueItems() { + const i = gen.let("i", (0, codegen_1._) `${data}.length`); + const j = gen.let("j"); + cxt.setParams({ i, j }); + gen.assign(valid, true); + gen.if((0, codegen_1._) `${i} > 1`, () => (canOptimize() ? loopN : loopN2)(i, j)); + } + function canOptimize() { + return itemTypes.length > 0 && !itemTypes.some((t) => t === "object" || t === "array"); + } + function loopN(i, j) { + const item = gen.name("item"); + const wrongType = (0, dataType_1.checkDataTypes)(itemTypes, item, it.opts.strictNumbers, dataType_1.DataType.Wrong); + const indices = gen.const("indices", (0, codegen_1._) `{}`); + gen.for((0, codegen_1._) `;${i}--;`, () => { + gen.let(item, (0, codegen_1._) `${data}[${i}]`); + gen.if(wrongType, (0, codegen_1._) `continue`); + if (itemTypes.length > 1) + gen.if((0, codegen_1._) `typeof ${item} == "string"`, (0, codegen_1._) `${item} += "_"`); + gen + .if((0, codegen_1._) `typeof ${indices}[${item}] == "number"`, () => { + gen.assign(j, (0, codegen_1._) `${indices}[${item}]`); + cxt.error(); + gen.assign(valid, false).break(); + }) + .code((0, codegen_1._) `${indices}[${item}] = ${i}`); + }); + } + function loopN2(i, j) { + const eql = (0, util_1.useFunc)(gen, equal_1.default); + const outer = gen.name("outer"); + gen.label(outer).for((0, codegen_1._) `;${i}--;`, () => gen.for((0, codegen_1._) `${j} = ${i}; ${j}--;`, () => gen.if((0, codegen_1._) `${eql}(${data}[${i}], ${data}[${j}])`, () => { + cxt.error(); + gen.assign(valid, false).break(outer); + }))); + } + }, +}; +exports.default = def; +//# sourceMappingURL=uniqueItems.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/uniqueItems.js.map b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/uniqueItems.js.map new file mode 100644 index 0000000000..46eb7a2a06 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/dist/vocabularies/validation/uniqueItems.js.map @@ -0,0 +1 @@ +{"version":3,"file":"uniqueItems.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/uniqueItems.ts"],"names":[],"mappings":";;AAEA,8DAAwF;AACxF,mDAAkD;AAClD,6CAA0C;AAC1C,+CAAuC;AAQvC,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,CAAC,EAAE,CAAC,EAAC,EAAC,EAAE,EAAE,CAC5B,IAAA,aAAG,EAAA,2CAA2C,CAAC,QAAQ,CAAC,iBAAiB;IAC3E,MAAM,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,CAAC,EAAE,CAAC,EAAC,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,OAAO,CAAC,QAAQ,CAAC,GAAG;CACpD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,aAAa;IACtB,IAAI,EAAE,OAAO;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ACD,IAAI,CAAC,IAAA,WAAC,EAAA,GAAG,OAAO,IAAI,IAAI,OAAO,CAAC,EAAE,CAAC,CAAA;YACxC,CAAC,CAAC,CAAA;QACJ,CAAC;QAED,SAAS,MAAM,CAAC,CAAO,EAAE,CAAO;YAC9B,MAAM,GAAG,GAAG,IAAA,cAAO,EAAC,GAAG,EAAE,eAAK,CAAC,CAAA;YAC/B,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;YAC/B,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,IAAA,WAAC,EAAA,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,CACrC,GAAG,CAAC,GAAG,CAAC,IAAA,WAAC,EAAA,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,CACpC,GAAG,CAAC,EAAE,CAAC,IAAA,WAAC,EAAA,GAAG,GAAG,IAAI,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE;gBACnD,GAAG,CAAC,KAAK,EAAE,CAAA;gBACX,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;YACvC,CAAC,CAAC,CACH,CACF,CAAA;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/ajv/lib/2019.ts b/front_end/third_party/mcp-sdk/ajv/lib/2019.ts new file mode 100644 index 0000000000..3f7194f1bc --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/2019.ts @@ -0,0 +1,81 @@ +import type {AnySchemaObject} from "./types" +import AjvCore, {Options} from "./core" + +import draft7Vocabularies from "./vocabularies/draft7" +import dynamicVocabulary from "./vocabularies/dynamic" +import nextVocabulary from "./vocabularies/next" +import unevaluatedVocabulary from "./vocabularies/unevaluated" +import discriminator from "./vocabularies/discriminator" +import addMetaSchema2019 from "./refs/json-schema-2019-09" + +const META_SCHEMA_ID = "https://json-schema.org/draft/2019-09/schema" + +export class Ajv2019 extends AjvCore { + constructor(opts: Options = {}) { + super({ + ...opts, + dynamicRef: true, + next: true, + unevaluated: true, + }) + } + + _addVocabularies(): void { + super._addVocabularies() + this.addVocabulary(dynamicVocabulary) + draft7Vocabularies.forEach((v) => this.addVocabulary(v)) + this.addVocabulary(nextVocabulary) + this.addVocabulary(unevaluatedVocabulary) + if (this.opts.discriminator) this.addKeyword(discriminator) + } + + _addDefaultMetaSchema(): void { + super._addDefaultMetaSchema() + const {$data, meta} = this.opts + if (!meta) return + addMetaSchema2019.call(this, $data) + this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID + } + + defaultMeta(): string | AnySchemaObject | undefined { + return (this.opts.defaultMeta = + super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined)) + } +} + +module.exports = exports = Ajv2019 +module.exports.Ajv2019 = Ajv2019 +Object.defineProperty(exports, "__esModule", {value: true}) + +export default Ajv2019 + +export { + Format, + FormatDefinition, + AsyncFormatDefinition, + KeywordDefinition, + KeywordErrorDefinition, + CodeKeywordDefinition, + MacroKeywordDefinition, + FuncKeywordDefinition, + Vocabulary, + Schema, + SchemaObject, + AnySchemaObject, + AsyncSchema, + AnySchema, + ValidateFunction, + AsyncValidateFunction, + ErrorObject, + ErrorNoParams, +} from "./types" + +export {Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions} from "./core" +export {SchemaCxt, SchemaObjCxt} from "./compile" +export {KeywordCxt} from "./compile/validate" +export {DefinedError} from "./vocabularies/errors" +export {JSONType} from "./compile/rules" +export {JSONSchemaType} from "./types/json-schema" +export {_, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions} from "./compile/codegen" +export {default as ValidationError} from "./runtime/validation_error" +export {default as MissingRefError} from "./compile/ref_error" diff --git a/front_end/third_party/mcp-sdk/ajv/lib/2020.ts b/front_end/third_party/mcp-sdk/ajv/lib/2020.ts new file mode 100644 index 0000000000..cfb36af9d7 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/2020.ts @@ -0,0 +1,75 @@ +import type {AnySchemaObject} from "./types" +import AjvCore, {Options} from "./core" + +import draft2020Vocabularies from "./vocabularies/draft2020" +import discriminator from "./vocabularies/discriminator" +import addMetaSchema2020 from "./refs/json-schema-2020-12" + +const META_SCHEMA_ID = "https://json-schema.org/draft/2020-12/schema" + +export class Ajv2020 extends AjvCore { + constructor(opts: Options = {}) { + super({ + ...opts, + dynamicRef: true, + next: true, + unevaluated: true, + }) + } + + _addVocabularies(): void { + super._addVocabularies() + draft2020Vocabularies.forEach((v) => this.addVocabulary(v)) + if (this.opts.discriminator) this.addKeyword(discriminator) + } + + _addDefaultMetaSchema(): void { + super._addDefaultMetaSchema() + const {$data, meta} = this.opts + if (!meta) return + addMetaSchema2020.call(this, $data) + this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID + } + + defaultMeta(): string | AnySchemaObject | undefined { + return (this.opts.defaultMeta = + super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined)) + } +} + +module.exports = exports = Ajv2020 +module.exports.Ajv2020 = Ajv2020 +Object.defineProperty(exports, "__esModule", {value: true}) + +export default Ajv2020 + +export { + Format, + FormatDefinition, + AsyncFormatDefinition, + KeywordDefinition, + KeywordErrorDefinition, + CodeKeywordDefinition, + MacroKeywordDefinition, + FuncKeywordDefinition, + Vocabulary, + Schema, + SchemaObject, + AnySchemaObject, + AsyncSchema, + AnySchema, + ValidateFunction, + AsyncValidateFunction, + ErrorObject, + ErrorNoParams, +} from "./types" + +export {Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions} from "./core" +export {SchemaCxt, SchemaObjCxt} from "./compile" +export {KeywordCxt} from "./compile/validate" +export {DefinedError} from "./vocabularies/errors" +export {JSONType} from "./compile/rules" +export {JSONSchemaType} from "./types/json-schema" +export {_, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions} from "./compile/codegen" +export {default as ValidationError} from "./runtime/validation_error" +export {default as MissingRefError} from "./compile/ref_error" diff --git a/front_end/third_party/mcp-sdk/ajv/lib/ajv.ts b/front_end/third_party/mcp-sdk/ajv/lib/ajv.ts new file mode 100644 index 0000000000..8275b93a8e --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/ajv.ts @@ -0,0 +1,70 @@ +import type {AnySchemaObject} from "./types" +import AjvCore from "./core" +import draft7Vocabularies from "./vocabularies/draft7" +import discriminator from "./vocabularies/discriminator" +import * as draft7MetaSchema from "./refs/json-schema-draft-07.json" + +const META_SUPPORT_DATA = ["/properties"] + +const META_SCHEMA_ID = "http://json-schema.org/draft-07/schema" + +export class Ajv extends AjvCore { + _addVocabularies(): void { + super._addVocabularies() + draft7Vocabularies.forEach((v) => this.addVocabulary(v)) + if (this.opts.discriminator) this.addKeyword(discriminator) + } + + _addDefaultMetaSchema(): void { + super._addDefaultMetaSchema() + if (!this.opts.meta) return + const metaSchema = this.opts.$data + ? this.$dataMetaSchema(draft7MetaSchema, META_SUPPORT_DATA) + : draft7MetaSchema + this.addMetaSchema(metaSchema, META_SCHEMA_ID, false) + this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID + } + + defaultMeta(): string | AnySchemaObject | undefined { + return (this.opts.defaultMeta = + super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined)) + } +} + +module.exports = exports = Ajv +module.exports.Ajv = Ajv +Object.defineProperty(exports, "__esModule", {value: true}) + +export default Ajv + +export { + Format, + FormatDefinition, + AsyncFormatDefinition, + KeywordDefinition, + KeywordErrorDefinition, + CodeKeywordDefinition, + MacroKeywordDefinition, + FuncKeywordDefinition, + Vocabulary, + Schema, + SchemaObject, + AnySchemaObject, + AsyncSchema, + AnySchema, + ValidateFunction, + AsyncValidateFunction, + SchemaValidateFunction, + ErrorObject, + ErrorNoParams, +} from "./types" + +export {Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions} from "./core" +export {SchemaCxt, SchemaObjCxt} from "./compile" +export {KeywordCxt} from "./compile/validate" +export {DefinedError} from "./vocabularies/errors" +export {JSONType} from "./compile/rules" +export {JSONSchemaType} from "./types/json-schema" +export {_, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions} from "./compile/codegen" +export {default as ValidationError} from "./runtime/validation_error" +export {default as MissingRefError} from "./compile/ref_error" diff --git a/front_end/third_party/mcp-sdk/ajv/lib/compile/codegen/code.ts b/front_end/third_party/mcp-sdk/ajv/lib/compile/codegen/code.ts new file mode 100644 index 0000000000..9d4de6149f --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/compile/codegen/code.ts @@ -0,0 +1,169 @@ +// eslint-disable-next-line @typescript-eslint/no-extraneous-class +export abstract class _CodeOrName { + abstract readonly str: string + abstract readonly names: UsedNames + abstract toString(): string + abstract emptyStr(): boolean +} + +export const IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i + +export class Name extends _CodeOrName { + readonly str: string + constructor(s: string) { + super() + if (!IDENTIFIER.test(s)) throw new Error("CodeGen: name must be a valid identifier") + this.str = s + } + + toString(): string { + return this.str + } + + emptyStr(): boolean { + return false + } + + get names(): UsedNames { + return {[this.str]: 1} + } +} + +export class _Code extends _CodeOrName { + readonly _items: readonly CodeItem[] + private _str?: string + private _names?: UsedNames + + constructor(code: string | readonly CodeItem[]) { + super() + this._items = typeof code === "string" ? [code] : code + } + + toString(): string { + return this.str + } + + emptyStr(): boolean { + if (this._items.length > 1) return false + const item = this._items[0] + return item === "" || item === '""' + } + + get str(): string { + return (this._str ??= this._items.reduce((s: string, c: CodeItem) => `${s}${c}`, "")) + } + + get names(): UsedNames { + return (this._names ??= this._items.reduce((names: UsedNames, c) => { + if (c instanceof Name) names[c.str] = (names[c.str] || 0) + 1 + return names + }, {})) + } +} + +export type CodeItem = Name | string | number | boolean | null + +export type UsedNames = Record + +export type Code = _Code | Name + +export type SafeExpr = Code | number | boolean | null + +export const nil = new _Code("") + +type CodeArg = SafeExpr | string | undefined + +export function _(strs: TemplateStringsArray, ...args: CodeArg[]): _Code { + const code: CodeItem[] = [strs[0]] + let i = 0 + while (i < args.length) { + addCodeArg(code, args[i]) + code.push(strs[++i]) + } + return new _Code(code) +} + +const plus = new _Code("+") + +export function str(strs: TemplateStringsArray, ...args: (CodeArg | string[])[]): _Code { + const expr: CodeItem[] = [safeStringify(strs[0])] + let i = 0 + while (i < args.length) { + expr.push(plus) + addCodeArg(expr, args[i]) + expr.push(plus, safeStringify(strs[++i])) + } + optimize(expr) + return new _Code(expr) +} + +export function addCodeArg(code: CodeItem[], arg: CodeArg | string[]): void { + if (arg instanceof _Code) code.push(...arg._items) + else if (arg instanceof Name) code.push(arg) + else code.push(interpolate(arg)) +} + +function optimize(expr: CodeItem[]): void { + let i = 1 + while (i < expr.length - 1) { + if (expr[i] === plus) { + const res = mergeExprItems(expr[i - 1], expr[i + 1]) + if (res !== undefined) { + expr.splice(i - 1, 3, res) + continue + } + expr[i++] = "+" + } + i++ + } +} + +function mergeExprItems(a: CodeItem, b: CodeItem): CodeItem | undefined { + if (b === '""') return a + if (a === '""') return b + if (typeof a == "string") { + if (b instanceof Name || a[a.length - 1] !== '"') return + if (typeof b != "string") return `${a.slice(0, -1)}${b}"` + if (b[0] === '"') return a.slice(0, -1) + b.slice(1) + return + } + if (typeof b == "string" && b[0] === '"' && !(a instanceof Name)) return `"${a}${b.slice(1)}` + return +} + +export function strConcat(c1: Code, c2: Code): Code { + return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str`${c1}${c2}` +} + +// TODO do not allow arrays here +function interpolate(x?: string | string[] | number | boolean | null): SafeExpr | string { + return typeof x == "number" || typeof x == "boolean" || x === null + ? x + : safeStringify(Array.isArray(x) ? x.join(",") : x) +} + +export function stringify(x: unknown): Code { + return new _Code(safeStringify(x)) +} + +export function safeStringify(x: unknown): string { + return JSON.stringify(x) + .replace(/\u2028/g, "\\u2028") + .replace(/\u2029/g, "\\u2029") +} + +export function getProperty(key: Code | string | number): Code { + return typeof key == "string" && IDENTIFIER.test(key) ? new _Code(`.${key}`) : _`[${key}]` +} + +//Does best effort to format the name properly +export function getEsmExportName(key: Code | string | number): Code { + if (typeof key == "string" && IDENTIFIER.test(key)) { + return new _Code(`${key}`) + } + throw new Error(`CodeGen: invalid export name: ${key}, use explicit $id name mapping`) +} + +export function regexpCode(rx: RegExp): Code { + return new _Code(rx.toString()) +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/compile/codegen/index.ts b/front_end/third_party/mcp-sdk/ajv/lib/compile/codegen/index.ts new file mode 100644 index 0000000000..5a6d1ee58c --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/compile/codegen/index.ts @@ -0,0 +1,852 @@ +import type {ScopeValueSets, NameValue, ValueScope, ValueScopeName} from "./scope" +import {_, nil, _Code, Code, Name, UsedNames, CodeItem, addCodeArg, _CodeOrName} from "./code" +import {Scope, varKinds} from "./scope" + +export {_, str, strConcat, nil, getProperty, stringify, regexpCode, Name, Code} from "./code" +export {Scope, ScopeStore, ValueScope, ValueScopeName, ScopeValueSets, varKinds} from "./scope" + +// type for expressions that can be safely inserted in code without quotes +export type SafeExpr = Code | number | boolean | null + +// type that is either Code of function that adds code to CodeGen instance using its methods +export type Block = Code | (() => void) + +export const operators = { + GT: new _Code(">"), + GTE: new _Code(">="), + LT: new _Code("<"), + LTE: new _Code("<="), + EQ: new _Code("==="), + NEQ: new _Code("!=="), + NOT: new _Code("!"), + OR: new _Code("||"), + AND: new _Code("&&"), + ADD: new _Code("+"), +} + +abstract class Node { + abstract readonly names: UsedNames + + optimizeNodes(): this | ChildNode | ChildNode[] | undefined { + return this + } + + optimizeNames(_names: UsedNames, _constants: Constants): this | undefined { + return this + } + + // get count(): number { + // return 1 + // } +} + +class Def extends Node { + constructor( + private readonly varKind: Name, + private readonly name: Name, + private rhs?: SafeExpr + ) { + super() + } + + render({es5, _n}: CGOptions): string { + const varKind = es5 ? varKinds.var : this.varKind + const rhs = this.rhs === undefined ? "" : ` = ${this.rhs}` + return `${varKind} ${this.name}${rhs};` + _n + } + + optimizeNames(names: UsedNames, constants: Constants): this | undefined { + if (!names[this.name.str]) return + if (this.rhs) this.rhs = optimizeExpr(this.rhs, names, constants) + return this + } + + get names(): UsedNames { + return this.rhs instanceof _CodeOrName ? this.rhs.names : {} + } +} + +class Assign extends Node { + constructor( + readonly lhs: Code, + public rhs: SafeExpr, + private readonly sideEffects?: boolean + ) { + super() + } + + render({_n}: CGOptions): string { + return `${this.lhs} = ${this.rhs};` + _n + } + + optimizeNames(names: UsedNames, constants: Constants): this | undefined { + if (this.lhs instanceof Name && !names[this.lhs.str] && !this.sideEffects) return + this.rhs = optimizeExpr(this.rhs, names, constants) + return this + } + + get names(): UsedNames { + const names = this.lhs instanceof Name ? {} : {...this.lhs.names} + return addExprNames(names, this.rhs) + } +} + +class AssignOp extends Assign { + constructor( + lhs: Code, + private readonly op: Code, + rhs: SafeExpr, + sideEffects?: boolean + ) { + super(lhs, rhs, sideEffects) + } + + render({_n}: CGOptions): string { + return `${this.lhs} ${this.op}= ${this.rhs};` + _n + } +} + +class Label extends Node { + readonly names: UsedNames = {} + constructor(readonly label: Name) { + super() + } + + render({_n}: CGOptions): string { + return `${this.label}:` + _n + } +} + +class Break extends Node { + readonly names: UsedNames = {} + constructor(readonly label?: Code) { + super() + } + + render({_n}: CGOptions): string { + const label = this.label ? ` ${this.label}` : "" + return `break${label};` + _n + } +} + +class Throw extends Node { + constructor(readonly error: Code) { + super() + } + + render({_n}: CGOptions): string { + return `throw ${this.error};` + _n + } + + get names(): UsedNames { + return this.error.names + } +} + +class AnyCode extends Node { + constructor(private code: SafeExpr) { + super() + } + + render({_n}: CGOptions): string { + return `${this.code};` + _n + } + + optimizeNodes(): this | undefined { + return `${this.code}` ? this : undefined + } + + optimizeNames(names: UsedNames, constants: Constants): this { + this.code = optimizeExpr(this.code, names, constants) + return this + } + + get names(): UsedNames { + return this.code instanceof _CodeOrName ? this.code.names : {} + } +} + +abstract class ParentNode extends Node { + constructor(readonly nodes: ChildNode[] = []) { + super() + } + + render(opts: CGOptions): string { + return this.nodes.reduce((code, n) => code + n.render(opts), "") + } + + optimizeNodes(): this | ChildNode | ChildNode[] | undefined { + const {nodes} = this + let i = nodes.length + while (i--) { + const n = nodes[i].optimizeNodes() + if (Array.isArray(n)) nodes.splice(i, 1, ...n) + else if (n) nodes[i] = n + else nodes.splice(i, 1) + } + return nodes.length > 0 ? this : undefined + } + + optimizeNames(names: UsedNames, constants: Constants): this | undefined { + const {nodes} = this + let i = nodes.length + while (i--) { + // iterating backwards improves 1-pass optimization + const n = nodes[i] + if (n.optimizeNames(names, constants)) continue + subtractNames(names, n.names) + nodes.splice(i, 1) + } + return nodes.length > 0 ? this : undefined + } + + get names(): UsedNames { + return this.nodes.reduce((names: UsedNames, n) => addNames(names, n.names), {}) + } + + // get count(): number { + // return this.nodes.reduce((c, n) => c + n.count, 1) + // } +} + +abstract class BlockNode extends ParentNode { + render(opts: CGOptions): string { + return "{" + opts._n + super.render(opts) + "}" + opts._n + } +} + +class Root extends ParentNode {} + +class Else extends BlockNode { + static readonly kind = "else" +} + +class If extends BlockNode { + static readonly kind = "if" + else?: If | Else + constructor( + private condition: Code | boolean, + nodes?: ChildNode[] + ) { + super(nodes) + } + + render(opts: CGOptions): string { + let code = `if(${this.condition})` + super.render(opts) + if (this.else) code += "else " + this.else.render(opts) + return code + } + + optimizeNodes(): If | ChildNode[] | undefined { + super.optimizeNodes() + const cond = this.condition + if (cond === true) return this.nodes // else is ignored here + let e = this.else + if (e) { + const ns = e.optimizeNodes() + e = this.else = Array.isArray(ns) ? new Else(ns) : (ns as Else | undefined) + } + if (e) { + if (cond === false) return e instanceof If ? e : e.nodes + if (this.nodes.length) return this + return new If(not(cond), e instanceof If ? [e] : e.nodes) + } + if (cond === false || !this.nodes.length) return undefined + return this + } + + optimizeNames(names: UsedNames, constants: Constants): this | undefined { + this.else = this.else?.optimizeNames(names, constants) + if (!(super.optimizeNames(names, constants) || this.else)) return + this.condition = optimizeExpr(this.condition, names, constants) + return this + } + + get names(): UsedNames { + const names = super.names + addExprNames(names, this.condition) + if (this.else) addNames(names, this.else.names) + return names + } + + // get count(): number { + // return super.count + (this.else?.count || 0) + // } +} + +abstract class For extends BlockNode { + static readonly kind = "for" +} + +class ForLoop extends For { + constructor(private iteration: Code) { + super() + } + + render(opts: CGOptions): string { + return `for(${this.iteration})` + super.render(opts) + } + + optimizeNames(names: UsedNames, constants: Constants): this | undefined { + if (!super.optimizeNames(names, constants)) return + this.iteration = optimizeExpr(this.iteration, names, constants) + return this + } + + get names(): UsedNames { + return addNames(super.names, this.iteration.names) + } +} + +class ForRange extends For { + constructor( + private readonly varKind: Name, + private readonly name: Name, + private readonly from: SafeExpr, + private readonly to: SafeExpr + ) { + super() + } + + render(opts: CGOptions): string { + const varKind = opts.es5 ? varKinds.var : this.varKind + const {name, from, to} = this + return `for(${varKind} ${name}=${from}; ${name}<${to}; ${name}++)` + super.render(opts) + } + + get names(): UsedNames { + const names = addExprNames(super.names, this.from) + return addExprNames(names, this.to) + } +} + +class ForIter extends For { + constructor( + private readonly loop: "of" | "in", + private readonly varKind: Name, + private readonly name: Name, + private iterable: Code + ) { + super() + } + + render(opts: CGOptions): string { + return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(opts) + } + + optimizeNames(names: UsedNames, constants: Constants): this | undefined { + if (!super.optimizeNames(names, constants)) return + this.iterable = optimizeExpr(this.iterable, names, constants) + return this + } + + get names(): UsedNames { + return addNames(super.names, this.iterable.names) + } +} + +class Func extends BlockNode { + static readonly kind = "func" + constructor( + public name: Name, + public args: Code, + public async?: boolean + ) { + super() + } + + render(opts: CGOptions): string { + const _async = this.async ? "async " : "" + return `${_async}function ${this.name}(${this.args})` + super.render(opts) + } +} + +class Return extends ParentNode { + static readonly kind = "return" + + render(opts: CGOptions): string { + return "return " + super.render(opts) + } +} + +class Try extends BlockNode { + catch?: Catch + finally?: Finally + + render(opts: CGOptions): string { + let code = "try" + super.render(opts) + if (this.catch) code += this.catch.render(opts) + if (this.finally) code += this.finally.render(opts) + return code + } + + optimizeNodes(): this { + super.optimizeNodes() + this.catch?.optimizeNodes() as Catch | undefined + this.finally?.optimizeNodes() as Finally | undefined + return this + } + + optimizeNames(names: UsedNames, constants: Constants): this { + super.optimizeNames(names, constants) + this.catch?.optimizeNames(names, constants) + this.finally?.optimizeNames(names, constants) + return this + } + + get names(): UsedNames { + const names = super.names + if (this.catch) addNames(names, this.catch.names) + if (this.finally) addNames(names, this.finally.names) + return names + } + + // get count(): number { + // return super.count + (this.catch?.count || 0) + (this.finally?.count || 0) + // } +} + +class Catch extends BlockNode { + static readonly kind = "catch" + constructor(readonly error: Name) { + super() + } + + render(opts: CGOptions): string { + return `catch(${this.error})` + super.render(opts) + } +} + +class Finally extends BlockNode { + static readonly kind = "finally" + render(opts: CGOptions): string { + return "finally" + super.render(opts) + } +} + +type StartBlockNode = If | For | Func | Return | Try + +type LeafNode = Def | Assign | Label | Break | Throw | AnyCode + +type ChildNode = StartBlockNode | LeafNode + +type EndBlockNodeType = + | typeof If + | typeof Else + | typeof For + | typeof Func + | typeof Return + | typeof Catch + | typeof Finally + +type Constants = Record + +export interface CodeGenOptions { + es5?: boolean + lines?: boolean + ownProperties?: boolean +} + +interface CGOptions extends CodeGenOptions { + _n: "\n" | "" +} + +export class CodeGen { + readonly _scope: Scope + readonly _extScope: ValueScope + readonly _values: ScopeValueSets = {} + private readonly _nodes: ParentNode[] + private readonly _blockStarts: number[] = [] + private readonly _constants: Constants = {} + private readonly opts: CGOptions + + constructor(extScope: ValueScope, opts: CodeGenOptions = {}) { + this.opts = {...opts, _n: opts.lines ? "\n" : ""} + this._extScope = extScope + this._scope = new Scope({parent: extScope}) + this._nodes = [new Root()] + } + + toString(): string { + return this._root.render(this.opts) + } + + // returns unique name in the internal scope + name(prefix: string): Name { + return this._scope.name(prefix) + } + + // reserves unique name in the external scope + scopeName(prefix: string): ValueScopeName { + return this._extScope.name(prefix) + } + + // reserves unique name in the external scope and assigns value to it + scopeValue(prefixOrName: ValueScopeName | string, value: NameValue): Name { + const name = this._extScope.value(prefixOrName, value) + const vs = this._values[name.prefix] || (this._values[name.prefix] = new Set()) + vs.add(name) + return name + } + + getScopeValue(prefix: string, keyOrRef: unknown): ValueScopeName | undefined { + return this._extScope.getValue(prefix, keyOrRef) + } + + // return code that assigns values in the external scope to the names that are used internally + // (same names that were returned by gen.scopeName or gen.scopeValue) + scopeRefs(scopeName: Name): Code { + return this._extScope.scopeRefs(scopeName, this._values) + } + + scopeCode(): Code { + return this._extScope.scopeCode(this._values) + } + + private _def( + varKind: Name, + nameOrPrefix: Name | string, + rhs?: SafeExpr, + constant?: boolean + ): Name { + const name = this._scope.toName(nameOrPrefix) + if (rhs !== undefined && constant) this._constants[name.str] = rhs + this._leafNode(new Def(varKind, name, rhs)) + return name + } + + // `const` declaration (`var` in es5 mode) + const(nameOrPrefix: Name | string, rhs: SafeExpr, _constant?: boolean): Name { + return this._def(varKinds.const, nameOrPrefix, rhs, _constant) + } + + // `let` declaration with optional assignment (`var` in es5 mode) + let(nameOrPrefix: Name | string, rhs?: SafeExpr, _constant?: boolean): Name { + return this._def(varKinds.let, nameOrPrefix, rhs, _constant) + } + + // `var` declaration with optional assignment + var(nameOrPrefix: Name | string, rhs?: SafeExpr, _constant?: boolean): Name { + return this._def(varKinds.var, nameOrPrefix, rhs, _constant) + } + + // assignment code + assign(lhs: Code, rhs: SafeExpr, sideEffects?: boolean): CodeGen { + return this._leafNode(new Assign(lhs, rhs, sideEffects)) + } + + // `+=` code + add(lhs: Code, rhs: SafeExpr): CodeGen { + return this._leafNode(new AssignOp(lhs, operators.ADD, rhs)) + } + + // appends passed SafeExpr to code or executes Block + code(c: Block | SafeExpr): CodeGen { + if (typeof c == "function") c() + else if (c !== nil) this._leafNode(new AnyCode(c)) + return this + } + + // returns code for object literal for the passed argument list of key-value pairs + object(...keyValues: [Name | string, SafeExpr | string][]): _Code { + const code: CodeItem[] = ["{"] + for (const [key, value] of keyValues) { + if (code.length > 1) code.push(",") + code.push(key) + if (key !== value || this.opts.es5) { + code.push(":") + addCodeArg(code, value) + } + } + code.push("}") + return new _Code(code) + } + + // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed) + if(condition: Code | boolean, thenBody?: Block, elseBody?: Block): CodeGen { + this._blockNode(new If(condition)) + + if (thenBody && elseBody) { + this.code(thenBody).else().code(elseBody).endIf() + } else if (thenBody) { + this.code(thenBody).endIf() + } else if (elseBody) { + throw new Error('CodeGen: "else" body without "then" body') + } + return this + } + + // `else if` clause - invalid without `if` or after `else` clauses + elseIf(condition: Code | boolean): CodeGen { + return this._elseNode(new If(condition)) + } + + // `else` clause - only valid after `if` or `else if` clauses + else(): CodeGen { + return this._elseNode(new Else()) + } + + // end `if` statement (needed if gen.if was used only with condition) + endIf(): CodeGen { + return this._endBlockNode(If, Else) + } + + private _for(node: For, forBody?: Block): CodeGen { + this._blockNode(node) + if (forBody) this.code(forBody).endFor() + return this + } + + // a generic `for` clause (or statement if `forBody` is passed) + for(iteration: Code, forBody?: Block): CodeGen { + return this._for(new ForLoop(iteration), forBody) + } + + // `for` statement for a range of values + forRange( + nameOrPrefix: Name | string, + from: SafeExpr, + to: SafeExpr, + forBody: (index: Name) => void, + varKind: Code = this.opts.es5 ? varKinds.var : varKinds.let + ): CodeGen { + const name = this._scope.toName(nameOrPrefix) + return this._for(new ForRange(varKind, name, from, to), () => forBody(name)) + } + + // `for-of` statement (in es5 mode replace with a normal for loop) + forOf( + nameOrPrefix: Name | string, + iterable: Code, + forBody: (item: Name) => void, + varKind: Code = varKinds.const + ): CodeGen { + const name = this._scope.toName(nameOrPrefix) + if (this.opts.es5) { + const arr = iterable instanceof Name ? iterable : this.var("_arr", iterable) + return this.forRange("_i", 0, _`${arr}.length`, (i) => { + this.var(name, _`${arr}[${i}]`) + forBody(name) + }) + } + return this._for(new ForIter("of", varKind, name, iterable), () => forBody(name)) + } + + // `for-in` statement. + // With option `ownProperties` replaced with a `for-of` loop for object keys + forIn( + nameOrPrefix: Name | string, + obj: Code, + forBody: (item: Name) => void, + varKind: Code = this.opts.es5 ? varKinds.var : varKinds.const + ): CodeGen { + if (this.opts.ownProperties) { + return this.forOf(nameOrPrefix, _`Object.keys(${obj})`, forBody) + } + const name = this._scope.toName(nameOrPrefix) + return this._for(new ForIter("in", varKind, name, obj), () => forBody(name)) + } + + // end `for` loop + endFor(): CodeGen { + return this._endBlockNode(For) + } + + // `label` statement + label(label: Name): CodeGen { + return this._leafNode(new Label(label)) + } + + // `break` statement + break(label?: Code): CodeGen { + return this._leafNode(new Break(label)) + } + + // `return` statement + return(value: Block | SafeExpr): CodeGen { + const node = new Return() + this._blockNode(node) + this.code(value) + if (node.nodes.length !== 1) throw new Error('CodeGen: "return" should have one node') + return this._endBlockNode(Return) + } + + // `try` statement + try(tryBody: Block, catchCode?: (e: Name) => void, finallyCode?: Block): CodeGen { + if (!catchCode && !finallyCode) throw new Error('CodeGen: "try" without "catch" and "finally"') + const node = new Try() + this._blockNode(node) + this.code(tryBody) + if (catchCode) { + const error = this.name("e") + this._currNode = node.catch = new Catch(error) + catchCode(error) + } + if (finallyCode) { + this._currNode = node.finally = new Finally() + this.code(finallyCode) + } + return this._endBlockNode(Catch, Finally) + } + + // `throw` statement + throw(error: Code): CodeGen { + return this._leafNode(new Throw(error)) + } + + // start self-balancing block + block(body?: Block, nodeCount?: number): CodeGen { + this._blockStarts.push(this._nodes.length) + if (body) this.code(body).endBlock(nodeCount) + return this + } + + // end the current self-balancing block + endBlock(nodeCount?: number): CodeGen { + const len = this._blockStarts.pop() + if (len === undefined) throw new Error("CodeGen: not in self-balancing block") + const toClose = this._nodes.length - len + if (toClose < 0 || (nodeCount !== undefined && toClose !== nodeCount)) { + throw new Error(`CodeGen: wrong number of nodes: ${toClose} vs ${nodeCount} expected`) + } + this._nodes.length = len + return this + } + + // `function` heading (or definition if funcBody is passed) + func(name: Name, args: Code = nil, async?: boolean, funcBody?: Block): CodeGen { + this._blockNode(new Func(name, args, async)) + if (funcBody) this.code(funcBody).endFunc() + return this + } + + // end function definition + endFunc(): CodeGen { + return this._endBlockNode(Func) + } + + optimize(n = 1): void { + while (n-- > 0) { + this._root.optimizeNodes() + this._root.optimizeNames(this._root.names, this._constants) + } + } + + private _leafNode(node: LeafNode): CodeGen { + this._currNode.nodes.push(node) + return this + } + + private _blockNode(node: StartBlockNode): void { + this._currNode.nodes.push(node) + this._nodes.push(node) + } + + private _endBlockNode(N1: EndBlockNodeType, N2?: EndBlockNodeType): CodeGen { + const n = this._currNode + if (n instanceof N1 || (N2 && n instanceof N2)) { + this._nodes.pop() + return this + } + throw new Error(`CodeGen: not in block "${N2 ? `${N1.kind}/${N2.kind}` : N1.kind}"`) + } + + private _elseNode(node: If | Else): CodeGen { + const n = this._currNode + if (!(n instanceof If)) { + throw new Error('CodeGen: "else" without "if"') + } + this._currNode = n.else = node + return this + } + + private get _root(): Root { + return this._nodes[0] as Root + } + + private get _currNode(): ParentNode { + const ns = this._nodes + return ns[ns.length - 1] + } + + private set _currNode(node: ParentNode) { + const ns = this._nodes + ns[ns.length - 1] = node + } + + // get nodeCount(): number { + // return this._root.count + // } +} + +function addNames(names: UsedNames, from: UsedNames): UsedNames { + for (const n in from) names[n] = (names[n] || 0) + (from[n] || 0) + return names +} + +function addExprNames(names: UsedNames, from: SafeExpr): UsedNames { + return from instanceof _CodeOrName ? addNames(names, from.names) : names +} + +function optimizeExpr(expr: T, names: UsedNames, constants: Constants): T +function optimizeExpr(expr: SafeExpr, names: UsedNames, constants: Constants): SafeExpr { + if (expr instanceof Name) return replaceName(expr) + if (!canOptimize(expr)) return expr + return new _Code( + expr._items.reduce((items: CodeItem[], c: SafeExpr | string) => { + if (c instanceof Name) c = replaceName(c) + if (c instanceof _Code) items.push(...c._items) + else items.push(c) + return items + }, []) + ) + + function replaceName(n: Name): SafeExpr { + const c = constants[n.str] + if (c === undefined || names[n.str] !== 1) return n + delete names[n.str] + return c + } + + function canOptimize(e: SafeExpr): e is _Code { + return ( + e instanceof _Code && + e._items.some( + (c) => c instanceof Name && names[c.str] === 1 && constants[c.str] !== undefined + ) + ) + } +} + +function subtractNames(names: UsedNames, from: UsedNames): void { + for (const n in from) names[n] = (names[n] || 0) - (from[n] || 0) +} + +export function not(x: T): T +export function not(x: Code | SafeExpr): Code | SafeExpr { + return typeof x == "boolean" || typeof x == "number" || x === null ? !x : _`!${par(x)}` +} + +const andCode = mappend(operators.AND) + +// boolean AND (&&) expression with the passed arguments +export function and(...args: Code[]): Code { + return args.reduce(andCode) +} + +const orCode = mappend(operators.OR) + +// boolean OR (||) expression with the passed arguments +export function or(...args: Code[]): Code { + return args.reduce(orCode) +} + +type MAppend = (x: Code, y: Code) => Code + +function mappend(op: Code): MAppend { + return (x, y) => (x === nil ? y : y === nil ? x : _`${par(x)} ${op} ${par(y)}`) +} + +function par(x: Code): Code { + return x instanceof Name ? x : _`(${x})` +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/compile/codegen/scope.ts b/front_end/third_party/mcp-sdk/ajv/lib/compile/codegen/scope.ts new file mode 100644 index 0000000000..511992297d --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/compile/codegen/scope.ts @@ -0,0 +1,215 @@ +import {_, nil, Code, Name} from "./code" + +interface NameGroup { + prefix: string + index: number +} + +export interface NameValue { + ref: ValueReference // this is the reference to any value that can be referred to from generated code via `globals` var in the closure + key?: unknown // any key to identify a global to avoid duplicates, if not passed ref is used + code?: Code // this is the code creating the value needed for standalone code wit_out closure - can be a primitive value, function or import (`require`) +} + +export type ValueReference = unknown // possibly make CodeGen parameterized type on this type + +class ValueError extends Error { + readonly value?: NameValue + constructor(name: ValueScopeName) { + super(`CodeGen: "code" for ${name} not defined`) + this.value = name.value + } +} + +interface ScopeOptions { + prefixes?: Set + parent?: Scope +} + +interface ValueScopeOptions extends ScopeOptions { + scope: ScopeStore + es5?: boolean + lines?: boolean +} + +export type ScopeStore = Record + +type ScopeValues = { + [Prefix in string]?: Map +} + +export type ScopeValueSets = { + [Prefix in string]?: Set +} + +export enum UsedValueState { + Started, + Completed, +} + +export type UsedScopeValues = { + [Prefix in string]?: Map +} + +export const varKinds = { + const: new Name("const"), + let: new Name("let"), + var: new Name("var"), +} + +export class Scope { + protected readonly _names: {[Prefix in string]?: NameGroup} = {} + protected readonly _prefixes?: Set + protected readonly _parent?: Scope + + constructor({prefixes, parent}: ScopeOptions = {}) { + this._prefixes = prefixes + this._parent = parent + } + + toName(nameOrPrefix: Name | string): Name { + return nameOrPrefix instanceof Name ? nameOrPrefix : this.name(nameOrPrefix) + } + + name(prefix: string): Name { + return new Name(this._newName(prefix)) + } + + protected _newName(prefix: string): string { + const ng = this._names[prefix] || this._nameGroup(prefix) + return `${prefix}${ng.index++}` + } + + private _nameGroup(prefix: string): NameGroup { + if (this._parent?._prefixes?.has(prefix) || (this._prefixes && !this._prefixes.has(prefix))) { + throw new Error(`CodeGen: prefix "${prefix}" is not allowed in this scope`) + } + return (this._names[prefix] = {prefix, index: 0}) + } +} + +interface ScopePath { + property: string + itemIndex: number +} + +export class ValueScopeName extends Name { + readonly prefix: string + value?: NameValue + scopePath?: Code + + constructor(prefix: string, nameStr: string) { + super(nameStr) + this.prefix = prefix + } + + setValue(value: NameValue, {property, itemIndex}: ScopePath): void { + this.value = value + this.scopePath = _`.${new Name(property)}[${itemIndex}]` + } +} + +interface VSOptions extends ValueScopeOptions { + _n: Code +} + +const line = _`\n` + +export class ValueScope extends Scope { + protected readonly _values: ScopeValues = {} + protected readonly _scope: ScopeStore + readonly opts: VSOptions + + constructor(opts: ValueScopeOptions) { + super(opts) + this._scope = opts.scope + this.opts = {...opts, _n: opts.lines ? line : nil} + } + + get(): ScopeStore { + return this._scope + } + + name(prefix: string): ValueScopeName { + return new ValueScopeName(prefix, this._newName(prefix)) + } + + value(nameOrPrefix: ValueScopeName | string, value: NameValue): ValueScopeName { + if (value.ref === undefined) throw new Error("CodeGen: ref must be passed in value") + const name = this.toName(nameOrPrefix) as ValueScopeName + const {prefix} = name + const valueKey = value.key ?? value.ref + let vs = this._values[prefix] + if (vs) { + const _name = vs.get(valueKey) + if (_name) return _name + } else { + vs = this._values[prefix] = new Map() + } + vs.set(valueKey, name) + + const s = this._scope[prefix] || (this._scope[prefix] = []) + const itemIndex = s.length + s[itemIndex] = value.ref + name.setValue(value, {property: prefix, itemIndex}) + return name + } + + getValue(prefix: string, keyOrRef: unknown): ValueScopeName | undefined { + const vs = this._values[prefix] + if (!vs) return + return vs.get(keyOrRef) + } + + scopeRefs(scopeName: Name, values: ScopeValues | ScopeValueSets = this._values): Code { + return this._reduceValues(values, (name: ValueScopeName) => { + if (name.scopePath === undefined) throw new Error(`CodeGen: name "${name}" has no value`) + return _`${scopeName}${name.scopePath}` + }) + } + + scopeCode( + values: ScopeValues | ScopeValueSets = this._values, + usedValues?: UsedScopeValues, + getCode?: (n: ValueScopeName) => Code | undefined + ): Code { + return this._reduceValues( + values, + (name: ValueScopeName) => { + if (name.value === undefined) throw new Error(`CodeGen: name "${name}" has no value`) + return name.value.code + }, + usedValues, + getCode + ) + } + + private _reduceValues( + values: ScopeValues | ScopeValueSets, + valueCode: (n: ValueScopeName) => Code | undefined, + usedValues: UsedScopeValues = {}, + getCode?: (n: ValueScopeName) => Code | undefined + ): Code { + let code: Code = nil + for (const prefix in values) { + const vs = values[prefix] + if (!vs) continue + const nameSet = (usedValues[prefix] = usedValues[prefix] || new Map()) + vs.forEach((name: ValueScopeName) => { + if (nameSet.has(name)) return + nameSet.set(name, UsedValueState.Started) + let c = valueCode(name) + if (c) { + const def = this.opts.es5 ? varKinds.var : varKinds.const + code = _`${code}${def} ${name} = ${c};${this.opts._n}` + } else if ((c = getCode?.(name))) { + code = _`${code}${c}${this.opts._n}` + } else { + throw new ValueError(name) + } + nameSet.set(name, UsedValueState.Completed) + }) + } + return code + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/compile/errors.ts b/front_end/third_party/mcp-sdk/ajv/lib/compile/errors.ts new file mode 100644 index 0000000000..18424a0fc6 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/compile/errors.ts @@ -0,0 +1,184 @@ +import type {KeywordErrorCxt, KeywordErrorDefinition} from "../types" +import type {SchemaCxt} from "./index" +import {CodeGen, _, str, strConcat, Code, Name} from "./codegen" +import {SafeExpr} from "./codegen/code" +import {getErrorPath, Type} from "./util" +import N from "./names" + +export const keywordError: KeywordErrorDefinition = { + message: ({keyword}) => str`must pass "${keyword}" keyword validation`, +} + +export const keyword$DataError: KeywordErrorDefinition = { + message: ({keyword, schemaType}) => + schemaType + ? str`"${keyword}" keyword must be ${schemaType} ($data)` + : str`"${keyword}" keyword is invalid ($data)`, +} + +export interface ErrorPaths { + instancePath?: Code + schemaPath?: string + parentSchema?: boolean +} + +export function reportError( + cxt: KeywordErrorCxt, + error: KeywordErrorDefinition = keywordError, + errorPaths?: ErrorPaths, + overrideAllErrors?: boolean +): void { + const {it} = cxt + const {gen, compositeRule, allErrors} = it + const errObj = errorObjectCode(cxt, error, errorPaths) + if (overrideAllErrors ?? (compositeRule || allErrors)) { + addError(gen, errObj) + } else { + returnErrors(it, _`[${errObj}]`) + } +} + +export function reportExtraError( + cxt: KeywordErrorCxt, + error: KeywordErrorDefinition = keywordError, + errorPaths?: ErrorPaths +): void { + const {it} = cxt + const {gen, compositeRule, allErrors} = it + const errObj = errorObjectCode(cxt, error, errorPaths) + addError(gen, errObj) + if (!(compositeRule || allErrors)) { + returnErrors(it, N.vErrors) + } +} + +export function resetErrorsCount(gen: CodeGen, errsCount: Name): void { + gen.assign(N.errors, errsCount) + gen.if(_`${N.vErrors} !== null`, () => + gen.if( + errsCount, + () => gen.assign(_`${N.vErrors}.length`, errsCount), + () => gen.assign(N.vErrors, null) + ) + ) +} + +export function extendErrors({ + gen, + keyword, + schemaValue, + data, + errsCount, + it, +}: KeywordErrorCxt): void { + /* istanbul ignore if */ + if (errsCount === undefined) throw new Error("ajv implementation error") + const err = gen.name("err") + gen.forRange("i", errsCount, N.errors, (i) => { + gen.const(err, _`${N.vErrors}[${i}]`) + gen.if(_`${err}.instancePath === undefined`, () => + gen.assign(_`${err}.instancePath`, strConcat(N.instancePath, it.errorPath)) + ) + gen.assign(_`${err}.schemaPath`, str`${it.errSchemaPath}/${keyword}`) + if (it.opts.verbose) { + gen.assign(_`${err}.schema`, schemaValue) + gen.assign(_`${err}.data`, data) + } + }) +} + +function addError(gen: CodeGen, errObj: Code): void { + const err = gen.const("err", errObj) + gen.if( + _`${N.vErrors} === null`, + () => gen.assign(N.vErrors, _`[${err}]`), + _`${N.vErrors}.push(${err})` + ) + gen.code(_`${N.errors}++`) +} + +function returnErrors(it: SchemaCxt, errs: Code): void { + const {gen, validateName, schemaEnv} = it + if (schemaEnv.$async) { + gen.throw(_`new ${it.ValidationError as Name}(${errs})`) + } else { + gen.assign(_`${validateName}.errors`, errs) + gen.return(false) + } +} + +const E = { + keyword: new Name("keyword"), + schemaPath: new Name("schemaPath"), // also used in JTD errors + params: new Name("params"), + propertyName: new Name("propertyName"), + message: new Name("message"), + schema: new Name("schema"), + parentSchema: new Name("parentSchema"), +} + +function errorObjectCode( + cxt: KeywordErrorCxt, + error: KeywordErrorDefinition, + errorPaths?: ErrorPaths +): Code { + const {createErrors} = cxt.it + if (createErrors === false) return _`{}` + return errorObject(cxt, error, errorPaths) +} + +function errorObject( + cxt: KeywordErrorCxt, + error: KeywordErrorDefinition, + errorPaths: ErrorPaths = {} +): Code { + const {gen, it} = cxt + const keyValues: [Name, SafeExpr | string][] = [ + errorInstancePath(it, errorPaths), + errorSchemaPath(cxt, errorPaths), + ] + extraErrorProps(cxt, error, keyValues) + return gen.object(...keyValues) +} + +function errorInstancePath({errorPath}: SchemaCxt, {instancePath}: ErrorPaths): [Name, Code] { + const instPath = instancePath + ? str`${errorPath}${getErrorPath(instancePath, Type.Str)}` + : errorPath + return [N.instancePath, strConcat(N.instancePath, instPath)] +} + +function errorSchemaPath( + {keyword, it: {errSchemaPath}}: KeywordErrorCxt, + {schemaPath, parentSchema}: ErrorPaths +): [Name, string | Code] { + let schPath = parentSchema ? errSchemaPath : str`${errSchemaPath}/${keyword}` + if (schemaPath) { + schPath = str`${schPath}${getErrorPath(schemaPath, Type.Str)}` + } + return [E.schemaPath, schPath] +} + +function extraErrorProps( + cxt: KeywordErrorCxt, + {params, message}: KeywordErrorDefinition, + keyValues: [Name, SafeExpr | string][] +): void { + const {keyword, data, schemaValue, it} = cxt + const {opts, propertyName, topSchemaRef, schemaPath} = it + keyValues.push( + [E.keyword, keyword], + [E.params, typeof params == "function" ? params(cxt) : params || _`{}`] + ) + if (opts.messages) { + keyValues.push([E.message, typeof message == "function" ? message(cxt) : message]) + } + if (opts.verbose) { + keyValues.push( + [E.schema, schemaValue], + [E.parentSchema, _`${topSchemaRef}${schemaPath}`], + [N.data, data] + ) + } + if (propertyName) keyValues.push([E.propertyName, propertyName]) +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/compile/index.ts b/front_end/third_party/mcp-sdk/ajv/lib/compile/index.ts new file mode 100644 index 0000000000..bfc3934552 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/compile/index.ts @@ -0,0 +1,324 @@ +import type { + AnySchema, + AnySchemaObject, + AnyValidateFunction, + AsyncValidateFunction, + EvaluatedProperties, + EvaluatedItems, +} from "../types" +import type Ajv from "../core" +import type {InstanceOptions} from "../core" +import {CodeGen, _, nil, stringify, Name, Code, ValueScopeName} from "./codegen" +import ValidationError from "../runtime/validation_error" +import N from "./names" +import {LocalRefs, getFullPath, _getFullPath, inlineRef, normalizeId, resolveUrl} from "./resolve" +import {schemaHasRulesButRef, unescapeFragment} from "./util" +import {validateFunctionCode} from "./validate" +import {URIComponent} from "fast-uri" +import {JSONType} from "./rules" + +export type SchemaRefs = { + [Ref in string]?: SchemaEnv | AnySchema +} + +export interface SchemaCxt { + readonly gen: CodeGen + readonly allErrors?: boolean // validation mode - whether to collect all errors or break on error + readonly data: Name // Name with reference to the current part of data instance + readonly parentData: Name // should be used in keywords modifying data + readonly parentDataProperty: Code | number // should be used in keywords modifying data + readonly dataNames: Name[] + readonly dataPathArr: (Code | number)[] + readonly dataLevel: number // the level of the currently validated data, + // it can be used to access both the property names and the data on all levels from the top. + dataTypes: JSONType[] // data types applied to the current part of data instance + definedProperties: Set // set of properties to keep track of for required checks + readonly topSchemaRef: Code + readonly validateName: Name + evaluated?: Name + readonly ValidationError?: Name + readonly schema: AnySchema // current schema object - equal to parentSchema passed via KeywordCxt + readonly schemaEnv: SchemaEnv + readonly rootId: string + baseId: string // the current schema base URI that should be used as the base for resolving URIs in references (\$ref) + readonly schemaPath: Code // the run-time expression that evaluates to the property name of the current schema + readonly errSchemaPath: string // this is actual string, should not be changed to Code + readonly errorPath: Code + readonly propertyName?: Name + readonly compositeRule?: boolean // true indicates that the current schema is inside the compound keyword, + // where failing some rule doesn't mean validation failure (`anyOf`, `oneOf`, `not`, `if`). + // This flag is used to determine whether you can return validation result immediately after any error in case the option `allErrors` is not `true. + // You only need to use it if you have many steps in your keywords and potentially can define multiple errors. + props?: EvaluatedProperties | Name // properties evaluated by this schema - used by parent schema or assigned to validation function + items?: EvaluatedItems | Name // last item evaluated by this schema - used by parent schema or assigned to validation function + jtdDiscriminator?: string + jtdMetadata?: boolean + readonly createErrors?: boolean + readonly opts: InstanceOptions // Ajv instance option. + readonly self: Ajv // current Ajv instance +} + +export interface SchemaObjCxt extends SchemaCxt { + readonly schema: AnySchemaObject +} +interface SchemaEnvArgs { + readonly schema: AnySchema + readonly schemaId?: "$id" | "id" + readonly root?: SchemaEnv + readonly baseId?: string + readonly schemaPath?: string + readonly localRefs?: LocalRefs + readonly meta?: boolean +} + +export class SchemaEnv implements SchemaEnvArgs { + readonly schema: AnySchema + readonly schemaId?: "$id" | "id" + readonly root: SchemaEnv + baseId: string // TODO possibly, it should be readonly + schemaPath?: string + localRefs?: LocalRefs + readonly meta?: boolean + readonly $async?: boolean // true if the current schema is asynchronous. + readonly refs: SchemaRefs = {} + readonly dynamicAnchors: {[Ref in string]?: true} = {} + validate?: AnyValidateFunction + validateName?: ValueScopeName + serialize?: (data: unknown) => string + serializeName?: ValueScopeName + parse?: (data: string) => unknown + parseName?: ValueScopeName + + constructor(env: SchemaEnvArgs) { + let schema: AnySchemaObject | undefined + if (typeof env.schema == "object") schema = env.schema + this.schema = env.schema + this.schemaId = env.schemaId + this.root = env.root || this + this.baseId = env.baseId ?? normalizeId(schema?.[env.schemaId || "$id"]) + this.schemaPath = env.schemaPath + this.localRefs = env.localRefs + this.meta = env.meta + this.$async = schema?.$async + this.refs = {} + } +} + +// let codeSize = 0 +// let nodeCount = 0 + +// Compiles schema in SchemaEnv +export function compileSchema(this: Ajv, sch: SchemaEnv): SchemaEnv { + // TODO refactor - remove compilations + const _sch = getCompilingSchema.call(this, sch) + if (_sch) return _sch + const rootId = getFullPath(this.opts.uriResolver, sch.root.baseId) // TODO if getFullPath removed 1 tests fails + const {es5, lines} = this.opts.code + const {ownProperties} = this.opts + const gen = new CodeGen(this.scope, {es5, lines, ownProperties}) + let _ValidationError + if (sch.$async) { + _ValidationError = gen.scopeValue("Error", { + ref: ValidationError, + code: _`require("ajv/dist/runtime/validation_error").default`, + }) + } + + const validateName = gen.scopeName("validate") + sch.validateName = validateName + + const schemaCxt: SchemaCxt = { + gen, + allErrors: this.opts.allErrors, + data: N.data, + parentData: N.parentData, + parentDataProperty: N.parentDataProperty, + dataNames: [N.data], + dataPathArr: [nil], // TODO can its length be used as dataLevel if nil is removed? + dataLevel: 0, + dataTypes: [], + definedProperties: new Set(), + topSchemaRef: gen.scopeValue( + "schema", + this.opts.code.source === true + ? {ref: sch.schema, code: stringify(sch.schema)} + : {ref: sch.schema} + ), + validateName, + ValidationError: _ValidationError, + schema: sch.schema, + schemaEnv: sch, + rootId, + baseId: sch.baseId || rootId, + schemaPath: nil, + errSchemaPath: sch.schemaPath || (this.opts.jtd ? "" : "#"), + errorPath: _`""`, + opts: this.opts, + self: this, + } + + let sourceCode: string | undefined + try { + this._compilations.add(sch) + validateFunctionCode(schemaCxt) + gen.optimize(this.opts.code.optimize) + // gen.optimize(1) + const validateCode = gen.toString() + sourceCode = `${gen.scopeRefs(N.scope)}return ${validateCode}` + // console.log((codeSize += sourceCode.length), (nodeCount += gen.nodeCount)) + if (this.opts.code.process) sourceCode = this.opts.code.process(sourceCode, sch) + // console.log("\n\n\n *** \n", sourceCode) + const makeValidate = new Function(`${N.self}`, `${N.scope}`, sourceCode) + const validate: AnyValidateFunction = makeValidate(this, this.scope.get()) + this.scope.value(validateName, {ref: validate}) + + validate.errors = null + validate.schema = sch.schema + validate.schemaEnv = sch + if (sch.$async) (validate as AsyncValidateFunction).$async = true + if (this.opts.code.source === true) { + validate.source = {validateName, validateCode, scopeValues: gen._values} + } + if (this.opts.unevaluated) { + const {props, items} = schemaCxt + validate.evaluated = { + props: props instanceof Name ? undefined : props, + items: items instanceof Name ? undefined : items, + dynamicProps: props instanceof Name, + dynamicItems: items instanceof Name, + } + if (validate.source) validate.source.evaluated = stringify(validate.evaluated) + } + sch.validate = validate + return sch + } catch (e) { + delete sch.validate + delete sch.validateName + if (sourceCode) this.logger.error("Error compiling schema, function code:", sourceCode) + // console.log("\n\n\n *** \n", sourceCode, this.opts) + throw e + } finally { + this._compilations.delete(sch) + } +} + +export function resolveRef( + this: Ajv, + root: SchemaEnv, + baseId: string, + ref: string +): AnySchema | SchemaEnv | undefined { + ref = resolveUrl(this.opts.uriResolver, baseId, ref) + const schOrFunc = root.refs[ref] + if (schOrFunc) return schOrFunc + + let _sch = resolve.call(this, root, ref) + if (_sch === undefined) { + const schema = root.localRefs?.[ref] // TODO maybe localRefs should hold SchemaEnv + const {schemaId} = this.opts + if (schema) _sch = new SchemaEnv({schema, schemaId, root, baseId}) + } + + if (_sch === undefined) return + return (root.refs[ref] = inlineOrCompile.call(this, _sch)) +} + +function inlineOrCompile(this: Ajv, sch: SchemaEnv): AnySchema | SchemaEnv { + if (inlineRef(sch.schema, this.opts.inlineRefs)) return sch.schema + return sch.validate ? sch : compileSchema.call(this, sch) +} + +// Index of schema compilation in the currently compiled list +export function getCompilingSchema(this: Ajv, schEnv: SchemaEnv): SchemaEnv | void { + for (const sch of this._compilations) { + if (sameSchemaEnv(sch, schEnv)) return sch + } +} + +function sameSchemaEnv(s1: SchemaEnv, s2: SchemaEnv): boolean { + return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId +} + +// resolve and compile the references ($ref) +// TODO returns AnySchemaObject (if the schema can be inlined) or validation function +function resolve( + this: Ajv, + root: SchemaEnv, // information about the root schema for the current schema + ref: string // reference to resolve +): SchemaEnv | undefined { + let sch + while (typeof (sch = this.refs[ref]) == "string") ref = sch + return sch || this.schemas[ref] || resolveSchema.call(this, root, ref) +} + +// Resolve schema, its root and baseId +export function resolveSchema( + this: Ajv, + root: SchemaEnv, // root object with properties schema, refs TODO below SchemaEnv is assigned to it + ref: string // reference to resolve +): SchemaEnv | undefined { + const p = this.opts.uriResolver.parse(ref) + const refPath = _getFullPath(this.opts.uriResolver, p) + let baseId = getFullPath(this.opts.uriResolver, root.baseId, undefined) + // TODO `Object.keys(root.schema).length > 0` should not be needed - but removing breaks 2 tests + if (Object.keys(root.schema).length > 0 && refPath === baseId) { + return getJsonPointer.call(this, p, root) + } + + const id = normalizeId(refPath) + const schOrRef = this.refs[id] || this.schemas[id] + if (typeof schOrRef == "string") { + const sch = resolveSchema.call(this, root, schOrRef) + if (typeof sch?.schema !== "object") return + return getJsonPointer.call(this, p, sch) + } + + if (typeof schOrRef?.schema !== "object") return + if (!schOrRef.validate) compileSchema.call(this, schOrRef) + if (id === normalizeId(ref)) { + const {schema} = schOrRef + const {schemaId} = this.opts + const schId = schema[schemaId] + if (schId) baseId = resolveUrl(this.opts.uriResolver, baseId, schId) + return new SchemaEnv({schema, schemaId, root, baseId}) + } + return getJsonPointer.call(this, p, schOrRef) +} + +const PREVENT_SCOPE_CHANGE = new Set([ + "properties", + "patternProperties", + "enum", + "dependencies", + "definitions", +]) + +function getJsonPointer( + this: Ajv, + parsedRef: URIComponent, + {baseId, schema, root}: SchemaEnv +): SchemaEnv | undefined { + if (parsedRef.fragment?.[0] !== "/") return + for (const part of parsedRef.fragment.slice(1).split("/")) { + if (typeof schema === "boolean") return + const partSchema = schema[unescapeFragment(part)] + if (partSchema === undefined) return + schema = partSchema + // TODO PREVENT_SCOPE_CHANGE could be defined in keyword def? + const schId = typeof schema === "object" && schema[this.opts.schemaId] + if (!PREVENT_SCOPE_CHANGE.has(part) && schId) { + baseId = resolveUrl(this.opts.uriResolver, baseId, schId) + } + } + let env: SchemaEnv | undefined + if (typeof schema != "boolean" && schema.$ref && !schemaHasRulesButRef(schema, this.RULES)) { + const $ref = resolveUrl(this.opts.uriResolver, baseId, schema.$ref) + env = resolveSchema.call(this, root, $ref) + } + // even though resolution failed we need to return SchemaEnv to throw exception + // so that compileAsync loads missing schema. + const {schemaId} = this.opts + env = env || new SchemaEnv({schema, schemaId, root, baseId}) + if (env.schema !== env.root.schema) return env + return undefined +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/compile/jtd/parse.ts b/front_end/third_party/mcp-sdk/ajv/lib/compile/jtd/parse.ts new file mode 100644 index 0000000000..a0141c770c --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/compile/jtd/parse.ts @@ -0,0 +1,411 @@ +import type Ajv from "../../core" +import type {SchemaObject} from "../../types" +import {jtdForms, JTDForm, SchemaObjectMap} from "./types" +import {SchemaEnv, getCompilingSchema} from ".." +import {_, str, and, or, nil, not, CodeGen, Code, Name, SafeExpr} from "../codegen" +import MissingRefError from "../ref_error" +import N from "../names" +import {hasPropFunc} from "../../vocabularies/code" +import {hasRef} from "../../vocabularies/jtd/ref" +import {intRange, IntType} from "../../vocabularies/jtd/type" +import {parseJson, parseJsonNumber, parseJsonString} from "../../runtime/parseJson" +import {useFunc} from "../util" +import validTimestamp from "../../runtime/timestamp" + +type GenParse = (cxt: ParseCxt) => void + +const genParse: {[F in JTDForm]: GenParse} = { + elements: parseElements, + values: parseValues, + discriminator: parseDiscriminator, + properties: parseProperties, + optionalProperties: parseProperties, + enum: parseEnum, + type: parseType, + ref: parseRef, +} + +interface ParseCxt { + readonly gen: CodeGen + readonly self: Ajv // current Ajv instance + readonly schemaEnv: SchemaEnv + readonly definitions: SchemaObjectMap + schema: SchemaObject + data: Code + parseName: Name + char: Name +} + +export default function compileParser( + this: Ajv, + sch: SchemaEnv, + definitions: SchemaObjectMap +): SchemaEnv { + const _sch = getCompilingSchema.call(this, sch) + if (_sch) return _sch + const {es5, lines} = this.opts.code + const {ownProperties} = this.opts + const gen = new CodeGen(this.scope, {es5, lines, ownProperties}) + const parseName = gen.scopeName("parse") + const cxt: ParseCxt = { + self: this, + gen, + schema: sch.schema as SchemaObject, + schemaEnv: sch, + definitions, + data: N.data, + parseName, + char: gen.name("c"), + } + + let sourceCode: string | undefined + try { + this._compilations.add(sch) + sch.parseName = parseName + parserFunction(cxt) + gen.optimize(this.opts.code.optimize) + const parseFuncCode = gen.toString() + sourceCode = `${gen.scopeRefs(N.scope)}return ${parseFuncCode}` + const makeParse = new Function(`${N.scope}`, sourceCode) + const parse: (json: string) => unknown = makeParse(this.scope.get()) + this.scope.value(parseName, {ref: parse}) + sch.parse = parse + } catch (e) { + if (sourceCode) this.logger.error("Error compiling parser, function code:", sourceCode) + delete sch.parse + delete sch.parseName + throw e + } finally { + this._compilations.delete(sch) + } + return sch +} + +const undef = _`undefined` + +function parserFunction(cxt: ParseCxt): void { + const {gen, parseName, char} = cxt + gen.func(parseName, _`${N.json}, ${N.jsonPos}, ${N.jsonPart}`, false, () => { + gen.let(N.data) + gen.let(char) + gen.assign(_`${parseName}.message`, undef) + gen.assign(_`${parseName}.position`, undef) + gen.assign(N.jsonPos, _`${N.jsonPos} || 0`) + gen.const(N.jsonLen, _`${N.json}.length`) + parseCode(cxt) + skipWhitespace(cxt) + gen.if(N.jsonPart, () => { + gen.assign(_`${parseName}.position`, N.jsonPos) + gen.return(N.data) + }) + gen.if(_`${N.jsonPos} === ${N.jsonLen}`, () => gen.return(N.data)) + jsonSyntaxError(cxt) + }) +} + +function parseCode(cxt: ParseCxt): void { + let form: JTDForm | undefined + for (const key of jtdForms) { + if (key in cxt.schema) { + form = key + break + } + } + if (form) parseNullable(cxt, genParse[form]) + else parseEmpty(cxt) +} + +const parseBoolean = parseBooleanToken(true, parseBooleanToken(false, jsonSyntaxError)) + +function parseNullable(cxt: ParseCxt, parseForm: GenParse): void { + const {gen, schema, data} = cxt + if (!schema.nullable) return parseForm(cxt) + tryParseToken(cxt, "null", parseForm, () => gen.assign(data, null)) +} + +function parseElements(cxt: ParseCxt): void { + const {gen, schema, data} = cxt + parseToken(cxt, "[") + const ix = gen.let("i", 0) + gen.assign(data, _`[]`) + parseItems(cxt, "]", () => { + const el = gen.let("el") + parseCode({...cxt, schema: schema.elements, data: el}) + gen.assign(_`${data}[${ix}++]`, el) + }) +} + +function parseValues(cxt: ParseCxt): void { + const {gen, schema, data} = cxt + parseToken(cxt, "{") + gen.assign(data, _`{}`) + parseItems(cxt, "}", () => parseKeyValue(cxt, schema.values)) +} + +function parseItems(cxt: ParseCxt, endToken: string, block: () => void): void { + tryParseItems(cxt, endToken, block) + parseToken(cxt, endToken) +} + +function tryParseItems(cxt: ParseCxt, endToken: string, block: () => void): void { + const {gen} = cxt + gen.for(_`;${N.jsonPos}<${N.jsonLen} && ${jsonSlice(1)}!==${endToken};`, () => { + block() + tryParseToken(cxt, ",", () => gen.break(), hasItem) + }) + + function hasItem(): void { + tryParseToken(cxt, endToken, () => {}, jsonSyntaxError) + } +} + +function parseKeyValue(cxt: ParseCxt, schema: SchemaObject): void { + const {gen} = cxt + const key = gen.let("key") + parseString({...cxt, data: key}) + parseToken(cxt, ":") + parsePropertyValue(cxt, key, schema) +} + +function parseDiscriminator(cxt: ParseCxt): void { + const {gen, data, schema} = cxt + const {discriminator, mapping} = schema + parseToken(cxt, "{") + gen.assign(data, _`{}`) + const startPos = gen.const("pos", N.jsonPos) + const value = gen.let("value") + const tag = gen.let("tag") + tryParseItems(cxt, "}", () => { + const key = gen.let("key") + parseString({...cxt, data: key}) + parseToken(cxt, ":") + gen.if( + _`${key} === ${discriminator}`, + () => { + parseString({...cxt, data: tag}) + gen.assign(_`${data}[${key}]`, tag) + gen.break() + }, + () => parseEmpty({...cxt, data: value}) // can be discarded/skipped + ) + }) + gen.assign(N.jsonPos, startPos) + gen.if(_`${tag} === undefined`) + parsingError(cxt, str`discriminator tag not found`) + for (const tagValue in mapping) { + gen.elseIf(_`${tag} === ${tagValue}`) + parseSchemaProperties({...cxt, schema: mapping[tagValue]}, discriminator) + } + gen.else() + parsingError(cxt, str`discriminator value not in schema`) + gen.endIf() +} + +function parseProperties(cxt: ParseCxt): void { + const {gen, data} = cxt + parseToken(cxt, "{") + gen.assign(data, _`{}`) + parseSchemaProperties(cxt) +} + +function parseSchemaProperties(cxt: ParseCxt, discriminator?: string): void { + const {gen, schema, data} = cxt + const {properties, optionalProperties, additionalProperties} = schema + parseItems(cxt, "}", () => { + const key = gen.let("key") + parseString({...cxt, data: key}) + parseToken(cxt, ":") + gen.if(false) + parseDefinedProperty(cxt, key, properties) + parseDefinedProperty(cxt, key, optionalProperties) + if (discriminator) { + gen.elseIf(_`${key} === ${discriminator}`) + const tag = gen.let("tag") + parseString({...cxt, data: tag}) // can be discarded, it is already assigned + } + gen.else() + if (additionalProperties) { + parseEmpty({...cxt, data: _`${data}[${key}]`}) + } else { + parsingError(cxt, str`property ${key} not allowed`) + } + gen.endIf() + }) + if (properties) { + const hasProp = hasPropFunc(gen) + const allProps: Code = and( + ...Object.keys(properties).map((p): Code => _`${hasProp}.call(${data}, ${p})`) + ) + gen.if(not(allProps), () => parsingError(cxt, str`missing required properties`)) + } +} + +function parseDefinedProperty(cxt: ParseCxt, key: Name, schemas: SchemaObjectMap = {}): void { + const {gen} = cxt + for (const prop in schemas) { + gen.elseIf(_`${key} === ${prop}`) + parsePropertyValue(cxt, key, schemas[prop] as SchemaObject) + } +} + +function parsePropertyValue(cxt: ParseCxt, key: Name, schema: SchemaObject): void { + parseCode({...cxt, schema, data: _`${cxt.data}[${key}]`}) +} + +function parseType(cxt: ParseCxt): void { + const {gen, schema, data, self} = cxt + switch (schema.type) { + case "boolean": + parseBoolean(cxt) + break + case "string": + parseString(cxt) + break + case "timestamp": { + parseString(cxt) + const vts = useFunc(gen, validTimestamp) + const {allowDate, parseDate} = self.opts + const notValid = allowDate ? _`!${vts}(${data}, true)` : _`!${vts}(${data})` + const fail: Code = parseDate + ? or(notValid, _`(${data} = new Date(${data}), false)`, _`isNaN(${data}.valueOf())`) + : notValid + gen.if(fail, () => parsingError(cxt, str`invalid timestamp`)) + break + } + case "float32": + case "float64": + parseNumber(cxt) + break + default: { + const t = schema.type as IntType + if (!self.opts.int32range && (t === "int32" || t === "uint32")) { + parseNumber(cxt, 16) // 2 ** 53 - max safe integer + if (t === "uint32") { + gen.if(_`${data} < 0`, () => parsingError(cxt, str`integer out of range`)) + } + } else { + const [min, max, maxDigits] = intRange[t] + parseNumber(cxt, maxDigits) + gen.if(_`${data} < ${min} || ${data} > ${max}`, () => + parsingError(cxt, str`integer out of range`) + ) + } + } + } +} + +function parseString(cxt: ParseCxt): void { + parseToken(cxt, '"') + parseWith(cxt, parseJsonString) +} + +function parseEnum(cxt: ParseCxt): void { + const {gen, data, schema} = cxt + const enumSch = schema.enum + parseToken(cxt, '"') + // TODO loopEnum + gen.if(false) + for (const value of enumSch) { + const valueStr = JSON.stringify(value).slice(1) // remove starting quote + gen.elseIf(_`${jsonSlice(valueStr.length)} === ${valueStr}`) + gen.assign(data, str`${value}`) + gen.add(N.jsonPos, valueStr.length) + } + gen.else() + jsonSyntaxError(cxt) + gen.endIf() +} + +function parseNumber(cxt: ParseCxt, maxDigits?: number): void { + const {gen} = cxt + skipWhitespace(cxt) + gen.if( + _`"-0123456789".indexOf(${jsonSlice(1)}) < 0`, + () => jsonSyntaxError(cxt), + () => parseWith(cxt, parseJsonNumber, maxDigits) + ) +} + +function parseBooleanToken(bool: boolean, fail: GenParse): GenParse { + return (cxt) => { + const {gen, data} = cxt + tryParseToken( + cxt, + `${bool}`, + () => fail(cxt), + () => gen.assign(data, bool) + ) + } +} + +function parseRef(cxt: ParseCxt): void { + const {gen, self, definitions, schema, schemaEnv} = cxt + const {ref} = schema + const refSchema = definitions[ref] + if (!refSchema) throw new MissingRefError(self.opts.uriResolver, "", ref, `No definition ${ref}`) + if (!hasRef(refSchema)) return parseCode({...cxt, schema: refSchema}) + const {root} = schemaEnv + const sch = compileParser.call(self, new SchemaEnv({schema: refSchema, root}), definitions) + partialParse(cxt, getParser(gen, sch), true) +} + +function getParser(gen: CodeGen, sch: SchemaEnv): Code { + return sch.parse + ? gen.scopeValue("parse", {ref: sch.parse}) + : _`${gen.scopeValue("wrapper", {ref: sch})}.parse` +} + +function parseEmpty(cxt: ParseCxt): void { + parseWith(cxt, parseJson) +} + +function parseWith(cxt: ParseCxt, parseFunc: {code: string}, args?: SafeExpr): void { + partialParse(cxt, useFunc(cxt.gen, parseFunc), args) +} + +function partialParse(cxt: ParseCxt, parseFunc: Name, args?: SafeExpr): void { + const {gen, data} = cxt + gen.assign(data, _`${parseFunc}(${N.json}, ${N.jsonPos}${args ? _`, ${args}` : nil})`) + gen.assign(N.jsonPos, _`${parseFunc}.position`) + gen.if(_`${data} === undefined`, () => parsingError(cxt, _`${parseFunc}.message`)) +} + +function parseToken(cxt: ParseCxt, tok: string): void { + tryParseToken(cxt, tok, jsonSyntaxError) +} + +function tryParseToken(cxt: ParseCxt, tok: string, fail: GenParse, success?: GenParse): void { + const {gen} = cxt + const n = tok.length + skipWhitespace(cxt) + gen.if( + _`${jsonSlice(n)} === ${tok}`, + () => { + gen.add(N.jsonPos, n) + success?.(cxt) + }, + () => fail(cxt) + ) +} + +function skipWhitespace({gen, char: c}: ParseCxt): void { + gen.code( + _`while((${c}=${N.json}[${N.jsonPos}],${c}===" "||${c}==="\\n"||${c}==="\\r"||${c}==="\\t"))${N.jsonPos}++;` + ) +} + +function jsonSlice(len: number | Name): Code { + return len === 1 + ? _`${N.json}[${N.jsonPos}]` + : _`${N.json}.slice(${N.jsonPos}, ${N.jsonPos}+${len})` +} + +function jsonSyntaxError(cxt: ParseCxt): void { + parsingError(cxt, _`"unexpected token " + ${N.json}[${N.jsonPos}]`) +} + +function parsingError({gen, parseName}: ParseCxt, msg: Code): void { + gen.assign(_`${parseName}.message`, msg) + gen.assign(_`${parseName}.position`, N.jsonPos) + gen.return(undef) +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/compile/jtd/serialize.ts b/front_end/third_party/mcp-sdk/ajv/lib/compile/jtd/serialize.ts new file mode 100644 index 0000000000..1d228826d4 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/compile/jtd/serialize.ts @@ -0,0 +1,266 @@ +import type Ajv from "../../core" +import type {SchemaObject} from "../../types" +import {jtdForms, JTDForm, SchemaObjectMap} from "./types" +import {SchemaEnv, getCompilingSchema} from ".." +import {_, str, and, getProperty, CodeGen, Code, Name} from "../codegen" +import MissingRefError from "../ref_error" +import N from "../names" +import {isOwnProperty} from "../../vocabularies/code" +import {hasRef} from "../../vocabularies/jtd/ref" +import {useFunc} from "../util" +import quote from "../../runtime/quote" + +const genSerialize: {[F in JTDForm]: (cxt: SerializeCxt) => void} = { + elements: serializeElements, + values: serializeValues, + discriminator: serializeDiscriminator, + properties: serializeProperties, + optionalProperties: serializeProperties, + enum: serializeString, + type: serializeType, + ref: serializeRef, +} + +interface SerializeCxt { + readonly gen: CodeGen + readonly self: Ajv // current Ajv instance + readonly schemaEnv: SchemaEnv + readonly definitions: SchemaObjectMap + schema: SchemaObject + data: Code +} + +export default function compileSerializer( + this: Ajv, + sch: SchemaEnv, + definitions: SchemaObjectMap +): SchemaEnv { + const _sch = getCompilingSchema.call(this, sch) + if (_sch) return _sch + const {es5, lines} = this.opts.code + const {ownProperties} = this.opts + const gen = new CodeGen(this.scope, {es5, lines, ownProperties}) + const serializeName = gen.scopeName("serialize") + const cxt: SerializeCxt = { + self: this, + gen, + schema: sch.schema as SchemaObject, + schemaEnv: sch, + definitions, + data: N.data, + } + + let sourceCode: string | undefined + try { + this._compilations.add(sch) + sch.serializeName = serializeName + gen.func(serializeName, N.data, false, () => { + gen.let(N.json, str``) + serializeCode(cxt) + gen.return(N.json) + }) + gen.optimize(this.opts.code.optimize) + const serializeFuncCode = gen.toString() + sourceCode = `${gen.scopeRefs(N.scope)}return ${serializeFuncCode}` + const makeSerialize = new Function(`${N.scope}`, sourceCode) + const serialize: (data: unknown) => string = makeSerialize(this.scope.get()) + this.scope.value(serializeName, {ref: serialize}) + sch.serialize = serialize + } catch (e) { + if (sourceCode) this.logger.error("Error compiling serializer, function code:", sourceCode) + delete sch.serialize + delete sch.serializeName + throw e + } finally { + this._compilations.delete(sch) + } + return sch +} + +function serializeCode(cxt: SerializeCxt): void { + let form: JTDForm | undefined + for (const key of jtdForms) { + if (key in cxt.schema) { + form = key + break + } + } + serializeNullable(cxt, form ? genSerialize[form] : serializeEmpty) +} + +function serializeNullable(cxt: SerializeCxt, serializeForm: (_cxt: SerializeCxt) => void): void { + const {gen, schema, data} = cxt + if (!schema.nullable) return serializeForm(cxt) + gen.if( + _`${data} === undefined || ${data} === null`, + () => gen.add(N.json, _`"null"`), + () => serializeForm(cxt) + ) +} + +function serializeElements(cxt: SerializeCxt): void { + const {gen, schema, data} = cxt + gen.add(N.json, str`[`) + const first = gen.let("first", true) + gen.forOf("el", data, (el) => { + addComma(cxt, first) + serializeCode({...cxt, schema: schema.elements, data: el}) + }) + gen.add(N.json, str`]`) +} + +function serializeValues(cxt: SerializeCxt): void { + const {gen, schema, data} = cxt + gen.add(N.json, str`{`) + const first = gen.let("first", true) + gen.forIn("key", data, (key) => serializeKeyValue(cxt, key, schema.values, first)) + gen.add(N.json, str`}`) +} + +function serializeKeyValue(cxt: SerializeCxt, key: Name, schema: SchemaObject, first?: Name): void { + const {gen, data} = cxt + addComma(cxt, first) + serializeString({...cxt, data: key}) + gen.add(N.json, str`:`) + const value = gen.const("value", _`${data}${getProperty(key)}`) + serializeCode({...cxt, schema, data: value}) +} + +function serializeDiscriminator(cxt: SerializeCxt): void { + const {gen, schema, data} = cxt + const {discriminator} = schema + gen.add(N.json, str`{${JSON.stringify(discriminator)}:`) + const tag = gen.const("tag", _`${data}${getProperty(discriminator)}`) + serializeString({...cxt, data: tag}) + gen.if(false) + for (const tagValue in schema.mapping) { + gen.elseIf(_`${tag} === ${tagValue}`) + const sch = schema.mapping[tagValue] + serializeSchemaProperties({...cxt, schema: sch}, discriminator) + } + gen.endIf() + gen.add(N.json, str`}`) +} + +function serializeProperties(cxt: SerializeCxt): void { + const {gen} = cxt + gen.add(N.json, str`{`) + serializeSchemaProperties(cxt) + gen.add(N.json, str`}`) +} + +function serializeSchemaProperties(cxt: SerializeCxt, discriminator?: string): void { + const {gen, schema, data} = cxt + const {properties, optionalProperties} = schema + const props = keys(properties) + const optProps = keys(optionalProperties) + const allProps = allProperties(props.concat(optProps)) + let first = !discriminator + let firstProp: Name | undefined + + for (const key of props) { + if (first) first = false + else gen.add(N.json, str`,`) + serializeProperty(key, properties[key], keyValue(key)) + } + if (first) firstProp = gen.let("first", true) + for (const key of optProps) { + const value = keyValue(key) + gen.if(and(_`${value} !== undefined`, isOwnProperty(gen, data, key)), () => { + addComma(cxt, firstProp) + serializeProperty(key, optionalProperties[key], value) + }) + } + if (schema.additionalProperties) { + gen.forIn("key", data, (key) => + gen.if(isAdditional(key, allProps), () => serializeKeyValue(cxt, key, {}, firstProp)) + ) + } + + function keys(ps?: SchemaObjectMap): string[] { + return ps ? Object.keys(ps) : [] + } + + function allProperties(ps: string[]): string[] { + if (discriminator) ps.push(discriminator) + if (new Set(ps).size !== ps.length) { + throw new Error("JTD: properties/optionalProperties/disciminator overlap") + } + return ps + } + + function keyValue(key: string): Name { + return gen.const("value", _`${data}${getProperty(key)}`) + } + + function serializeProperty(key: string, propSchema: SchemaObject, value: Name): void { + gen.add(N.json, str`${JSON.stringify(key)}:`) + serializeCode({...cxt, schema: propSchema, data: value}) + } + + function isAdditional(key: Name, ps: string[]): Code | true { + return ps.length ? and(...ps.map((p) => _`${key} !== ${p}`)) : true + } +} + +function serializeType(cxt: SerializeCxt): void { + const {gen, schema, data} = cxt + switch (schema.type) { + case "boolean": + gen.add(N.json, _`${data} ? "true" : "false"`) + break + case "string": + serializeString(cxt) + break + case "timestamp": + gen.if( + _`${data} instanceof Date`, + () => gen.add(N.json, _`'"' + ${data}.toISOString() + '"'`), + () => serializeString(cxt) + ) + break + default: + serializeNumber(cxt) + } +} + +function serializeString({gen, data}: SerializeCxt): void { + gen.add(N.json, _`${useFunc(gen, quote)}(${data})`) +} + +function serializeNumber({gen, data}: SerializeCxt): void { + gen.add(N.json, _`"" + ${data}`) +} + +function serializeRef(cxt: SerializeCxt): void { + const {gen, self, data, definitions, schema, schemaEnv} = cxt + const {ref} = schema + const refSchema = definitions[ref] + if (!refSchema) throw new MissingRefError(self.opts.uriResolver, "", ref, `No definition ${ref}`) + if (!hasRef(refSchema)) return serializeCode({...cxt, schema: refSchema}) + const {root} = schemaEnv + const sch = compileSerializer.call(self, new SchemaEnv({schema: refSchema, root}), definitions) + gen.add(N.json, _`${getSerialize(gen, sch)}(${data})`) +} + +function getSerialize(gen: CodeGen, sch: SchemaEnv): Code { + return sch.serialize + ? gen.scopeValue("serialize", {ref: sch.serialize}) + : _`${gen.scopeValue("wrapper", {ref: sch})}.serialize` +} + +function serializeEmpty({gen, data}: SerializeCxt): void { + gen.add(N.json, _`JSON.stringify(${data})`) +} + +function addComma({gen}: SerializeCxt, first?: Name): void { + if (first) { + gen.if( + first, + () => gen.assign(first, false), + () => gen.add(N.json, str`,`) + ) + } else { + gen.add(N.json, str`,`) + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/compile/jtd/types.ts b/front_end/third_party/mcp-sdk/ajv/lib/compile/jtd/types.ts new file mode 100644 index 0000000000..1258050fdf --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/compile/jtd/types.ts @@ -0,0 +1,16 @@ +import type {SchemaObject} from "../../types" + +export type SchemaObjectMap = {[Ref in string]?: SchemaObject} + +export const jtdForms = [ + "elements", + "values", + "discriminator", + "properties", + "optionalProperties", + "enum", + "type", + "ref", +] as const + +export type JTDForm = (typeof jtdForms)[number] diff --git a/front_end/third_party/mcp-sdk/ajv/lib/compile/names.ts b/front_end/third_party/mcp-sdk/ajv/lib/compile/names.ts new file mode 100644 index 0000000000..b4b242e175 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/compile/names.ts @@ -0,0 +1,27 @@ +import {Name} from "./codegen" + +const names = { + // validation function arguments + data: new Name("data"), // data passed to validation function + // args passed from referencing schema + valCxt: new Name("valCxt"), // validation/data context - should not be used directly, it is destructured to the names below + instancePath: new Name("instancePath"), + parentData: new Name("parentData"), + parentDataProperty: new Name("parentDataProperty"), + rootData: new Name("rootData"), // root data - same as the data passed to the first/top validation function + dynamicAnchors: new Name("dynamicAnchors"), // used to support recursiveRef and dynamicRef + // function scoped variables + vErrors: new Name("vErrors"), // null or array of validation errors + errors: new Name("errors"), // counter of validation errors + this: new Name("this"), + // "globals" + self: new Name("self"), + scope: new Name("scope"), + // JTD serialize/parse name for JSON string and position + json: new Name("json"), + jsonPos: new Name("jsonPos"), + jsonLen: new Name("jsonLen"), + jsonPart: new Name("jsonPart"), +} + +export default names diff --git a/front_end/third_party/mcp-sdk/ajv/lib/compile/ref_error.ts b/front_end/third_party/mcp-sdk/ajv/lib/compile/ref_error.ts new file mode 100644 index 0000000000..386bf04995 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/compile/ref_error.ts @@ -0,0 +1,13 @@ +import {resolveUrl, normalizeId, getFullPath} from "./resolve" +import type {UriResolver} from "../types" + +export default class MissingRefError extends Error { + readonly missingRef: string + readonly missingSchema: string + + constructor(resolver: UriResolver, baseId: string, ref: string, msg?: string) { + super(msg || `can't resolve reference ${ref} from id ${baseId}`) + this.missingRef = resolveUrl(resolver, baseId, ref) + this.missingSchema = normalizeId(getFullPath(resolver, this.missingRef)) + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/compile/resolve.ts b/front_end/third_party/mcp-sdk/ajv/lib/compile/resolve.ts new file mode 100644 index 0000000000..b8c4aca394 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/compile/resolve.ts @@ -0,0 +1,149 @@ +import type {AnySchema, AnySchemaObject, UriResolver} from "../types" +import type Ajv from "../ajv" +import type {URIComponent} from "fast-uri" +import {eachItem} from "./util" +import * as equal from "fast-deep-equal" +import * as traverse from "json-schema-traverse" + +// the hash of local references inside the schema (created by getSchemaRefs), used for inline resolution +export type LocalRefs = {[Ref in string]?: AnySchemaObject} + +// TODO refactor to use keyword definitions +const SIMPLE_INLINED = new Set([ + "type", + "format", + "pattern", + "maxLength", + "minLength", + "maxProperties", + "minProperties", + "maxItems", + "minItems", + "maximum", + "minimum", + "uniqueItems", + "multipleOf", + "required", + "enum", + "const", +]) + +export function inlineRef(schema: AnySchema, limit: boolean | number = true): boolean { + if (typeof schema == "boolean") return true + if (limit === true) return !hasRef(schema) + if (!limit) return false + return countKeys(schema) <= limit +} + +const REF_KEYWORDS = new Set([ + "$ref", + "$recursiveRef", + "$recursiveAnchor", + "$dynamicRef", + "$dynamicAnchor", +]) + +function hasRef(schema: AnySchemaObject): boolean { + for (const key in schema) { + if (REF_KEYWORDS.has(key)) return true + const sch = schema[key] + if (Array.isArray(sch) && sch.some(hasRef)) return true + if (typeof sch == "object" && hasRef(sch)) return true + } + return false +} + +function countKeys(schema: AnySchemaObject): number { + let count = 0 + for (const key in schema) { + if (key === "$ref") return Infinity + count++ + if (SIMPLE_INLINED.has(key)) continue + if (typeof schema[key] == "object") { + eachItem(schema[key], (sch) => (count += countKeys(sch))) + } + if (count === Infinity) return Infinity + } + return count +} + +export function getFullPath(resolver: UriResolver, id = "", normalize?: boolean): string { + if (normalize !== false) id = normalizeId(id) + const p = resolver.parse(id) + return _getFullPath(resolver, p) +} + +export function _getFullPath(resolver: UriResolver, p: URIComponent): string { + const serialized = resolver.serialize(p) + return serialized.split("#")[0] + "#" +} + +const TRAILING_SLASH_HASH = /#\/?$/ +export function normalizeId(id: string | undefined): string { + return id ? id.replace(TRAILING_SLASH_HASH, "") : "" +} + +export function resolveUrl(resolver: UriResolver, baseId: string, id: string): string { + id = normalizeId(id) + return resolver.resolve(baseId, id) +} + +const ANCHOR = /^[a-z_][-a-z0-9._]*$/i + +export function getSchemaRefs(this: Ajv, schema: AnySchema, baseId: string): LocalRefs { + if (typeof schema == "boolean") return {} + const {schemaId, uriResolver} = this.opts + const schId = normalizeId(schema[schemaId] || baseId) + const baseIds: {[JsonPtr in string]?: string} = {"": schId} + const pathPrefix = getFullPath(uriResolver, schId, false) + const localRefs: LocalRefs = {} + const schemaRefs: Set = new Set() + + traverse(schema, {allKeys: true}, (sch, jsonPtr, _, parentJsonPtr) => { + if (parentJsonPtr === undefined) return + const fullPath = pathPrefix + jsonPtr + let innerBaseId = baseIds[parentJsonPtr] + if (typeof sch[schemaId] == "string") innerBaseId = addRef.call(this, sch[schemaId]) + addAnchor.call(this, sch.$anchor) + addAnchor.call(this, sch.$dynamicAnchor) + baseIds[jsonPtr] = innerBaseId + + function addRef(this: Ajv, ref: string): string { + // eslint-disable-next-line @typescript-eslint/unbound-method + const _resolve = this.opts.uriResolver.resolve + ref = normalizeId(innerBaseId ? _resolve(innerBaseId, ref) : ref) + if (schemaRefs.has(ref)) throw ambiguos(ref) + schemaRefs.add(ref) + let schOrRef = this.refs[ref] + if (typeof schOrRef == "string") schOrRef = this.refs[schOrRef] + if (typeof schOrRef == "object") { + checkAmbiguosRef(sch, schOrRef.schema, ref) + } else if (ref !== normalizeId(fullPath)) { + if (ref[0] === "#") { + checkAmbiguosRef(sch, localRefs[ref], ref) + localRefs[ref] = sch + } else { + this.refs[ref] = fullPath + } + } + return ref + } + + function addAnchor(this: Ajv, anchor: unknown): void { + if (typeof anchor == "string") { + if (!ANCHOR.test(anchor)) throw new Error(`invalid anchor "${anchor}"`) + addRef.call(this, `#${anchor}`) + } + } + }) + + return localRefs + + function checkAmbiguosRef(sch1: AnySchema, sch2: AnySchema | undefined, ref: string): void { + if (sch2 !== undefined && !equal(sch1, sch2)) throw ambiguos(ref) + } + + function ambiguos(ref: string): Error { + return new Error(`reference "${ref}" resolves to more than one schema`) + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/compile/rules.ts b/front_end/third_party/mcp-sdk/ajv/lib/compile/rules.ts new file mode 100644 index 0000000000..7dbf7ab9e0 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/compile/rules.ts @@ -0,0 +1,50 @@ +import type {AddedKeywordDefinition} from "../types" + +const _jsonTypes = ["string", "number", "integer", "boolean", "null", "object", "array"] as const + +export type JSONType = (typeof _jsonTypes)[number] + +const jsonTypes: Set = new Set(_jsonTypes) + +export function isJSONType(x: unknown): x is JSONType { + return typeof x == "string" && jsonTypes.has(x) +} + +type ValidationTypes = { + [K in JSONType]: boolean | RuleGroup | undefined +} + +export interface ValidationRules { + rules: RuleGroup[] + post: RuleGroup + all: {[Key in string]?: boolean | Rule} // rules that have to be validated + keywords: {[Key in string]?: boolean} // all known keywords (superset of "all") + types: ValidationTypes +} + +export interface RuleGroup { + type?: JSONType + rules: Rule[] +} + +// This interface wraps KeywordDefinition because definition can have multiple keywords +export interface Rule { + keyword: string + definition: AddedKeywordDefinition +} + +export function getRules(): ValidationRules { + const groups: Record<"number" | "string" | "array" | "object", RuleGroup> = { + number: {type: "number", rules: []}, + string: {type: "string", rules: []}, + array: {type: "array", rules: []}, + object: {type: "object", rules: []}, + } + return { + types: {...groups, integer: true, boolean: true, null: true}, + rules: [{rules: []}, groups.number, groups.string, groups.array, groups.object], + post: {rules: []}, + all: {}, + keywords: {}, + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/compile/util.ts b/front_end/third_party/mcp-sdk/ajv/lib/compile/util.ts new file mode 100644 index 0000000000..cefae51c2b --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/compile/util.ts @@ -0,0 +1,213 @@ +import type {AnySchema, EvaluatedProperties, EvaluatedItems} from "../types" +import type {SchemaCxt, SchemaObjCxt} from "." +import {_, getProperty, Code, Name, CodeGen} from "./codegen" +import {_Code} from "./codegen/code" +import type {Rule, ValidationRules} from "./rules" + +// TODO refactor to use Set +export function toHash(arr: T[]): {[K in T]?: true} { + const hash: {[K in T]?: true} = {} + for (const item of arr) hash[item] = true + return hash +} + +export function alwaysValidSchema(it: SchemaCxt, schema: AnySchema): boolean | void { + if (typeof schema == "boolean") return schema + if (Object.keys(schema).length === 0) return true + checkUnknownRules(it, schema) + return !schemaHasRules(schema, it.self.RULES.all) +} + +export function checkUnknownRules(it: SchemaCxt, schema: AnySchema = it.schema): void { + const {opts, self} = it + if (!opts.strictSchema) return + if (typeof schema === "boolean") return + const rules = self.RULES.keywords + for (const key in schema) { + if (!rules[key]) checkStrictMode(it, `unknown keyword: "${key}"`) + } +} + +export function schemaHasRules( + schema: AnySchema, + rules: {[Key in string]?: boolean | Rule} +): boolean { + if (typeof schema == "boolean") return !schema + for (const key in schema) if (rules[key]) return true + return false +} + +export function schemaHasRulesButRef(schema: AnySchema, RULES: ValidationRules): boolean { + if (typeof schema == "boolean") return !schema + for (const key in schema) if (key !== "$ref" && RULES.all[key]) return true + return false +} + +export function schemaRefOrVal( + {topSchemaRef, schemaPath}: SchemaObjCxt, + schema: unknown, + keyword: string, + $data?: string | false +): Code | number | boolean { + if (!$data) { + if (typeof schema == "number" || typeof schema == "boolean") return schema + if (typeof schema == "string") return _`${schema}` + } + return _`${topSchemaRef}${schemaPath}${getProperty(keyword)}` +} + +export function unescapeFragment(str: string): string { + return unescapeJsonPointer(decodeURIComponent(str)) +} + +export function escapeFragment(str: string | number): string { + return encodeURIComponent(escapeJsonPointer(str)) +} + +export function escapeJsonPointer(str: string | number): string { + if (typeof str == "number") return `${str}` + return str.replace(/~/g, "~0").replace(/\//g, "~1") +} + +export function unescapeJsonPointer(str: string): string { + return str.replace(/~1/g, "/").replace(/~0/g, "~") +} + +export function eachItem(xs: T | T[], f: (x: T) => void): void { + if (Array.isArray(xs)) { + for (const x of xs) f(x) + } else { + f(xs) + } +} + +type SomeEvaluated = EvaluatedProperties | EvaluatedItems + +type MergeEvaluatedFunc = ( + gen: CodeGen, + from: Name | T, + to: Name | Exclude | undefined, + toName?: typeof Name +) => Name | T + +interface MakeMergeFuncArgs { + mergeNames: (gen: CodeGen, from: Name, to: Name) => void + mergeToName: (gen: CodeGen, from: T, to: Name) => void + mergeValues: (from: T, to: Exclude) => T + resultToName: (gen: CodeGen, res?: T) => Name +} + +function makeMergeEvaluated({ + mergeNames, + mergeToName, + mergeValues, + resultToName, +}: MakeMergeFuncArgs): MergeEvaluatedFunc { + return (gen, from, to, toName) => { + const res = + to === undefined + ? from + : to instanceof Name + ? (from instanceof Name ? mergeNames(gen, from, to) : mergeToName(gen, from, to), to) + : from instanceof Name + ? (mergeToName(gen, to, from), from) + : mergeValues(from, to) + return toName === Name && !(res instanceof Name) ? resultToName(gen, res) : res + } +} + +interface MergeEvaluated { + props: MergeEvaluatedFunc + items: MergeEvaluatedFunc +} + +export const mergeEvaluated: MergeEvaluated = { + props: makeMergeEvaluated({ + mergeNames: (gen, from, to) => + gen.if(_`${to} !== true && ${from} !== undefined`, () => { + gen.if( + _`${from} === true`, + () => gen.assign(to, true), + () => gen.assign(to, _`${to} || {}`).code(_`Object.assign(${to}, ${from})`) + ) + }), + mergeToName: (gen, from, to) => + gen.if(_`${to} !== true`, () => { + if (from === true) { + gen.assign(to, true) + } else { + gen.assign(to, _`${to} || {}`) + setEvaluated(gen, to, from) + } + }), + mergeValues: (from, to) => (from === true ? true : {...from, ...to}), + resultToName: evaluatedPropsToName, + }), + items: makeMergeEvaluated({ + mergeNames: (gen, from, to) => + gen.if(_`${to} !== true && ${from} !== undefined`, () => + gen.assign(to, _`${from} === true ? true : ${to} > ${from} ? ${to} : ${from}`) + ), + mergeToName: (gen, from, to) => + gen.if(_`${to} !== true`, () => + gen.assign(to, from === true ? true : _`${to} > ${from} ? ${to} : ${from}`) + ), + mergeValues: (from, to) => (from === true ? true : Math.max(from, to)), + resultToName: (gen, items) => gen.var("items", items), + }), +} + +export function evaluatedPropsToName(gen: CodeGen, ps?: EvaluatedProperties): Name { + if (ps === true) return gen.var("props", true) + const props = gen.var("props", _`{}`) + if (ps !== undefined) setEvaluated(gen, props, ps) + return props +} + +export function setEvaluated(gen: CodeGen, props: Name, ps: {[K in string]?: true}): void { + Object.keys(ps).forEach((p) => gen.assign(_`${props}${getProperty(p)}`, true)) +} + +const snippets: {[S in string]?: _Code} = {} + +export function useFunc(gen: CodeGen, f: {code: string}): Name { + return gen.scopeValue("func", { + ref: f, + code: snippets[f.code] || (snippets[f.code] = new _Code(f.code)), + }) +} + +export enum Type { + Num, + Str, +} + +export function getErrorPath( + dataProp: Name | string | number, + dataPropType?: Type, + jsPropertySyntax?: boolean +): Code | string { + // let path + if (dataProp instanceof Name) { + const isNumber = dataPropType === Type.Num + return jsPropertySyntax + ? isNumber + ? _`"[" + ${dataProp} + "]"` + : _`"['" + ${dataProp} + "']"` + : isNumber + ? _`"/" + ${dataProp}` + : _`"/" + ${dataProp}.replace(/~/g, "~0").replace(/\\//g, "~1")` // TODO maybe use global escapePointer + } + return jsPropertySyntax ? getProperty(dataProp).toString() : "/" + escapeJsonPointer(dataProp) +} + +export function checkStrictMode( + it: SchemaCxt, + msg: string, + mode: boolean | "log" = it.opts.strictSchema +): void { + if (!mode) return + msg = `strict mode: ${msg}` + if (mode === true) throw new Error(msg) + it.self.logger.warn(msg) +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/compile/validate/applicability.ts b/front_end/third_party/mcp-sdk/ajv/lib/compile/validate/applicability.ts new file mode 100644 index 0000000000..478b704ac5 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/compile/validate/applicability.ts @@ -0,0 +1,22 @@ +import type {AnySchemaObject} from "../../types" +import type {SchemaObjCxt} from ".." +import type {JSONType, RuleGroup, Rule} from "../rules" + +export function schemaHasRulesForType( + {schema, self}: SchemaObjCxt, + type: JSONType +): boolean | undefined { + const group = self.RULES.types[type] + return group && group !== true && shouldUseGroup(schema, group) +} + +export function shouldUseGroup(schema: AnySchemaObject, group: RuleGroup): boolean { + return group.rules.some((rule) => shouldUseRule(schema, rule)) +} + +export function shouldUseRule(schema: AnySchemaObject, rule: Rule): boolean | undefined { + return ( + schema[rule.keyword] !== undefined || + rule.definition.implements?.some((kwd) => schema[kwd] !== undefined) + ) +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/compile/validate/boolSchema.ts b/front_end/third_party/mcp-sdk/ajv/lib/compile/validate/boolSchema.ts new file mode 100644 index 0000000000..156355016d --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/compile/validate/boolSchema.ts @@ -0,0 +1,47 @@ +import type {KeywordErrorDefinition, KeywordErrorCxt} from "../../types" +import type {SchemaCxt} from ".." +import {reportError} from "../errors" +import {_, Name} from "../codegen" +import N from "../names" + +const boolError: KeywordErrorDefinition = { + message: "boolean schema is false", +} + +export function topBoolOrEmptySchema(it: SchemaCxt): void { + const {gen, schema, validateName} = it + if (schema === false) { + falseSchemaError(it, false) + } else if (typeof schema == "object" && schema.$async === true) { + gen.return(N.data) + } else { + gen.assign(_`${validateName}.errors`, null) + gen.return(true) + } +} + +export function boolOrEmptySchema(it: SchemaCxt, valid: Name): void { + const {gen, schema} = it + if (schema === false) { + gen.var(valid, false) // TODO var + falseSchemaError(it) + } else { + gen.var(valid, true) // TODO var + } +} + +function falseSchemaError(it: SchemaCxt, overrideAllErrors?: boolean): void { + const {gen, data} = it + // TODO maybe some other interface should be used for non-keyword validation errors... + const cxt: KeywordErrorCxt = { + gen, + keyword: "false schema", + data, + schema: false, + schemaCode: false, + schemaValue: false, + params: {}, + it, + } + reportError(cxt, boolError, undefined, overrideAllErrors) +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/compile/validate/dataType.ts b/front_end/third_party/mcp-sdk/ajv/lib/compile/validate/dataType.ts new file mode 100644 index 0000000000..d8142b3e1f --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/compile/validate/dataType.ts @@ -0,0 +1,230 @@ +import type { + KeywordErrorDefinition, + KeywordErrorCxt, + ErrorObject, + AnySchemaObject, +} from "../../types" +import type {SchemaObjCxt} from ".." +import {isJSONType, JSONType} from "../rules" +import {schemaHasRulesForType} from "./applicability" +import {reportError} from "../errors" +import {_, nil, and, not, operators, Code, Name} from "../codegen" +import {toHash, schemaRefOrVal} from "../util" + +export enum DataType { + Correct, + Wrong, +} + +export function getSchemaTypes(schema: AnySchemaObject): JSONType[] { + const types = getJSONTypes(schema.type) + const hasNull = types.includes("null") + if (hasNull) { + if (schema.nullable === false) throw new Error("type: null contradicts nullable: false") + } else { + if (!types.length && schema.nullable !== undefined) { + throw new Error('"nullable" cannot be used without "type"') + } + if (schema.nullable === true) types.push("null") + } + return types +} + +// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents +export function getJSONTypes(ts: unknown | unknown[]): JSONType[] { + const types: unknown[] = Array.isArray(ts) ? ts : ts ? [ts] : [] + if (types.every(isJSONType)) return types + throw new Error("type must be JSONType or JSONType[]: " + types.join(",")) +} + +export function coerceAndCheckDataType(it: SchemaObjCxt, types: JSONType[]): boolean { + const {gen, data, opts} = it + const coerceTo = coerceToTypes(types, opts.coerceTypes) + const checkTypes = + types.length > 0 && + !(coerceTo.length === 0 && types.length === 1 && schemaHasRulesForType(it, types[0])) + if (checkTypes) { + const wrongType = checkDataTypes(types, data, opts.strictNumbers, DataType.Wrong) + gen.if(wrongType, () => { + if (coerceTo.length) coerceData(it, types, coerceTo) + else reportTypeError(it) + }) + } + return checkTypes +} + +const COERCIBLE: Set = new Set(["string", "number", "integer", "boolean", "null"]) +function coerceToTypes(types: JSONType[], coerceTypes?: boolean | "array"): JSONType[] { + return coerceTypes + ? types.filter((t) => COERCIBLE.has(t) || (coerceTypes === "array" && t === "array")) + : [] +} + +function coerceData(it: SchemaObjCxt, types: JSONType[], coerceTo: JSONType[]): void { + const {gen, data, opts} = it + const dataType = gen.let("dataType", _`typeof ${data}`) + const coerced = gen.let("coerced", _`undefined`) + if (opts.coerceTypes === "array") { + gen.if(_`${dataType} == 'object' && Array.isArray(${data}) && ${data}.length == 1`, () => + gen + .assign(data, _`${data}[0]`) + .assign(dataType, _`typeof ${data}`) + .if(checkDataTypes(types, data, opts.strictNumbers), () => gen.assign(coerced, data)) + ) + } + gen.if(_`${coerced} !== undefined`) + for (const t of coerceTo) { + if (COERCIBLE.has(t) || (t === "array" && opts.coerceTypes === "array")) { + coerceSpecificType(t) + } + } + gen.else() + reportTypeError(it) + gen.endIf() + + gen.if(_`${coerced} !== undefined`, () => { + gen.assign(data, coerced) + assignParentData(it, coerced) + }) + + function coerceSpecificType(t: string): void { + switch (t) { + case "string": + gen + .elseIf(_`${dataType} == "number" || ${dataType} == "boolean"`) + .assign(coerced, _`"" + ${data}`) + .elseIf(_`${data} === null`) + .assign(coerced, _`""`) + return + case "number": + gen + .elseIf( + _`${dataType} == "boolean" || ${data} === null + || (${dataType} == "string" && ${data} && ${data} == +${data})` + ) + .assign(coerced, _`+${data}`) + return + case "integer": + gen + .elseIf( + _`${dataType} === "boolean" || ${data} === null + || (${dataType} === "string" && ${data} && ${data} == +${data} && !(${data} % 1))` + ) + .assign(coerced, _`+${data}`) + return + case "boolean": + gen + .elseIf(_`${data} === "false" || ${data} === 0 || ${data} === null`) + .assign(coerced, false) + .elseIf(_`${data} === "true" || ${data} === 1`) + .assign(coerced, true) + return + case "null": + gen.elseIf(_`${data} === "" || ${data} === 0 || ${data} === false`) + gen.assign(coerced, null) + return + + case "array": + gen + .elseIf( + _`${dataType} === "string" || ${dataType} === "number" + || ${dataType} === "boolean" || ${data} === null` + ) + .assign(coerced, _`[${data}]`) + } + } +} + +function assignParentData({gen, parentData, parentDataProperty}: SchemaObjCxt, expr: Name): void { + // TODO use gen.property + gen.if(_`${parentData} !== undefined`, () => + gen.assign(_`${parentData}[${parentDataProperty}]`, expr) + ) +} + +export function checkDataType( + dataType: JSONType, + data: Name, + strictNums?: boolean | "log", + correct = DataType.Correct +): Code { + const EQ = correct === DataType.Correct ? operators.EQ : operators.NEQ + let cond: Code + switch (dataType) { + case "null": + return _`${data} ${EQ} null` + case "array": + cond = _`Array.isArray(${data})` + break + case "object": + cond = _`${data} && typeof ${data} == "object" && !Array.isArray(${data})` + break + case "integer": + cond = numCond(_`!(${data} % 1) && !isNaN(${data})`) + break + case "number": + cond = numCond() + break + default: + return _`typeof ${data} ${EQ} ${dataType}` + } + return correct === DataType.Correct ? cond : not(cond) + + function numCond(_cond: Code = nil): Code { + return and(_`typeof ${data} == "number"`, _cond, strictNums ? _`isFinite(${data})` : nil) + } +} + +export function checkDataTypes( + dataTypes: JSONType[], + data: Name, + strictNums?: boolean | "log", + correct?: DataType +): Code { + if (dataTypes.length === 1) { + return checkDataType(dataTypes[0], data, strictNums, correct) + } + let cond: Code + const types = toHash(dataTypes) + if (types.array && types.object) { + const notObj = _`typeof ${data} != "object"` + cond = types.null ? notObj : _`!${data} || ${notObj}` + delete types.null + delete types.array + delete types.object + } else { + cond = nil + } + if (types.number) delete types.integer + for (const t in types) cond = and(cond, checkDataType(t as JSONType, data, strictNums, correct)) + return cond +} + +export type TypeError = ErrorObject<"type", {type: string}> + +const typeError: KeywordErrorDefinition = { + message: ({schema}) => `must be ${schema}`, + params: ({schema, schemaValue}) => + typeof schema == "string" ? _`{type: ${schema}}` : _`{type: ${schemaValue}}`, +} + +export function reportTypeError(it: SchemaObjCxt): void { + const cxt = getTypeErrorContext(it) + reportError(cxt, typeError) +} + +function getTypeErrorContext(it: SchemaObjCxt): KeywordErrorCxt { + const {gen, data, schema} = it + const schemaCode = schemaRefOrVal(it, schema, "type") + return { + gen, + keyword: "type", + data, + schema: schema.type, + schemaCode, + schemaValue: schemaCode, + parentSchema: schema, + params: {}, + it, + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/compile/validate/defaults.ts b/front_end/third_party/mcp-sdk/ajv/lib/compile/validate/defaults.ts new file mode 100644 index 0000000000..2ad3d4df82 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/compile/validate/defaults.ts @@ -0,0 +1,32 @@ +import type {SchemaObjCxt} from ".." +import {_, getProperty, stringify} from "../codegen" +import {checkStrictMode} from "../util" + +export function assignDefaults(it: SchemaObjCxt, ty?: string): void { + const {properties, items} = it.schema + if (ty === "object" && properties) { + for (const key in properties) { + assignDefault(it, key, properties[key].default) + } + } else if (ty === "array" && Array.isArray(items)) { + items.forEach((sch, i: number) => assignDefault(it, i, sch.default)) + } +} + +function assignDefault(it: SchemaObjCxt, prop: string | number, defaultValue: unknown): void { + const {gen, compositeRule, data, opts} = it + if (defaultValue === undefined) return + const childData = _`${data}${getProperty(prop)}` + if (compositeRule) { + checkStrictMode(it, `default is ignored for: ${childData}`) + return + } + + let condition = _`${childData} === undefined` + if (opts.useDefaults === "empty") { + condition = _`${condition} || ${childData} === null || ${childData} === ""` + } + // `${childData} === undefined` + + // (opts.useDefaults === "empty" ? ` || ${childData} === null || ${childData} === ""` : "") + gen.if(condition, _`${childData} = ${stringify(defaultValue)}`) +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/compile/validate/index.ts b/front_end/third_party/mcp-sdk/ajv/lib/compile/validate/index.ts new file mode 100644 index 0000000000..15ecabd851 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/compile/validate/index.ts @@ -0,0 +1,582 @@ +import type { + AddedKeywordDefinition, + AnySchema, + AnySchemaObject, + KeywordErrorCxt, + KeywordCxtParams, +} from "../../types" +import type {SchemaCxt, SchemaObjCxt} from ".." +import type {InstanceOptions} from "../../core" +import {boolOrEmptySchema, topBoolOrEmptySchema} from "./boolSchema" +import {coerceAndCheckDataType, getSchemaTypes} from "./dataType" +import {shouldUseGroup, shouldUseRule} from "./applicability" +import {checkDataType, checkDataTypes, reportTypeError, DataType} from "./dataType" +import {assignDefaults} from "./defaults" +import {funcKeywordCode, macroKeywordCode, validateKeywordUsage, validSchemaType} from "./keyword" +import {getSubschema, extendSubschemaData, SubschemaArgs, extendSubschemaMode} from "./subschema" +import {_, nil, str, or, not, getProperty, Block, Code, Name, CodeGen} from "../codegen" +import N from "../names" +import {resolveUrl} from "../resolve" +import { + schemaRefOrVal, + schemaHasRulesButRef, + checkUnknownRules, + checkStrictMode, + unescapeJsonPointer, + mergeEvaluated, +} from "../util" +import type {JSONType, Rule, RuleGroup} from "../rules" +import { + ErrorPaths, + reportError, + reportExtraError, + resetErrorsCount, + keyword$DataError, +} from "../errors" + +// schema compilation - generates validation function, subschemaCode (below) is used for subschemas +export function validateFunctionCode(it: SchemaCxt): void { + if (isSchemaObj(it)) { + checkKeywords(it) + if (schemaCxtHasRules(it)) { + topSchemaObjCode(it) + return + } + } + validateFunction(it, () => topBoolOrEmptySchema(it)) +} + +function validateFunction( + {gen, validateName, schema, schemaEnv, opts}: SchemaCxt, + body: Block +): void { + if (opts.code.es5) { + gen.func(validateName, _`${N.data}, ${N.valCxt}`, schemaEnv.$async, () => { + gen.code(_`"use strict"; ${funcSourceUrl(schema, opts)}`) + destructureValCxtES5(gen, opts) + gen.code(body) + }) + } else { + gen.func(validateName, _`${N.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => + gen.code(funcSourceUrl(schema, opts)).code(body) + ) + } +} + +function destructureValCxt(opts: InstanceOptions): Code { + return _`{${N.instancePath}="", ${N.parentData}, ${N.parentDataProperty}, ${N.rootData}=${ + N.data + }${opts.dynamicRef ? _`, ${N.dynamicAnchors}={}` : nil}}={}` +} + +function destructureValCxtES5(gen: CodeGen, opts: InstanceOptions): void { + gen.if( + N.valCxt, + () => { + gen.var(N.instancePath, _`${N.valCxt}.${N.instancePath}`) + gen.var(N.parentData, _`${N.valCxt}.${N.parentData}`) + gen.var(N.parentDataProperty, _`${N.valCxt}.${N.parentDataProperty}`) + gen.var(N.rootData, _`${N.valCxt}.${N.rootData}`) + if (opts.dynamicRef) gen.var(N.dynamicAnchors, _`${N.valCxt}.${N.dynamicAnchors}`) + }, + () => { + gen.var(N.instancePath, _`""`) + gen.var(N.parentData, _`undefined`) + gen.var(N.parentDataProperty, _`undefined`) + gen.var(N.rootData, N.data) + if (opts.dynamicRef) gen.var(N.dynamicAnchors, _`{}`) + } + ) +} + +function topSchemaObjCode(it: SchemaObjCxt): void { + const {schema, opts, gen} = it + validateFunction(it, () => { + if (opts.$comment && schema.$comment) commentKeyword(it) + checkNoDefault(it) + gen.let(N.vErrors, null) + gen.let(N.errors, 0) + if (opts.unevaluated) resetEvaluated(it) + typeAndKeywords(it) + returnResults(it) + }) + return +} + +function resetEvaluated(it: SchemaObjCxt): void { + // TODO maybe some hook to execute it in the end to check whether props/items are Name, as in assignEvaluated + const {gen, validateName} = it + it.evaluated = gen.const("evaluated", _`${validateName}.evaluated`) + gen.if(_`${it.evaluated}.dynamicProps`, () => gen.assign(_`${it.evaluated}.props`, _`undefined`)) + gen.if(_`${it.evaluated}.dynamicItems`, () => gen.assign(_`${it.evaluated}.items`, _`undefined`)) +} + +function funcSourceUrl(schema: AnySchema, opts: InstanceOptions): Code { + const schId = typeof schema == "object" && schema[opts.schemaId] + return schId && (opts.code.source || opts.code.process) ? _`/*# sourceURL=${schId} */` : nil +} + +// schema compilation - this function is used recursively to generate code for sub-schemas +function subschemaCode(it: SchemaCxt, valid: Name): void { + if (isSchemaObj(it)) { + checkKeywords(it) + if (schemaCxtHasRules(it)) { + subSchemaObjCode(it, valid) + return + } + } + boolOrEmptySchema(it, valid) +} + +function schemaCxtHasRules({schema, self}: SchemaCxt): boolean { + if (typeof schema == "boolean") return !schema + for (const key in schema) if (self.RULES.all[key]) return true + return false +} + +function isSchemaObj(it: SchemaCxt): it is SchemaObjCxt { + return typeof it.schema != "boolean" +} + +function subSchemaObjCode(it: SchemaObjCxt, valid: Name): void { + const {schema, gen, opts} = it + if (opts.$comment && schema.$comment) commentKeyword(it) + updateContext(it) + checkAsyncSchema(it) + const errsCount = gen.const("_errs", N.errors) + typeAndKeywords(it, errsCount) + // TODO var + gen.var(valid, _`${errsCount} === ${N.errors}`) +} + +function checkKeywords(it: SchemaObjCxt): void { + checkUnknownRules(it) + checkRefsAndKeywords(it) +} + +function typeAndKeywords(it: SchemaObjCxt, errsCount?: Name): void { + if (it.opts.jtd) return schemaKeywords(it, [], false, errsCount) + const types = getSchemaTypes(it.schema) + const checkedTypes = coerceAndCheckDataType(it, types) + schemaKeywords(it, types, !checkedTypes, errsCount) +} + +function checkRefsAndKeywords(it: SchemaObjCxt): void { + const {schema, errSchemaPath, opts, self} = it + if (schema.$ref && opts.ignoreKeywordsWithRef && schemaHasRulesButRef(schema, self.RULES)) { + self.logger.warn(`$ref: keywords ignored in schema at path "${errSchemaPath}"`) + } +} + +function checkNoDefault(it: SchemaObjCxt): void { + const {schema, opts} = it + if (schema.default !== undefined && opts.useDefaults && opts.strictSchema) { + checkStrictMode(it, "default is ignored in the schema root") + } +} + +function updateContext(it: SchemaObjCxt): void { + const schId = it.schema[it.opts.schemaId] + if (schId) it.baseId = resolveUrl(it.opts.uriResolver, it.baseId, schId) +} + +function checkAsyncSchema(it: SchemaObjCxt): void { + if (it.schema.$async && !it.schemaEnv.$async) throw new Error("async schema in sync schema") +} + +function commentKeyword({gen, schemaEnv, schema, errSchemaPath, opts}: SchemaObjCxt): void { + const msg = schema.$comment + if (opts.$comment === true) { + gen.code(_`${N.self}.logger.log(${msg})`) + } else if (typeof opts.$comment == "function") { + const schemaPath = str`${errSchemaPath}/$comment` + const rootName = gen.scopeValue("root", {ref: schemaEnv.root}) + gen.code(_`${N.self}.opts.$comment(${msg}, ${schemaPath}, ${rootName}.schema)`) + } +} + +function returnResults(it: SchemaCxt): void { + const {gen, schemaEnv, validateName, ValidationError, opts} = it + if (schemaEnv.$async) { + // TODO assign unevaluated + gen.if( + _`${N.errors} === 0`, + () => gen.return(N.data), + () => gen.throw(_`new ${ValidationError as Name}(${N.vErrors})`) + ) + } else { + gen.assign(_`${validateName}.errors`, N.vErrors) + if (opts.unevaluated) assignEvaluated(it) + gen.return(_`${N.errors} === 0`) + } +} + +function assignEvaluated({gen, evaluated, props, items}: SchemaCxt): void { + if (props instanceof Name) gen.assign(_`${evaluated}.props`, props) + if (items instanceof Name) gen.assign(_`${evaluated}.items`, items) +} + +function schemaKeywords( + it: SchemaObjCxt, + types: JSONType[], + typeErrors: boolean, + errsCount?: Name +): void { + const {gen, schema, data, allErrors, opts, self} = it + const {RULES} = self + if (schema.$ref && (opts.ignoreKeywordsWithRef || !schemaHasRulesButRef(schema, RULES))) { + gen.block(() => keywordCode(it, "$ref", (RULES.all.$ref as Rule).definition)) // TODO typecast + return + } + if (!opts.jtd) checkStrictTypes(it, types) + gen.block(() => { + for (const group of RULES.rules) groupKeywords(group) + groupKeywords(RULES.post) + }) + + function groupKeywords(group: RuleGroup): void { + if (!shouldUseGroup(schema, group)) return + if (group.type) { + gen.if(checkDataType(group.type, data, opts.strictNumbers)) + iterateKeywords(it, group) + if (types.length === 1 && types[0] === group.type && typeErrors) { + gen.else() + reportTypeError(it) + } + gen.endIf() + } else { + iterateKeywords(it, group) + } + // TODO make it "ok" call? + if (!allErrors) gen.if(_`${N.errors} === ${errsCount || 0}`) + } +} + +function iterateKeywords(it: SchemaObjCxt, group: RuleGroup): void { + const { + gen, + schema, + opts: {useDefaults}, + } = it + if (useDefaults) assignDefaults(it, group.type) + gen.block(() => { + for (const rule of group.rules) { + if (shouldUseRule(schema, rule)) { + keywordCode(it, rule.keyword, rule.definition, group.type) + } + } + }) +} + +function checkStrictTypes(it: SchemaObjCxt, types: JSONType[]): void { + if (it.schemaEnv.meta || !it.opts.strictTypes) return + checkContextTypes(it, types) + if (!it.opts.allowUnionTypes) checkMultipleTypes(it, types) + checkKeywordTypes(it, it.dataTypes) +} + +function checkContextTypes(it: SchemaObjCxt, types: JSONType[]): void { + if (!types.length) return + if (!it.dataTypes.length) { + it.dataTypes = types + return + } + types.forEach((t) => { + if (!includesType(it.dataTypes, t)) { + strictTypesError(it, `type "${t}" not allowed by context "${it.dataTypes.join(",")}"`) + } + }) + narrowSchemaTypes(it, types) +} + +function checkMultipleTypes(it: SchemaObjCxt, ts: JSONType[]): void { + if (ts.length > 1 && !(ts.length === 2 && ts.includes("null"))) { + strictTypesError(it, "use allowUnionTypes to allow union type keyword") + } +} + +function checkKeywordTypes(it: SchemaObjCxt, ts: JSONType[]): void { + const rules = it.self.RULES.all + for (const keyword in rules) { + const rule = rules[keyword] + if (typeof rule == "object" && shouldUseRule(it.schema, rule)) { + const {type} = rule.definition + if (type.length && !type.some((t) => hasApplicableType(ts, t))) { + strictTypesError(it, `missing type "${type.join(",")}" for keyword "${keyword}"`) + } + } + } +} + +function hasApplicableType(schTs: JSONType[], kwdT: JSONType): boolean { + return schTs.includes(kwdT) || (kwdT === "number" && schTs.includes("integer")) +} + +function includesType(ts: JSONType[], t: JSONType): boolean { + return ts.includes(t) || (t === "integer" && ts.includes("number")) +} + +function narrowSchemaTypes(it: SchemaObjCxt, withTypes: JSONType[]): void { + const ts: JSONType[] = [] + for (const t of it.dataTypes) { + if (includesType(withTypes, t)) ts.push(t) + else if (withTypes.includes("integer") && t === "number") ts.push("integer") + } + it.dataTypes = ts +} + +function strictTypesError(it: SchemaObjCxt, msg: string): void { + const schemaPath = it.schemaEnv.baseId + it.errSchemaPath + msg += ` at "${schemaPath}" (strictTypes)` + checkStrictMode(it, msg, it.opts.strictTypes) +} + +export class KeywordCxt implements KeywordErrorCxt { + readonly gen: CodeGen + readonly allErrors?: boolean + readonly keyword: string + readonly data: Name // Name referencing the current level of the data instance + readonly $data?: string | false + schema: any // keyword value in the schema + readonly schemaValue: Code | number | boolean // Code reference to keyword schema value or primitive value + readonly schemaCode: Code | number | boolean // Code reference to resolved schema value (different if schema is $data) + readonly schemaType: JSONType[] // allowed type(s) of keyword value in the schema + readonly parentSchema: AnySchemaObject + readonly errsCount?: Name // Name reference to the number of validation errors collected before this keyword, + // requires option trackErrors in keyword definition + params: KeywordCxtParams // object to pass parameters to error messages from keyword code + readonly it: SchemaObjCxt // schema compilation context (schema is guaranteed to be an object, not boolean) + readonly def: AddedKeywordDefinition + + constructor(it: SchemaObjCxt, def: AddedKeywordDefinition, keyword: string) { + validateKeywordUsage(it, def, keyword) + this.gen = it.gen + this.allErrors = it.allErrors + this.keyword = keyword + this.data = it.data + this.schema = it.schema[keyword] + this.$data = def.$data && it.opts.$data && this.schema && this.schema.$data + this.schemaValue = schemaRefOrVal(it, this.schema, keyword, this.$data) + this.schemaType = def.schemaType + this.parentSchema = it.schema + this.params = {} + this.it = it + this.def = def + + if (this.$data) { + this.schemaCode = it.gen.const("vSchema", getData(this.$data, it)) + } else { + this.schemaCode = this.schemaValue + if (!validSchemaType(this.schema, def.schemaType, def.allowUndefined)) { + throw new Error(`${keyword} value must be ${JSON.stringify(def.schemaType)}`) + } + } + + if ("code" in def ? def.trackErrors : def.errors !== false) { + this.errsCount = it.gen.const("_errs", N.errors) + } + } + + result(condition: Code, successAction?: () => void, failAction?: () => void): void { + this.failResult(not(condition), successAction, failAction) + } + + failResult(condition: Code, successAction?: () => void, failAction?: () => void): void { + this.gen.if(condition) + if (failAction) failAction() + else this.error() + if (successAction) { + this.gen.else() + successAction() + if (this.allErrors) this.gen.endIf() + } else { + if (this.allErrors) this.gen.endIf() + else this.gen.else() + } + } + + pass(condition: Code, failAction?: () => void): void { + this.failResult(not(condition), undefined, failAction) + } + + fail(condition?: Code): void { + if (condition === undefined) { + this.error() + if (!this.allErrors) this.gen.if(false) // this branch will be removed by gen.optimize + return + } + this.gen.if(condition) + this.error() + if (this.allErrors) this.gen.endIf() + else this.gen.else() + } + + fail$data(condition: Code): void { + if (!this.$data) return this.fail(condition) + const {schemaCode} = this + this.fail(_`${schemaCode} !== undefined && (${or(this.invalid$data(), condition)})`) + } + + error(append?: boolean, errorParams?: KeywordCxtParams, errorPaths?: ErrorPaths): void { + if (errorParams) { + this.setParams(errorParams) + this._error(append, errorPaths) + this.setParams({}) + return + } + this._error(append, errorPaths) + } + + private _error(append?: boolean, errorPaths?: ErrorPaths): void { + ;(append ? reportExtraError : reportError)(this, this.def.error, errorPaths) + } + + $dataError(): void { + reportError(this, this.def.$dataError || keyword$DataError) + } + + reset(): void { + if (this.errsCount === undefined) throw new Error('add "trackErrors" to keyword definition') + resetErrorsCount(this.gen, this.errsCount) + } + + ok(cond: Code | boolean): void { + if (!this.allErrors) this.gen.if(cond) + } + + setParams(obj: KeywordCxtParams, assign?: true): void { + if (assign) Object.assign(this.params, obj) + else this.params = obj + } + + block$data(valid: Name, codeBlock: () => void, $dataValid: Code = nil): void { + this.gen.block(() => { + this.check$data(valid, $dataValid) + codeBlock() + }) + } + + check$data(valid: Name = nil, $dataValid: Code = nil): void { + if (!this.$data) return + const {gen, schemaCode, schemaType, def} = this + gen.if(or(_`${schemaCode} === undefined`, $dataValid)) + if (valid !== nil) gen.assign(valid, true) + if (schemaType.length || def.validateSchema) { + gen.elseIf(this.invalid$data()) + this.$dataError() + if (valid !== nil) gen.assign(valid, false) + } + gen.else() + } + + invalid$data(): Code { + const {gen, schemaCode, schemaType, def, it} = this + return or(wrong$DataType(), invalid$DataSchema()) + + function wrong$DataType(): Code { + if (schemaType.length) { + /* istanbul ignore if */ + if (!(schemaCode instanceof Name)) throw new Error("ajv implementation error") + const st = Array.isArray(schemaType) ? schemaType : [schemaType] + return _`${checkDataTypes(st, schemaCode, it.opts.strictNumbers, DataType.Wrong)}` + } + return nil + } + + function invalid$DataSchema(): Code { + if (def.validateSchema) { + const validateSchemaRef = gen.scopeValue("validate$data", {ref: def.validateSchema}) // TODO value.code for standalone + return _`!${validateSchemaRef}(${schemaCode})` + } + return nil + } + } + + subschema(appl: SubschemaArgs, valid: Name): SchemaCxt { + const subschema = getSubschema(this.it, appl) + extendSubschemaData(subschema, this.it, appl) + extendSubschemaMode(subschema, appl) + const nextContext = {...this.it, ...subschema, items: undefined, props: undefined} + subschemaCode(nextContext, valid) + return nextContext + } + + mergeEvaluated(schemaCxt: SchemaCxt, toName?: typeof Name): void { + const {it, gen} = this + if (!it.opts.unevaluated) return + if (it.props !== true && schemaCxt.props !== undefined) { + it.props = mergeEvaluated.props(gen, schemaCxt.props, it.props, toName) + } + if (it.items !== true && schemaCxt.items !== undefined) { + it.items = mergeEvaluated.items(gen, schemaCxt.items, it.items, toName) + } + } + + mergeValidEvaluated(schemaCxt: SchemaCxt, valid: Name): boolean | void { + const {it, gen} = this + if (it.opts.unevaluated && (it.props !== true || it.items !== true)) { + gen.if(valid, () => this.mergeEvaluated(schemaCxt, Name)) + return true + } + } +} + +function keywordCode( + it: SchemaObjCxt, + keyword: string, + def: AddedKeywordDefinition, + ruleType?: JSONType +): void { + const cxt = new KeywordCxt(it, def, keyword) + if ("code" in def) { + def.code(cxt, ruleType) + } else if (cxt.$data && def.validate) { + funcKeywordCode(cxt, def) + } else if ("macro" in def) { + macroKeywordCode(cxt, def) + } else if (def.compile || def.validate) { + funcKeywordCode(cxt, def) + } +} + +const JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/ +const RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/ +export function getData( + $data: string, + {dataLevel, dataNames, dataPathArr}: SchemaCxt +): Code | number { + let jsonPointer + let data: Code + if ($data === "") return N.rootData + if ($data[0] === "/") { + if (!JSON_POINTER.test($data)) throw new Error(`Invalid JSON-pointer: ${$data}`) + jsonPointer = $data + data = N.rootData + } else { + const matches = RELATIVE_JSON_POINTER.exec($data) + if (!matches) throw new Error(`Invalid JSON-pointer: ${$data}`) + const up: number = +matches[1] + jsonPointer = matches[2] + if (jsonPointer === "#") { + if (up >= dataLevel) throw new Error(errorMsg("property/index", up)) + return dataPathArr[dataLevel - up] + } + if (up > dataLevel) throw new Error(errorMsg("data", up)) + data = dataNames[dataLevel - up] + if (!jsonPointer) return data + } + + let expr = data + const segments = jsonPointer.split("/") + for (const segment of segments) { + if (segment) { + data = _`${data}${getProperty(unescapeJsonPointer(segment))}` + expr = _`${expr} && ${data}` + } + } + return expr + + function errorMsg(pointerType: string, up: number): string { + return `Cannot access ${pointerType} ${up} levels up, current level is ${dataLevel}` + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/compile/validate/keyword.ts b/front_end/third_party/mcp-sdk/ajv/lib/compile/validate/keyword.ts new file mode 100644 index 0000000000..f854aa7108 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/compile/validate/keyword.ts @@ -0,0 +1,171 @@ +import type {KeywordCxt} from "." +import type { + AnySchema, + SchemaValidateFunction, + AnyValidateFunction, + AddedKeywordDefinition, + MacroKeywordDefinition, + FuncKeywordDefinition, +} from "../../types" +import type {SchemaObjCxt} from ".." +import {_, nil, not, stringify, Code, Name, CodeGen} from "../codegen" +import N from "../names" +import type {JSONType} from "../rules" +import {callValidateCode} from "../../vocabularies/code" +import {extendErrors} from "../errors" + +type KeywordCompilationResult = AnySchema | SchemaValidateFunction | AnyValidateFunction + +export function macroKeywordCode(cxt: KeywordCxt, def: MacroKeywordDefinition): void { + const {gen, keyword, schema, parentSchema, it} = cxt + const macroSchema = def.macro.call(it.self, schema, parentSchema, it) + const schemaRef = useKeyword(gen, keyword, macroSchema) + if (it.opts.validateSchema !== false) it.self.validateSchema(macroSchema, true) + + const valid = gen.name("valid") + cxt.subschema( + { + schema: macroSchema, + schemaPath: nil, + errSchemaPath: `${it.errSchemaPath}/${keyword}`, + topSchemaRef: schemaRef, + compositeRule: true, + }, + valid + ) + cxt.pass(valid, () => cxt.error(true)) +} + +export function funcKeywordCode(cxt: KeywordCxt, def: FuncKeywordDefinition): void { + const {gen, keyword, schema, parentSchema, $data, it} = cxt + checkAsyncKeyword(it, def) + const validate = + !$data && def.compile ? def.compile.call(it.self, schema, parentSchema, it) : def.validate + const validateRef = useKeyword(gen, keyword, validate) + const valid = gen.let("valid") + cxt.block$data(valid, validateKeyword) + cxt.ok(def.valid ?? valid) + + function validateKeyword(): void { + if (def.errors === false) { + assignValid() + if (def.modifying) modifyData(cxt) + reportErrs(() => cxt.error()) + } else { + const ruleErrs = def.async ? validateAsync() : validateSync() + if (def.modifying) modifyData(cxt) + reportErrs(() => addErrs(cxt, ruleErrs)) + } + } + + function validateAsync(): Name { + const ruleErrs = gen.let("ruleErrs", null) + gen.try( + () => assignValid(_`await `), + (e) => + gen.assign(valid, false).if( + _`${e} instanceof ${it.ValidationError as Name}`, + () => gen.assign(ruleErrs, _`${e}.errors`), + () => gen.throw(e) + ) + ) + return ruleErrs + } + + function validateSync(): Code { + const validateErrs = _`${validateRef}.errors` + gen.assign(validateErrs, null) + assignValid(nil) + return validateErrs + } + + function assignValid(_await: Code = def.async ? _`await ` : nil): void { + const passCxt = it.opts.passContext ? N.this : N.self + const passSchema = !(("compile" in def && !$data) || def.schema === false) + gen.assign( + valid, + _`${_await}${callValidateCode(cxt, validateRef, passCxt, passSchema)}`, + def.modifying + ) + } + + function reportErrs(errors: () => void): void { + gen.if(not(def.valid ?? valid), errors) + } +} + +function modifyData(cxt: KeywordCxt): void { + const {gen, data, it} = cxt + gen.if(it.parentData, () => gen.assign(data, _`${it.parentData}[${it.parentDataProperty}]`)) +} + +function addErrs(cxt: KeywordCxt, errs: Code): void { + const {gen} = cxt + gen.if( + _`Array.isArray(${errs})`, + () => { + gen + .assign(N.vErrors, _`${N.vErrors} === null ? ${errs} : ${N.vErrors}.concat(${errs})`) + .assign(N.errors, _`${N.vErrors}.length`) + extendErrors(cxt) + }, + () => cxt.error() + ) +} + +function checkAsyncKeyword({schemaEnv}: SchemaObjCxt, def: FuncKeywordDefinition): void { + if (def.async && !schemaEnv.$async) throw new Error("async keyword in sync schema") +} + +function useKeyword(gen: CodeGen, keyword: string, result?: KeywordCompilationResult): Name { + if (result === undefined) throw new Error(`keyword "${keyword}" failed to compile`) + return gen.scopeValue( + "keyword", + typeof result == "function" ? {ref: result} : {ref: result, code: stringify(result)} + ) +} + +export function validSchemaType( + schema: unknown, + schemaType: JSONType[], + allowUndefined = false +): boolean { + // TODO add tests + return ( + !schemaType.length || + schemaType.some((st) => + st === "array" + ? Array.isArray(schema) + : st === "object" + ? schema && typeof schema == "object" && !Array.isArray(schema) + : typeof schema == st || (allowUndefined && typeof schema == "undefined") + ) + ) +} + +export function validateKeywordUsage( + {schema, opts, self, errSchemaPath}: SchemaObjCxt, + def: AddedKeywordDefinition, + keyword: string +): void { + /* istanbul ignore if */ + if (Array.isArray(def.keyword) ? !def.keyword.includes(keyword) : def.keyword !== keyword) { + throw new Error("ajv implementation error") + } + + const deps = def.dependencies + if (deps?.some((kwd) => !Object.prototype.hasOwnProperty.call(schema, kwd))) { + throw new Error(`parent schema must have dependencies of ${keyword}: ${deps.join(",")}`) + } + + if (def.validateSchema) { + const valid = def.validateSchema(schema[keyword]) + if (!valid) { + const msg = + `keyword "${keyword}" value is invalid at path "${errSchemaPath}": ` + + self.errorsText(def.validateSchema.errors) + if (opts.validateSchema === "log") self.logger.error(msg) + else throw new Error(msg) + } + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/compile/validate/subschema.ts b/front_end/third_party/mcp-sdk/ajv/lib/compile/validate/subschema.ts new file mode 100644 index 0000000000..9072ed7743 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/compile/validate/subschema.ts @@ -0,0 +1,135 @@ +import type {AnySchema} from "../../types" +import type {SchemaObjCxt} from ".." +import {_, str, getProperty, Code, Name} from "../codegen" +import {escapeFragment, getErrorPath, Type} from "../util" +import type {JSONType} from "../rules" + +export interface SubschemaContext { + // TODO use Optional? align with SchemCxt property types + schema: AnySchema + schemaPath: Code + errSchemaPath: string + topSchemaRef?: Code + errorPath?: Code + dataLevel?: number + dataTypes?: JSONType[] + data?: Name + parentData?: Name + parentDataProperty?: Code | number + dataNames?: Name[] + dataPathArr?: (Code | number)[] + propertyName?: Name + jtdDiscriminator?: string + jtdMetadata?: boolean + compositeRule?: true + createErrors?: boolean + allErrors?: boolean +} + +export type SubschemaArgs = Partial<{ + keyword: string + schemaProp: string | number + schema: AnySchema + schemaPath: Code + errSchemaPath: string + topSchemaRef: Code + data: Name | Code + dataProp: Code | string | number + dataTypes: JSONType[] + definedProperties: Set + propertyName: Name + dataPropType: Type + jtdDiscriminator: string + jtdMetadata: boolean + compositeRule: true + createErrors: boolean + allErrors: boolean +}> + +export function getSubschema( + it: SchemaObjCxt, + {keyword, schemaProp, schema, schemaPath, errSchemaPath, topSchemaRef}: SubschemaArgs +): SubschemaContext { + if (keyword !== undefined && schema !== undefined) { + throw new Error('both "keyword" and "schema" passed, only one allowed') + } + + if (keyword !== undefined) { + const sch = it.schema[keyword] + return schemaProp === undefined + ? { + schema: sch, + schemaPath: _`${it.schemaPath}${getProperty(keyword)}`, + errSchemaPath: `${it.errSchemaPath}/${keyword}`, + } + : { + schema: sch[schemaProp], + schemaPath: _`${it.schemaPath}${getProperty(keyword)}${getProperty(schemaProp)}`, + errSchemaPath: `${it.errSchemaPath}/${keyword}/${escapeFragment(schemaProp)}`, + } + } + + if (schema !== undefined) { + if (schemaPath === undefined || errSchemaPath === undefined || topSchemaRef === undefined) { + throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"') + } + return { + schema, + schemaPath, + topSchemaRef, + errSchemaPath, + } + } + + throw new Error('either "keyword" or "schema" must be passed') +} + +export function extendSubschemaData( + subschema: SubschemaContext, + it: SchemaObjCxt, + {dataProp, dataPropType: dpType, data, dataTypes, propertyName}: SubschemaArgs +): void { + if (data !== undefined && dataProp !== undefined) { + throw new Error('both "data" and "dataProp" passed, only one allowed') + } + + const {gen} = it + + if (dataProp !== undefined) { + const {errorPath, dataPathArr, opts} = it + const nextData = gen.let("data", _`${it.data}${getProperty(dataProp)}`, true) + dataContextProps(nextData) + subschema.errorPath = str`${errorPath}${getErrorPath(dataProp, dpType, opts.jsPropertySyntax)}` + subschema.parentDataProperty = _`${dataProp}` + subschema.dataPathArr = [...dataPathArr, subschema.parentDataProperty] + } + + if (data !== undefined) { + const nextData = data instanceof Name ? data : gen.let("data", data, true) // replaceable if used once? + dataContextProps(nextData) + if (propertyName !== undefined) subschema.propertyName = propertyName + // TODO something is possibly wrong here with not changing parentDataProperty and not appending dataPathArr + } + + if (dataTypes) subschema.dataTypes = dataTypes + + function dataContextProps(_nextData: Name): void { + subschema.data = _nextData + subschema.dataLevel = it.dataLevel + 1 + subschema.dataTypes = [] + it.definedProperties = new Set() + subschema.parentData = it.data + subschema.dataNames = [...it.dataNames, _nextData] + } +} + +export function extendSubschemaMode( + subschema: SubschemaContext, + {jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors}: SubschemaArgs +): void { + if (compositeRule !== undefined) subschema.compositeRule = compositeRule + if (createErrors !== undefined) subschema.createErrors = createErrors + if (allErrors !== undefined) subschema.allErrors = allErrors + subschema.jtdDiscriminator = jtdDiscriminator // not inherited + subschema.jtdMetadata = jtdMetadata // not inherited +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/core.ts b/front_end/third_party/mcp-sdk/ajv/lib/core.ts new file mode 100644 index 0000000000..e41ca3e2aa --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/core.ts @@ -0,0 +1,891 @@ +export { + Format, + FormatDefinition, + AsyncFormatDefinition, + KeywordDefinition, + KeywordErrorDefinition, + CodeKeywordDefinition, + MacroKeywordDefinition, + FuncKeywordDefinition, + Vocabulary, + Schema, + SchemaObject, + AnySchemaObject, + AsyncSchema, + AnySchema, + ValidateFunction, + AsyncValidateFunction, + AnyValidateFunction, + ErrorObject, + ErrorNoParams, +} from "./types" + +export {SchemaCxt, SchemaObjCxt} from "./compile" +export interface Plugin { + (ajv: Ajv, options?: Opts): Ajv + [prop: string]: any +} + +export {KeywordCxt} from "./compile/validate" +export {DefinedError} from "./vocabularies/errors" +export {JSONType} from "./compile/rules" +export {JSONSchemaType} from "./types/json-schema" +export {JTDSchemaType, SomeJTDSchemaType, JTDDataType} from "./types/jtd-schema" +export {_, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions} from "./compile/codegen" + +import type { + Schema, + AnySchema, + AnySchemaObject, + SchemaObject, + AsyncSchema, + Vocabulary, + KeywordDefinition, + AddedKeywordDefinition, + AnyValidateFunction, + ValidateFunction, + AsyncValidateFunction, + ErrorObject, + Format, + AddedFormat, + RegExpEngine, + UriResolver, +} from "./types" +import type {JSONSchemaType} from "./types/json-schema" +import type {JTDSchemaType, SomeJTDSchemaType, JTDDataType} from "./types/jtd-schema" +import ValidationError from "./runtime/validation_error" +import MissingRefError from "./compile/ref_error" +import {getRules, ValidationRules, Rule, RuleGroup, JSONType} from "./compile/rules" +import {SchemaEnv, compileSchema, resolveSchema} from "./compile" +import {Code, ValueScope} from "./compile/codegen" +import {normalizeId, getSchemaRefs} from "./compile/resolve" +import {getJSONTypes} from "./compile/validate/dataType" +import {eachItem} from "./compile/util" +import * as $dataRefSchema from "./refs/data.json" + +import DefaultUriResolver from "./runtime/uri" + +const defaultRegExp: RegExpEngine = (str, flags) => new RegExp(str, flags) +defaultRegExp.code = "new RegExp" + +const META_IGNORE_OPTIONS: (keyof Options)[] = ["removeAdditional", "useDefaults", "coerceTypes"] +const EXT_SCOPE_NAMES = new Set([ + "validate", + "serialize", + "parse", + "wrapper", + "root", + "schema", + "keyword", + "pattern", + "formats", + "validate$data", + "func", + "obj", + "Error", +]) + +export type Options = CurrentOptions & DeprecatedOptions + +export interface CurrentOptions { + // strict mode options (NEW) + strict?: boolean | "log" + strictSchema?: boolean | "log" + strictNumbers?: boolean | "log" + strictTypes?: boolean | "log" + strictTuples?: boolean | "log" + strictRequired?: boolean | "log" + allowMatchingProperties?: boolean // disables a strict mode restriction + allowUnionTypes?: boolean + validateFormats?: boolean + // validation and reporting options: + $data?: boolean + allErrors?: boolean + verbose?: boolean + discriminator?: boolean + unicodeRegExp?: boolean + timestamp?: "string" | "date" // JTD only + parseDate?: boolean // JTD only + allowDate?: boolean // JTD only + $comment?: + | true + | ((comment: string, schemaPath?: string, rootSchema?: AnySchemaObject) => unknown) + formats?: {[Name in string]?: Format} + keywords?: Vocabulary + schemas?: AnySchema[] | {[Key in string]?: AnySchema} + logger?: Logger | false + loadSchema?: (uri: string) => Promise + // options to modify validated data: + removeAdditional?: boolean | "all" | "failing" + useDefaults?: boolean | "empty" + coerceTypes?: boolean | "array" + // advanced options: + next?: boolean // NEW + unevaluated?: boolean // NEW + dynamicRef?: boolean // NEW + schemaId?: "id" | "$id" + jtd?: boolean // NEW + meta?: SchemaObject | boolean + defaultMeta?: string | AnySchemaObject + validateSchema?: boolean | "log" + addUsedSchema?: boolean + inlineRefs?: boolean | number + passContext?: boolean + loopRequired?: number + loopEnum?: number // NEW + ownProperties?: boolean + multipleOfPrecision?: number + int32range?: boolean // JTD only + messages?: boolean + code?: CodeOptions // NEW + uriResolver?: UriResolver +} + +export interface CodeOptions { + es5?: boolean + esm?: boolean + lines?: boolean + optimize?: boolean | number + formats?: Code // code to require (or construct) map of available formats - for standalone code + source?: boolean + process?: (code: string, schema?: SchemaEnv) => string + regExp?: RegExpEngine +} + +interface InstanceCodeOptions extends CodeOptions { + regExp: RegExpEngine + optimize: number +} + +interface DeprecatedOptions { + /** @deprecated */ + ignoreKeywordsWithRef?: boolean + /** @deprecated */ + jsPropertySyntax?: boolean // added instead of jsonPointers + /** @deprecated */ + unicode?: boolean +} + +interface RemovedOptions { + format?: boolean + errorDataPath?: "object" | "property" + nullable?: boolean // "nullable" keyword is supported by default + jsonPointers?: boolean + extendRefs?: true | "ignore" | "fail" + missingRefs?: true | "ignore" | "fail" + processCode?: (code: string, schema?: SchemaEnv) => string + sourceCode?: boolean + strictDefaults?: boolean + strictKeywords?: boolean + uniqueItems?: boolean + unknownFormats?: true | string[] | "ignore" + cache?: any + serialize?: (schema: AnySchema) => unknown + ajvErrors?: boolean +} + +type OptionsInfo = { + [K in keyof T]-?: string | undefined +} + +const removedOptions: OptionsInfo = { + errorDataPath: "", + format: "`validateFormats: false` can be used instead.", + nullable: '"nullable" keyword is supported by default.', + jsonPointers: "Deprecated jsPropertySyntax can be used instead.", + extendRefs: "Deprecated ignoreKeywordsWithRef can be used instead.", + missingRefs: "Pass empty schema with $id that should be ignored to ajv.addSchema.", + processCode: "Use option `code: {process: (code, schemaEnv: object) => string}`", + sourceCode: "Use option `code: {source: true}`", + strictDefaults: "It is default now, see option `strict`.", + strictKeywords: "It is default now, see option `strict`.", + uniqueItems: '"uniqueItems" keyword is always validated.', + unknownFormats: "Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).", + cache: "Map is used as cache, schema object as key.", + serialize: "Map is used as cache, schema object as key.", + ajvErrors: "It is default now.", +} + +const deprecatedOptions: OptionsInfo = { + ignoreKeywordsWithRef: "", + jsPropertySyntax: "", + unicode: '"minLength"/"maxLength" account for unicode characters by default.', +} + +type RequiredInstanceOptions = { + [K in + | "strictSchema" + | "strictNumbers" + | "strictTypes" + | "strictTuples" + | "strictRequired" + | "inlineRefs" + | "loopRequired" + | "loopEnum" + | "meta" + | "messages" + | "schemaId" + | "addUsedSchema" + | "validateSchema" + | "validateFormats" + | "int32range" + | "unicodeRegExp" + | "uriResolver"]: NonNullable +} & {code: InstanceCodeOptions} + +export type InstanceOptions = Options & RequiredInstanceOptions + +const MAX_EXPRESSION = 200 + +// eslint-disable-next-line complexity +function requiredOptions(o: Options): RequiredInstanceOptions { + const s = o.strict + const _optz = o.code?.optimize + const optimize = _optz === true || _optz === undefined ? 1 : _optz || 0 + const regExp = o.code?.regExp ?? defaultRegExp + const uriResolver = o.uriResolver ?? DefaultUriResolver + return { + strictSchema: o.strictSchema ?? s ?? true, + strictNumbers: o.strictNumbers ?? s ?? true, + strictTypes: o.strictTypes ?? s ?? "log", + strictTuples: o.strictTuples ?? s ?? "log", + strictRequired: o.strictRequired ?? s ?? false, + code: o.code ? {...o.code, optimize, regExp} : {optimize, regExp}, + loopRequired: o.loopRequired ?? MAX_EXPRESSION, + loopEnum: o.loopEnum ?? MAX_EXPRESSION, + meta: o.meta ?? true, + messages: o.messages ?? true, + inlineRefs: o.inlineRefs ?? true, + schemaId: o.schemaId ?? "$id", + addUsedSchema: o.addUsedSchema ?? true, + validateSchema: o.validateSchema ?? true, + validateFormats: o.validateFormats ?? true, + unicodeRegExp: o.unicodeRegExp ?? true, + int32range: o.int32range ?? true, + uriResolver: uriResolver, + } +} + +export interface Logger { + log(...args: unknown[]): unknown + warn(...args: unknown[]): unknown + error(...args: unknown[]): unknown +} + +export default class Ajv { + opts: InstanceOptions + errors?: ErrorObject[] | null // errors from the last validation + logger: Logger + // shared external scope values for compiled functions + readonly scope: ValueScope + readonly schemas: {[Key in string]?: SchemaEnv} = {} + readonly refs: {[Ref in string]?: SchemaEnv | string} = {} + readonly formats: {[Name in string]?: AddedFormat} = {} + readonly RULES: ValidationRules + readonly _compilations: Set = new Set() + private readonly _loading: {[Ref in string]?: Promise} = {} + private readonly _cache: Map = new Map() + private readonly _metaOpts: InstanceOptions + + static ValidationError = ValidationError + static MissingRefError = MissingRefError + + constructor(opts: Options = {}) { + opts = this.opts = {...opts, ...requiredOptions(opts)} + const {es5, lines} = this.opts.code + + this.scope = new ValueScope({scope: {}, prefixes: EXT_SCOPE_NAMES, es5, lines}) + this.logger = getLogger(opts.logger) + const formatOpt = opts.validateFormats + opts.validateFormats = false + + this.RULES = getRules() + checkOptions.call(this, removedOptions, opts, "NOT SUPPORTED") + checkOptions.call(this, deprecatedOptions, opts, "DEPRECATED", "warn") + this._metaOpts = getMetaSchemaOptions.call(this) + + if (opts.formats) addInitialFormats.call(this) + this._addVocabularies() + this._addDefaultMetaSchema() + if (opts.keywords) addInitialKeywords.call(this, opts.keywords) + if (typeof opts.meta == "object") this.addMetaSchema(opts.meta) + addInitialSchemas.call(this) + opts.validateFormats = formatOpt + } + + _addVocabularies(): void { + this.addKeyword("$async") + } + + _addDefaultMetaSchema(): void { + const {$data, meta, schemaId} = this.opts + let _dataRefSchema: SchemaObject = $dataRefSchema + if (schemaId === "id") { + _dataRefSchema = {...$dataRefSchema} + _dataRefSchema.id = _dataRefSchema.$id + delete _dataRefSchema.$id + } + if (meta && $data) this.addMetaSchema(_dataRefSchema, _dataRefSchema[schemaId], false) + } + + defaultMeta(): string | AnySchemaObject | undefined { + const {meta, schemaId} = this.opts + return (this.opts.defaultMeta = typeof meta == "object" ? meta[schemaId] || meta : undefined) + } + + // Validate data using schema + // AnySchema will be compiled and cached using schema itself as a key for Map + validate(schema: Schema | string, data: unknown): boolean + validate(schemaKeyRef: AnySchema | string, data: unknown): boolean | Promise + validate(schema: Schema | JSONSchemaType | string, data: unknown): data is T + // Separated for type inference to work + // eslint-disable-next-line @typescript-eslint/unified-signatures + validate(schema: JTDSchemaType, data: unknown): data is T + // This overload is only intended for typescript inference, the first + // argument prevents manual type annotation from matching this overload + // eslint-disable-next-line @typescript-eslint/no-unused-vars + validate( + schema: T, + data: unknown + ): data is JTDDataType + // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents + validate(schema: AsyncSchema, data: unknown | T): Promise + validate(schemaKeyRef: AnySchema | string, data: unknown): data is T | Promise + validate( + schemaKeyRef: AnySchema | string, // key, ref or schema object + // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents + data: unknown | T // to be validated + ): boolean | Promise { + let v: AnyValidateFunction | undefined + if (typeof schemaKeyRef == "string") { + v = this.getSchema(schemaKeyRef) + if (!v) throw new Error(`no schema with key or ref "${schemaKeyRef}"`) + } else { + v = this.compile(schemaKeyRef) + } + + const valid = v(data) + if (!("$async" in v)) this.errors = v.errors + return valid + } + + // Create validation function for passed schema + // _meta: true if schema is a meta-schema. Used internally to compile meta schemas of user-defined keywords. + compile(schema: Schema | JSONSchemaType, _meta?: boolean): ValidateFunction + // Separated for type inference to work + // eslint-disable-next-line @typescript-eslint/unified-signatures + compile(schema: JTDSchemaType, _meta?: boolean): ValidateFunction + // This overload is only intended for typescript inference, the first + // argument prevents manual type annotation from matching this overload + // eslint-disable-next-line @typescript-eslint/no-unused-vars + compile( + schema: T, + _meta?: boolean + ): ValidateFunction> + compile(schema: AsyncSchema, _meta?: boolean): AsyncValidateFunction + compile(schema: AnySchema, _meta?: boolean): AnyValidateFunction + compile(schema: AnySchema, _meta?: boolean): AnyValidateFunction { + const sch = this._addSchema(schema, _meta) + return (sch.validate || this._compileSchemaEnv(sch)) as AnyValidateFunction + } + + // Creates validating function for passed schema with asynchronous loading of missing schemas. + // `loadSchema` option should be a function that accepts schema uri and returns promise that resolves with the schema. + // TODO allow passing schema URI + // meta - optional true to compile meta-schema + compileAsync( + schema: SchemaObject | JSONSchemaType, + _meta?: boolean + ): Promise> + // Separated for type inference to work + // eslint-disable-next-line @typescript-eslint/unified-signatures + compileAsync(schema: JTDSchemaType, _meta?: boolean): Promise> + compileAsync(schema: AsyncSchema, meta?: boolean): Promise> + // eslint-disable-next-line @typescript-eslint/unified-signatures + compileAsync( + schema: AnySchemaObject, + meta?: boolean + ): Promise> + compileAsync( + schema: AnySchemaObject, + meta?: boolean + ): Promise> { + if (typeof this.opts.loadSchema != "function") { + throw new Error("options.loadSchema should be a function") + } + const {loadSchema} = this.opts + return runCompileAsync.call(this, schema, meta) + + async function runCompileAsync( + this: Ajv, + _schema: AnySchemaObject, + _meta?: boolean + ): Promise { + await loadMetaSchema.call(this, _schema.$schema) + const sch = this._addSchema(_schema, _meta) + return sch.validate || _compileAsync.call(this, sch) + } + + async function loadMetaSchema(this: Ajv, $ref?: string): Promise { + if ($ref && !this.getSchema($ref)) { + await runCompileAsync.call(this, {$ref}, true) + } + } + + async function _compileAsync(this: Ajv, sch: SchemaEnv): Promise { + try { + return this._compileSchemaEnv(sch) + } catch (e) { + if (!(e instanceof MissingRefError)) throw e + checkLoaded.call(this, e) + await loadMissingSchema.call(this, e.missingSchema) + return _compileAsync.call(this, sch) + } + } + + function checkLoaded(this: Ajv, {missingSchema: ref, missingRef}: MissingRefError): void { + if (this.refs[ref]) { + throw new Error(`AnySchema ${ref} is loaded but ${missingRef} cannot be resolved`) + } + } + + async function loadMissingSchema(this: Ajv, ref: string): Promise { + const _schema = await _loadSchema.call(this, ref) + if (!this.refs[ref]) await loadMetaSchema.call(this, _schema.$schema) + if (!this.refs[ref]) this.addSchema(_schema, ref, meta) + } + + async function _loadSchema(this: Ajv, ref: string): Promise { + const p = this._loading[ref] + if (p) return p + try { + return await (this._loading[ref] = loadSchema(ref)) + } finally { + delete this._loading[ref] + } + } + } + + // Adds schema to the instance + addSchema( + schema: AnySchema | AnySchema[], // If array is passed, `key` will be ignored + key?: string, // Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`. + _meta?: boolean, // true if schema is a meta-schema. Used internally, addMetaSchema should be used instead. + _validateSchema = this.opts.validateSchema // false to skip schema validation. Used internally, option validateSchema should be used instead. + ): Ajv { + if (Array.isArray(schema)) { + for (const sch of schema) this.addSchema(sch, undefined, _meta, _validateSchema) + return this + } + let id: string | undefined + if (typeof schema === "object") { + const {schemaId} = this.opts + id = schema[schemaId] + if (id !== undefined && typeof id != "string") { + throw new Error(`schema ${schemaId} must be string`) + } + } + key = normalizeId(key || id) + this._checkUnique(key) + this.schemas[key] = this._addSchema(schema, _meta, key, _validateSchema, true) + return this + } + + // Add schema that will be used to validate other schemas + // options in META_IGNORE_OPTIONS are alway set to false + addMetaSchema( + schema: AnySchemaObject, + key?: string, // schema key + _validateSchema = this.opts.validateSchema // false to skip schema validation, can be used to override validateSchema option for meta-schema + ): Ajv { + this.addSchema(schema, key, true, _validateSchema) + return this + } + + // Validate schema against its meta-schema + validateSchema(schema: AnySchema, throwOrLogError?: boolean): boolean | Promise { + if (typeof schema == "boolean") return true + let $schema: string | AnySchemaObject | undefined + $schema = schema.$schema + if ($schema !== undefined && typeof $schema != "string") { + throw new Error("$schema must be a string") + } + $schema = $schema || this.opts.defaultMeta || this.defaultMeta() + if (!$schema) { + this.logger.warn("meta-schema not available") + this.errors = null + return true + } + const valid = this.validate($schema, schema) + if (!valid && throwOrLogError) { + const message = "schema is invalid: " + this.errorsText() + if (this.opts.validateSchema === "log") this.logger.error(message) + else throw new Error(message) + } + return valid + } + + // Get compiled schema by `key` or `ref`. + // (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id) + getSchema(keyRef: string): AnyValidateFunction | undefined { + let sch + while (typeof (sch = getSchEnv.call(this, keyRef)) == "string") keyRef = sch + if (sch === undefined) { + const {schemaId} = this.opts + const root = new SchemaEnv({schema: {}, schemaId}) + sch = resolveSchema.call(this, root, keyRef) + if (!sch) return + this.refs[keyRef] = sch + } + return (sch.validate || this._compileSchemaEnv(sch)) as AnyValidateFunction | undefined + } + + // Remove cached schema(s). + // If no parameter is passed all schemas but meta-schemas are removed. + // If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed. + // Even if schema is referenced by other schemas it still can be removed as other schemas have local references. + removeSchema(schemaKeyRef?: AnySchema | string | RegExp): Ajv { + if (schemaKeyRef instanceof RegExp) { + this._removeAllSchemas(this.schemas, schemaKeyRef) + this._removeAllSchemas(this.refs, schemaKeyRef) + return this + } + switch (typeof schemaKeyRef) { + case "undefined": + this._removeAllSchemas(this.schemas) + this._removeAllSchemas(this.refs) + this._cache.clear() + return this + case "string": { + const sch = getSchEnv.call(this, schemaKeyRef) + if (typeof sch == "object") this._cache.delete(sch.schema) + delete this.schemas[schemaKeyRef] + delete this.refs[schemaKeyRef] + return this + } + case "object": { + const cacheKey = schemaKeyRef + this._cache.delete(cacheKey) + let id = schemaKeyRef[this.opts.schemaId] + if (id) { + id = normalizeId(id) + delete this.schemas[id] + delete this.refs[id] + } + return this + } + default: + throw new Error("ajv.removeSchema: invalid parameter") + } + } + + // add "vocabulary" - a collection of keywords + addVocabulary(definitions: Vocabulary): Ajv { + for (const def of definitions) this.addKeyword(def) + return this + } + + addKeyword( + kwdOrDef: string | KeywordDefinition, + def?: KeywordDefinition // deprecated + ): Ajv { + let keyword: string | string[] + if (typeof kwdOrDef == "string") { + keyword = kwdOrDef + if (typeof def == "object") { + this.logger.warn("these parameters are deprecated, see docs for addKeyword") + def.keyword = keyword + } + } else if (typeof kwdOrDef == "object" && def === undefined) { + def = kwdOrDef + keyword = def.keyword + if (Array.isArray(keyword) && !keyword.length) { + throw new Error("addKeywords: keyword must be string or non-empty array") + } + } else { + throw new Error("invalid addKeywords parameters") + } + + checkKeyword.call(this, keyword, def) + if (!def) { + eachItem(keyword, (kwd) => addRule.call(this, kwd)) + return this + } + keywordMetaschema.call(this, def) + const definition: AddedKeywordDefinition = { + ...def, + type: getJSONTypes(def.type), + schemaType: getJSONTypes(def.schemaType), + } + eachItem( + keyword, + definition.type.length === 0 + ? (k) => addRule.call(this, k, definition) + : (k) => definition.type.forEach((t) => addRule.call(this, k, definition, t)) + ) + return this + } + + getKeyword(keyword: string): AddedKeywordDefinition | boolean { + const rule = this.RULES.all[keyword] + return typeof rule == "object" ? rule.definition : !!rule + } + + // Remove keyword + removeKeyword(keyword: string): Ajv { + // TODO return type should be Ajv + const {RULES} = this + delete RULES.keywords[keyword] + delete RULES.all[keyword] + for (const group of RULES.rules) { + const i = group.rules.findIndex((rule) => rule.keyword === keyword) + if (i >= 0) group.rules.splice(i, 1) + } + return this + } + + // Add format + addFormat(name: string, format: Format): Ajv { + if (typeof format == "string") format = new RegExp(format) + this.formats[name] = format + return this + } + + errorsText( + errors: ErrorObject[] | null | undefined = this.errors, // optional array of validation errors + {separator = ", ", dataVar = "data"}: ErrorsTextOptions = {} // optional options with properties `separator` and `dataVar` + ): string { + if (!errors || errors.length === 0) return "No errors" + return errors + .map((e) => `${dataVar}${e.instancePath} ${e.message}`) + .reduce((text, msg) => text + separator + msg) + } + + $dataMetaSchema(metaSchema: AnySchemaObject, keywordsJsonPointers: string[]): AnySchemaObject { + const rules = this.RULES.all + metaSchema = JSON.parse(JSON.stringify(metaSchema)) + for (const jsonPointer of keywordsJsonPointers) { + const segments = jsonPointer.split("/").slice(1) // first segment is an empty string + let keywords = metaSchema + for (const seg of segments) keywords = keywords[seg] as AnySchemaObject + + for (const key in rules) { + const rule = rules[key] + if (typeof rule != "object") continue + const {$data} = rule.definition + const schema = keywords[key] as AnySchemaObject | undefined + if ($data && schema) keywords[key] = schemaOrData(schema) + } + } + + return metaSchema + } + + private _removeAllSchemas(schemas: {[Ref in string]?: SchemaEnv | string}, regex?: RegExp): void { + for (const keyRef in schemas) { + const sch = schemas[keyRef] + if (!regex || regex.test(keyRef)) { + if (typeof sch == "string") { + delete schemas[keyRef] + } else if (sch && !sch.meta) { + this._cache.delete(sch.schema) + delete schemas[keyRef] + } + } + } + } + + _addSchema( + schema: AnySchema, + meta?: boolean, + baseId?: string, + validateSchema = this.opts.validateSchema, + addSchema = this.opts.addUsedSchema + ): SchemaEnv { + let id: string | undefined + const {schemaId} = this.opts + if (typeof schema == "object") { + id = schema[schemaId] + } else { + if (this.opts.jtd) throw new Error("schema must be object") + else if (typeof schema != "boolean") throw new Error("schema must be object or boolean") + } + let sch = this._cache.get(schema) + if (sch !== undefined) return sch + + baseId = normalizeId(id || baseId) + const localRefs = getSchemaRefs.call(this, schema, baseId) + sch = new SchemaEnv({schema, schemaId, meta, baseId, localRefs}) + this._cache.set(sch.schema, sch) + if (addSchema && !baseId.startsWith("#")) { + // TODO atm it is allowed to overwrite schemas without id (instead of not adding them) + if (baseId) this._checkUnique(baseId) + this.refs[baseId] = sch + } + if (validateSchema) this.validateSchema(schema, true) + return sch + } + + private _checkUnique(id: string): void { + if (this.schemas[id] || this.refs[id]) { + throw new Error(`schema with key or id "${id}" already exists`) + } + } + + private _compileSchemaEnv(sch: SchemaEnv): AnyValidateFunction { + if (sch.meta) this._compileMetaSchema(sch) + else compileSchema.call(this, sch) + + /* istanbul ignore if */ + if (!sch.validate) throw new Error("ajv implementation error") + return sch.validate + } + + private _compileMetaSchema(sch: SchemaEnv): void { + const currentOpts = this.opts + this.opts = this._metaOpts + try { + compileSchema.call(this, sch) + } finally { + this.opts = currentOpts + } + } +} + +export interface ErrorsTextOptions { + separator?: string + dataVar?: string +} + +function checkOptions( + this: Ajv, + checkOpts: OptionsInfo, + options: Options & RemovedOptions, + msg: string, + log: "warn" | "error" = "error" +): void { + for (const key in checkOpts) { + const opt = key as keyof typeof checkOpts + if (opt in options) this.logger[log](`${msg}: option ${key}. ${checkOpts[opt]}`) + } +} + +function getSchEnv(this: Ajv, keyRef: string): SchemaEnv | string | undefined { + keyRef = normalizeId(keyRef) // TODO tests fail without this line + return this.schemas[keyRef] || this.refs[keyRef] +} + +function addInitialSchemas(this: Ajv): void { + const optsSchemas = this.opts.schemas + if (!optsSchemas) return + if (Array.isArray(optsSchemas)) this.addSchema(optsSchemas) + else for (const key in optsSchemas) this.addSchema(optsSchemas[key] as AnySchema, key) +} + +function addInitialFormats(this: Ajv): void { + for (const name in this.opts.formats) { + const format = this.opts.formats[name] + if (format) this.addFormat(name, format) + } +} + +function addInitialKeywords( + this: Ajv, + defs: Vocabulary | {[K in string]?: KeywordDefinition} +): void { + if (Array.isArray(defs)) { + this.addVocabulary(defs) + return + } + this.logger.warn("keywords option as map is deprecated, pass array") + for (const keyword in defs) { + const def = defs[keyword] as KeywordDefinition + if (!def.keyword) def.keyword = keyword + this.addKeyword(def) + } +} + +function getMetaSchemaOptions(this: Ajv): InstanceOptions { + const metaOpts = {...this.opts} + for (const opt of META_IGNORE_OPTIONS) delete metaOpts[opt] + return metaOpts +} + +const noLogs = {log() {}, warn() {}, error() {}} + +function getLogger(logger?: Partial | false): Logger { + if (logger === false) return noLogs + if (logger === undefined) return console + if (logger.log && logger.warn && logger.error) return logger as Logger + throw new Error("logger must implement log, warn and error methods") +} + +const KEYWORD_NAME = /^[a-z_$][a-z0-9_$:-]*$/i + +function checkKeyword(this: Ajv, keyword: string | string[], def?: KeywordDefinition): void { + const {RULES} = this + eachItem(keyword, (kwd) => { + if (RULES.keywords[kwd]) throw new Error(`Keyword ${kwd} is already defined`) + if (!KEYWORD_NAME.test(kwd)) throw new Error(`Keyword ${kwd} has invalid name`) + }) + if (!def) return + if (def.$data && !("code" in def || "validate" in def)) { + throw new Error('$data keyword must have "code" or "validate" function') + } +} + +function addRule( + this: Ajv, + keyword: string, + definition?: AddedKeywordDefinition, + dataType?: JSONType +): void { + const post = definition?.post + if (dataType && post) throw new Error('keyword with "post" flag cannot have "type"') + const {RULES} = this + let ruleGroup = post ? RULES.post : RULES.rules.find(({type: t}) => t === dataType) + if (!ruleGroup) { + ruleGroup = {type: dataType, rules: []} + RULES.rules.push(ruleGroup) + } + RULES.keywords[keyword] = true + if (!definition) return + + const rule: Rule = { + keyword, + definition: { + ...definition, + type: getJSONTypes(definition.type), + schemaType: getJSONTypes(definition.schemaType), + }, + } + if (definition.before) addBeforeRule.call(this, ruleGroup, rule, definition.before) + else ruleGroup.rules.push(rule) + RULES.all[keyword] = rule + definition.implements?.forEach((kwd) => this.addKeyword(kwd)) +} + +function addBeforeRule(this: Ajv, ruleGroup: RuleGroup, rule: Rule, before: string): void { + const i = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before) + if (i >= 0) { + ruleGroup.rules.splice(i, 0, rule) + } else { + ruleGroup.rules.push(rule) + this.logger.warn(`rule ${before} is not defined`) + } +} + +function keywordMetaschema(this: Ajv, def: KeywordDefinition): void { + let {metaSchema} = def + if (metaSchema === undefined) return + if (def.$data && this.opts.$data) metaSchema = schemaOrData(metaSchema) + def.validateSchema = this.compile(metaSchema, true) +} + +const $dataRef = { + $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", +} + +function schemaOrData(schema: AnySchema): AnySchemaObject { + return {anyOf: [schema, $dataRef]} +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/jtd.ts b/front_end/third_party/mcp-sdk/ajv/lib/jtd.ts new file mode 100644 index 0000000000..a7e7bce3ba --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/jtd.ts @@ -0,0 +1,132 @@ +import type {AnySchemaObject, SchemaObject, JTDParser} from "./types" +import type {JTDSchemaType, SomeJTDSchemaType, JTDDataType} from "./types/jtd-schema" +import AjvCore, {CurrentOptions} from "./core" +import jtdVocabulary from "./vocabularies/jtd" +import jtdMetaSchema from "./refs/jtd-schema" +import compileSerializer from "./compile/jtd/serialize" +import compileParser from "./compile/jtd/parse" +import {SchemaEnv} from "./compile" + +const META_SCHEMA_ID = "JTD-meta-schema" + +type JTDOptions = CurrentOptions & { + // strict mode options not supported with JTD: + strict?: never + allowMatchingProperties?: never + allowUnionTypes?: never + validateFormats?: never + // validation and reporting options not supported with JTD: + $data?: never + verbose?: boolean + $comment?: never + formats?: never + loadSchema?: never + // options to modify validated data: + useDefaults?: never + coerceTypes?: never + // advanced options: + next?: never + unevaluated?: never + dynamicRef?: never + meta?: boolean + defaultMeta?: never + inlineRefs?: boolean + loopRequired?: never + multipleOfPrecision?: never +} + +export class Ajv extends AjvCore { + constructor(opts: JTDOptions = {}) { + super({ + ...opts, + jtd: true, + }) + } + + _addVocabularies(): void { + super._addVocabularies() + this.addVocabulary(jtdVocabulary) + } + + _addDefaultMetaSchema(): void { + super._addDefaultMetaSchema() + if (!this.opts.meta) return + this.addMetaSchema(jtdMetaSchema, META_SCHEMA_ID, false) + } + + defaultMeta(): string | AnySchemaObject | undefined { + return (this.opts.defaultMeta = + super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined)) + } + + compileSerializer(schema: SchemaObject): (data: T) => string + // Separated for type inference to work + // eslint-disable-next-line @typescript-eslint/unified-signatures + compileSerializer(schema: JTDSchemaType): (data: T) => string + compileSerializer(schema: SchemaObject): (data: T) => string { + const sch = this._addSchema(schema) + return sch.serialize || this._compileSerializer(sch) + } + + compileParser(schema: SchemaObject): JTDParser + // Separated for type inference to work + // eslint-disable-next-line @typescript-eslint/unified-signatures + compileParser(schema: JTDSchemaType): JTDParser + compileParser(schema: SchemaObject): JTDParser { + const sch = this._addSchema(schema) + return (sch.parse || this._compileParser(sch)) as JTDParser + } + + private _compileSerializer(sch: SchemaEnv): (data: T) => string { + compileSerializer.call(this, sch, (sch.schema as AnySchemaObject).definitions || {}) + /* istanbul ignore if */ + if (!sch.serialize) throw new Error("ajv implementation error") + return sch.serialize + } + + private _compileParser(sch: SchemaEnv): JTDParser { + compileParser.call(this, sch, (sch.schema as AnySchemaObject).definitions || {}) + /* istanbul ignore if */ + if (!sch.parse) throw new Error("ajv implementation error") + return sch.parse + } +} + +module.exports = exports = Ajv +module.exports.Ajv = Ajv +Object.defineProperty(exports, "__esModule", {value: true}) + +export default Ajv + +export { + Format, + FormatDefinition, + AsyncFormatDefinition, + KeywordDefinition, + KeywordErrorDefinition, + CodeKeywordDefinition, + MacroKeywordDefinition, + FuncKeywordDefinition, + Vocabulary, + Schema, + SchemaObject, + AnySchemaObject, + AsyncSchema, + AnySchema, + ValidateFunction, + AsyncValidateFunction, + ErrorObject, + ErrorNoParams, + JTDParser, +} from "./types" + +export {Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions} from "./core" +export {SchemaCxt, SchemaObjCxt} from "./compile" +export {KeywordCxt} from "./compile/validate" +export {JTDErrorObject} from "./vocabularies/jtd" +export {_, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions} from "./compile/codegen" + +export {JTDSchemaType, SomeJTDSchemaType, JTDDataType} +export {JTDOptions} +export {default as ValidationError} from "./runtime/validation_error" +export {default as MissingRefError} from "./compile/ref_error" diff --git a/front_end/third_party/mcp-sdk/ajv/lib/refs/data.json b/front_end/third_party/mcp-sdk/ajv/lib/refs/data.json new file mode 100644 index 0000000000..9ffc9f5ce0 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/refs/data.json @@ -0,0 +1,13 @@ +{ + "$id": "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", + "description": "Meta-schema for $data reference (JSON AnySchema extension proposal)", + "type": "object", + "required": ["$data"], + "properties": { + "$data": { + "type": "string", + "anyOf": [{"format": "relative-json-pointer"}, {"format": "json-pointer"}] + } + }, + "additionalProperties": false +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2019-09/index.ts b/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2019-09/index.ts new file mode 100644 index 0000000000..b6ea7195f0 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2019-09/index.ts @@ -0,0 +1,28 @@ +import type Ajv from "../../core" +import type {AnySchemaObject} from "../../types" +import * as metaSchema from "./schema.json" +import * as applicator from "./meta/applicator.json" +import * as content from "./meta/content.json" +import * as core from "./meta/core.json" +import * as format from "./meta/format.json" +import * as metadata from "./meta/meta-data.json" +import * as validation from "./meta/validation.json" + +const META_SUPPORT_DATA = ["/properties"] + +export default function addMetaSchema2019(this: Ajv, $data?: boolean): Ajv { + ;[ + metaSchema, + applicator, + content, + core, + with$data(this, format), + metadata, + with$data(this, validation), + ].forEach((sch) => this.addMetaSchema(sch, undefined, false)) + return this + + function with$data(ajv: Ajv, sch: AnySchemaObject): AnySchemaObject { + return $data ? ajv.$dataMetaSchema(sch, META_SUPPORT_DATA) : sch + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2019-09/meta/applicator.json b/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2019-09/meta/applicator.json new file mode 100644 index 0000000000..c5e91cf2ac --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2019-09/meta/applicator.json @@ -0,0 +1,53 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/applicator", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/applicator": true + }, + "$recursiveAnchor": true, + + "title": "Applicator vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "additionalItems": {"$recursiveRef": "#"}, + "unevaluatedItems": {"$recursiveRef": "#"}, + "items": { + "anyOf": [{"$recursiveRef": "#"}, {"$ref": "#/$defs/schemaArray"}] + }, + "contains": {"$recursiveRef": "#"}, + "additionalProperties": {"$recursiveRef": "#"}, + "unevaluatedProperties": {"$recursiveRef": "#"}, + "properties": { + "type": "object", + "additionalProperties": {"$recursiveRef": "#"}, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": {"$recursiveRef": "#"}, + "propertyNames": {"format": "regex"}, + "default": {} + }, + "dependentSchemas": { + "type": "object", + "additionalProperties": { + "$recursiveRef": "#" + } + }, + "propertyNames": {"$recursiveRef": "#"}, + "if": {"$recursiveRef": "#"}, + "then": {"$recursiveRef": "#"}, + "else": {"$recursiveRef": "#"}, + "allOf": {"$ref": "#/$defs/schemaArray"}, + "anyOf": {"$ref": "#/$defs/schemaArray"}, + "oneOf": {"$ref": "#/$defs/schemaArray"}, + "not": {"$recursiveRef": "#"} + }, + "$defs": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": {"$recursiveRef": "#"} + } + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2019-09/meta/content.json b/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2019-09/meta/content.json new file mode 100644 index 0000000000..b8f6373434 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2019-09/meta/content.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/content", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/content": true + }, + "$recursiveAnchor": true, + + "title": "Content vocabulary meta-schema", + + "type": ["object", "boolean"], + "properties": { + "contentMediaType": {"type": "string"}, + "contentEncoding": {"type": "string"}, + "contentSchema": {"$recursiveRef": "#"} + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2019-09/meta/core.json b/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2019-09/meta/core.json new file mode 100644 index 0000000000..f71adbff04 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2019-09/meta/core.json @@ -0,0 +1,57 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/core", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/core": true + }, + "$recursiveAnchor": true, + + "title": "Core vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference", + "$comment": "Non-empty fragments not allowed.", + "pattern": "^[^#]*#?$" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$anchor": { + "type": "string", + "pattern": "^[A-Za-z][-A-Za-z0-9.:_]*$" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "$recursiveRef": { + "type": "string", + "format": "uri-reference" + }, + "$recursiveAnchor": { + "type": "boolean", + "default": false + }, + "$vocabulary": { + "type": "object", + "propertyNames": { + "type": "string", + "format": "uri" + }, + "additionalProperties": { + "type": "boolean" + } + }, + "$comment": { + "type": "string" + }, + "$defs": { + "type": "object", + "additionalProperties": {"$recursiveRef": "#"}, + "default": {} + } + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2019-09/meta/format.json b/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2019-09/meta/format.json new file mode 100644 index 0000000000..03ccfce26e --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2019-09/meta/format.json @@ -0,0 +1,14 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/format", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/format": true + }, + "$recursiveAnchor": true, + + "title": "Format vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "format": {"type": "string"} + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json b/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json new file mode 100644 index 0000000000..0e194326fa --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json @@ -0,0 +1,37 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/meta-data", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/meta-data": true + }, + "$recursiveAnchor": true, + + "title": "Meta-data vocabulary meta-schema", + + "type": ["object", "boolean"], + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "deprecated": { + "type": "boolean", + "default": false + }, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + } + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2019-09/meta/validation.json b/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2019-09/meta/validation.json new file mode 100644 index 0000000000..7027a1279a --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2019-09/meta/validation.json @@ -0,0 +1,90 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/validation", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/validation": true + }, + "$recursiveAnchor": true, + + "title": "Validation vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": {"$ref": "#/$defs/nonNegativeInteger"}, + "minLength": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, + "pattern": { + "type": "string", + "format": "regex" + }, + "maxItems": {"$ref": "#/$defs/nonNegativeInteger"}, + "minItems": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "maxContains": {"$ref": "#/$defs/nonNegativeInteger"}, + "minContains": { + "$ref": "#/$defs/nonNegativeInteger", + "default": 1 + }, + "maxProperties": {"$ref": "#/$defs/nonNegativeInteger"}, + "minProperties": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, + "required": {"$ref": "#/$defs/stringArray"}, + "dependentRequired": { + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/stringArray" + } + }, + "const": true, + "enum": { + "type": "array", + "items": true + }, + "type": { + "anyOf": [ + {"$ref": "#/$defs/simpleTypes"}, + { + "type": "array", + "items": {"$ref": "#/$defs/simpleTypes"}, + "minItems": 1, + "uniqueItems": true + } + ] + } + }, + "$defs": { + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "$ref": "#/$defs/nonNegativeInteger", + "default": 0 + }, + "simpleTypes": { + "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] + }, + "stringArray": { + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true, + "default": [] + } + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2019-09/schema.json b/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2019-09/schema.json new file mode 100644 index 0000000000..54eb7157af --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2019-09/schema.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/schema", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/core": true, + "https://json-schema.org/draft/2019-09/vocab/applicator": true, + "https://json-schema.org/draft/2019-09/vocab/validation": true, + "https://json-schema.org/draft/2019-09/vocab/meta-data": true, + "https://json-schema.org/draft/2019-09/vocab/format": false, + "https://json-schema.org/draft/2019-09/vocab/content": true + }, + "$recursiveAnchor": true, + + "title": "Core and Validation specifications meta-schema", + "allOf": [ + {"$ref": "meta/core"}, + {"$ref": "meta/applicator"}, + {"$ref": "meta/validation"}, + {"$ref": "meta/meta-data"}, + {"$ref": "meta/format"}, + {"$ref": "meta/content"} + ], + "type": ["object", "boolean"], + "properties": { + "definitions": { + "$comment": "While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.", + "type": "object", + "additionalProperties": {"$recursiveRef": "#"}, + "default": {} + }, + "dependencies": { + "$comment": "\"dependencies\" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to \"dependentSchemas\" and \"dependentRequired\"", + "type": "object", + "additionalProperties": { + "anyOf": [{"$recursiveRef": "#"}, {"$ref": "meta/validation#/$defs/stringArray"}] + } + } + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2020-12/index.ts b/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2020-12/index.ts new file mode 100644 index 0000000000..8e850d08b5 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2020-12/index.ts @@ -0,0 +1,30 @@ +import type Ajv from "../../core" +import type {AnySchemaObject} from "../../types" +import * as metaSchema from "./schema.json" +import * as applicator from "./meta/applicator.json" +import * as unevaluated from "./meta/unevaluated.json" +import * as content from "./meta/content.json" +import * as core from "./meta/core.json" +import * as format from "./meta/format-annotation.json" +import * as metadata from "./meta/meta-data.json" +import * as validation from "./meta/validation.json" + +const META_SUPPORT_DATA = ["/properties"] + +export default function addMetaSchema2020(this: Ajv, $data?: boolean): Ajv { + ;[ + metaSchema, + applicator, + unevaluated, + content, + core, + with$data(this, format), + metadata, + with$data(this, validation), + ].forEach((sch) => this.addMetaSchema(sch, undefined, false)) + return this + + function with$data(ajv: Ajv, sch: AnySchemaObject): AnySchemaObject { + return $data ? ajv.$dataMetaSchema(sch, META_SUPPORT_DATA) : sch + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2020-12/meta/applicator.json b/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2020-12/meta/applicator.json new file mode 100644 index 0000000000..674c913dab --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2020-12/meta/applicator.json @@ -0,0 +1,48 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json-schema.org/draft/2020-12/meta/applicator", + "$vocabulary": { + "https://json-schema.org/draft/2020-12/vocab/applicator": true + }, + "$dynamicAnchor": "meta", + + "title": "Applicator vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "prefixItems": {"$ref": "#/$defs/schemaArray"}, + "items": {"$dynamicRef": "#meta"}, + "contains": {"$dynamicRef": "#meta"}, + "additionalProperties": {"$dynamicRef": "#meta"}, + "properties": { + "type": "object", + "additionalProperties": {"$dynamicRef": "#meta"}, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": {"$dynamicRef": "#meta"}, + "propertyNames": {"format": "regex"}, + "default": {} + }, + "dependentSchemas": { + "type": "object", + "additionalProperties": {"$dynamicRef": "#meta"}, + "default": {} + }, + "propertyNames": {"$dynamicRef": "#meta"}, + "if": {"$dynamicRef": "#meta"}, + "then": {"$dynamicRef": "#meta"}, + "else": {"$dynamicRef": "#meta"}, + "allOf": {"$ref": "#/$defs/schemaArray"}, + "anyOf": {"$ref": "#/$defs/schemaArray"}, + "oneOf": {"$ref": "#/$defs/schemaArray"}, + "not": {"$dynamicRef": "#meta"} + }, + "$defs": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": {"$dynamicRef": "#meta"} + } + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2020-12/meta/content.json b/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2020-12/meta/content.json new file mode 100644 index 0000000000..2ae23ddb5c --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2020-12/meta/content.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json-schema.org/draft/2020-12/meta/content", + "$vocabulary": { + "https://json-schema.org/draft/2020-12/vocab/content": true + }, + "$dynamicAnchor": "meta", + + "title": "Content vocabulary meta-schema", + + "type": ["object", "boolean"], + "properties": { + "contentEncoding": {"type": "string"}, + "contentMediaType": {"type": "string"}, + "contentSchema": {"$dynamicRef": "#meta"} + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2020-12/meta/core.json b/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2020-12/meta/core.json new file mode 100644 index 0000000000..4c8e5cb616 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2020-12/meta/core.json @@ -0,0 +1,51 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json-schema.org/draft/2020-12/meta/core", + "$vocabulary": { + "https://json-schema.org/draft/2020-12/vocab/core": true + }, + "$dynamicAnchor": "meta", + + "title": "Core vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "$id": { + "$ref": "#/$defs/uriReferenceString", + "$comment": "Non-empty fragments not allowed.", + "pattern": "^[^#]*#?$" + }, + "$schema": {"$ref": "#/$defs/uriString"}, + "$ref": {"$ref": "#/$defs/uriReferenceString"}, + "$anchor": {"$ref": "#/$defs/anchorString"}, + "$dynamicRef": {"$ref": "#/$defs/uriReferenceString"}, + "$dynamicAnchor": {"$ref": "#/$defs/anchorString"}, + "$vocabulary": { + "type": "object", + "propertyNames": {"$ref": "#/$defs/uriString"}, + "additionalProperties": { + "type": "boolean" + } + }, + "$comment": { + "type": "string" + }, + "$defs": { + "type": "object", + "additionalProperties": {"$dynamicRef": "#meta"} + } + }, + "$defs": { + "anchorString": { + "type": "string", + "pattern": "^[A-Za-z_][-A-Za-z0-9._]*$" + }, + "uriString": { + "type": "string", + "format": "uri" + }, + "uriReferenceString": { + "type": "string", + "format": "uri-reference" + } + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2020-12/meta/format-annotation.json b/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2020-12/meta/format-annotation.json new file mode 100644 index 0000000000..83c26e35f0 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2020-12/meta/format-annotation.json @@ -0,0 +1,14 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json-schema.org/draft/2020-12/meta/format-annotation", + "$vocabulary": { + "https://json-schema.org/draft/2020-12/vocab/format-annotation": true + }, + "$dynamicAnchor": "meta", + + "title": "Format vocabulary meta-schema for annotation results", + "type": ["object", "boolean"], + "properties": { + "format": {"type": "string"} + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2020-12/meta/meta-data.json b/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2020-12/meta/meta-data.json new file mode 100644 index 0000000000..11946fb501 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2020-12/meta/meta-data.json @@ -0,0 +1,37 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json-schema.org/draft/2020-12/meta/meta-data", + "$vocabulary": { + "https://json-schema.org/draft/2020-12/vocab/meta-data": true + }, + "$dynamicAnchor": "meta", + + "title": "Meta-data vocabulary meta-schema", + + "type": ["object", "boolean"], + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "deprecated": { + "type": "boolean", + "default": false + }, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + } + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2020-12/meta/unevaluated.json b/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2020-12/meta/unevaluated.json new file mode 100644 index 0000000000..5e4b203b2c --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2020-12/meta/unevaluated.json @@ -0,0 +1,15 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json-schema.org/draft/2020-12/meta/unevaluated", + "$vocabulary": { + "https://json-schema.org/draft/2020-12/vocab/unevaluated": true + }, + "$dynamicAnchor": "meta", + + "title": "Unevaluated applicator vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "unevaluatedItems": {"$dynamicRef": "#meta"}, + "unevaluatedProperties": {"$dynamicRef": "#meta"} + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2020-12/meta/validation.json b/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2020-12/meta/validation.json new file mode 100644 index 0000000000..e0ae13d9d2 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2020-12/meta/validation.json @@ -0,0 +1,90 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json-schema.org/draft/2020-12/meta/validation", + "$vocabulary": { + "https://json-schema.org/draft/2020-12/vocab/validation": true + }, + "$dynamicAnchor": "meta", + + "title": "Validation vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "type": { + "anyOf": [ + {"$ref": "#/$defs/simpleTypes"}, + { + "type": "array", + "items": {"$ref": "#/$defs/simpleTypes"}, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "const": true, + "enum": { + "type": "array", + "items": true + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": {"$ref": "#/$defs/nonNegativeInteger"}, + "minLength": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, + "pattern": { + "type": "string", + "format": "regex" + }, + "maxItems": {"$ref": "#/$defs/nonNegativeInteger"}, + "minItems": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "maxContains": {"$ref": "#/$defs/nonNegativeInteger"}, + "minContains": { + "$ref": "#/$defs/nonNegativeInteger", + "default": 1 + }, + "maxProperties": {"$ref": "#/$defs/nonNegativeInteger"}, + "minProperties": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, + "required": {"$ref": "#/$defs/stringArray"}, + "dependentRequired": { + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/stringArray" + } + } + }, + "$defs": { + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "$ref": "#/$defs/nonNegativeInteger", + "default": 0 + }, + "simpleTypes": { + "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] + }, + "stringArray": { + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true, + "default": [] + } + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2020-12/schema.json b/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2020-12/schema.json new file mode 100644 index 0000000000..1c68270fdc --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-2020-12/schema.json @@ -0,0 +1,55 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json-schema.org/draft/2020-12/schema", + "$vocabulary": { + "https://json-schema.org/draft/2020-12/vocab/core": true, + "https://json-schema.org/draft/2020-12/vocab/applicator": true, + "https://json-schema.org/draft/2020-12/vocab/unevaluated": true, + "https://json-schema.org/draft/2020-12/vocab/validation": true, + "https://json-schema.org/draft/2020-12/vocab/meta-data": true, + "https://json-schema.org/draft/2020-12/vocab/format-annotation": true, + "https://json-schema.org/draft/2020-12/vocab/content": true + }, + "$dynamicAnchor": "meta", + + "title": "Core and Validation specifications meta-schema", + "allOf": [ + {"$ref": "meta/core"}, + {"$ref": "meta/applicator"}, + {"$ref": "meta/unevaluated"}, + {"$ref": "meta/validation"}, + {"$ref": "meta/meta-data"}, + {"$ref": "meta/format-annotation"}, + {"$ref": "meta/content"} + ], + "type": ["object", "boolean"], + "$comment": "This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.", + "properties": { + "definitions": { + "$comment": "\"definitions\" has been replaced by \"$defs\".", + "type": "object", + "additionalProperties": {"$dynamicRef": "#meta"}, + "deprecated": true, + "default": {} + }, + "dependencies": { + "$comment": "\"dependencies\" has been split and replaced by \"dependentSchemas\" and \"dependentRequired\" in order to serve their differing semantics.", + "type": "object", + "additionalProperties": { + "anyOf": [{"$dynamicRef": "#meta"}, {"$ref": "meta/validation#/$defs/stringArray"}] + }, + "deprecated": true, + "default": {} + }, + "$recursiveAnchor": { + "$comment": "\"$recursiveAnchor\" has been replaced by \"$dynamicAnchor\".", + "$ref": "meta/core#/$defs/anchorString", + "deprecated": true + }, + "$recursiveRef": { + "$comment": "\"$recursiveRef\" has been replaced by \"$dynamicRef\".", + "$ref": "meta/core#/$defs/uriReferenceString", + "deprecated": true + } + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-draft-06.json b/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-draft-06.json new file mode 100644 index 0000000000..5410064ba8 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-draft-06.json @@ -0,0 +1,137 @@ +{ + "$schema": "http://json-schema.org/draft-06/schema#", + "$id": "http://json-schema.org/draft-06/schema#", + "title": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": {"$ref": "#"} + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [{"$ref": "#/definitions/nonNegativeInteger"}, {"default": 0}] + }, + "simpleTypes": { + "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] + }, + "stringArray": { + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true, + "default": [] + } + }, + "type": ["object", "boolean"], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": {}, + "examples": { + "type": "array", + "items": {} + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": {"$ref": "#/definitions/nonNegativeInteger"}, + "minLength": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": {"$ref": "#"}, + "items": { + "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}], + "default": {} + }, + "maxItems": {"$ref": "#/definitions/nonNegativeInteger"}, + "minItems": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "contains": {"$ref": "#"}, + "maxProperties": {"$ref": "#/definitions/nonNegativeInteger"}, + "minProperties": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "required": {"$ref": "#/definitions/stringArray"}, + "additionalProperties": {"$ref": "#"}, + "definitions": { + "type": "object", + "additionalProperties": {"$ref": "#"}, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": {"$ref": "#"}, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": {"$ref": "#"}, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/stringArray"}] + } + }, + "propertyNames": {"$ref": "#"}, + "const": {}, + "enum": { + "type": "array", + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + {"$ref": "#/definitions/simpleTypes"}, + { + "type": "array", + "items": {"$ref": "#/definitions/simpleTypes"}, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "format": {"type": "string"}, + "allOf": {"$ref": "#/definitions/schemaArray"}, + "anyOf": {"$ref": "#/definitions/schemaArray"}, + "oneOf": {"$ref": "#/definitions/schemaArray"}, + "not": {"$ref": "#"} + }, + "default": {} +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-draft-07.json b/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-draft-07.json new file mode 100644 index 0000000000..6a74851043 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-draft-07.json @@ -0,0 +1,151 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://json-schema.org/draft-07/schema#", + "title": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": {"$ref": "#"} + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [{"$ref": "#/definitions/nonNegativeInteger"}, {"default": 0}] + }, + "simpleTypes": { + "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] + }, + "stringArray": { + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true, + "default": [] + } + }, + "type": ["object", "boolean"], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "readOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": {"$ref": "#/definitions/nonNegativeInteger"}, + "minLength": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": {"$ref": "#"}, + "items": { + "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}], + "default": true + }, + "maxItems": {"$ref": "#/definitions/nonNegativeInteger"}, + "minItems": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "contains": {"$ref": "#"}, + "maxProperties": {"$ref": "#/definitions/nonNegativeInteger"}, + "minProperties": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "required": {"$ref": "#/definitions/stringArray"}, + "additionalProperties": {"$ref": "#"}, + "definitions": { + "type": "object", + "additionalProperties": {"$ref": "#"}, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": {"$ref": "#"}, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": {"$ref": "#"}, + "propertyNames": {"format": "regex"}, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/stringArray"}] + } + }, + "propertyNames": {"$ref": "#"}, + "const": true, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + {"$ref": "#/definitions/simpleTypes"}, + { + "type": "array", + "items": {"$ref": "#/definitions/simpleTypes"}, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "format": {"type": "string"}, + "contentMediaType": {"type": "string"}, + "contentEncoding": {"type": "string"}, + "if": {"$ref": "#"}, + "then": {"$ref": "#"}, + "else": {"$ref": "#"}, + "allOf": {"$ref": "#/definitions/schemaArray"}, + "anyOf": {"$ref": "#/definitions/schemaArray"}, + "oneOf": {"$ref": "#/definitions/schemaArray"}, + "not": {"$ref": "#"} + }, + "default": true +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-secure.json b/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-secure.json new file mode 100644 index 0000000000..3968abd5d9 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/refs/json-schema-secure.json @@ -0,0 +1,88 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/json-schema-secure.json#", + "title": "Meta-schema for the security assessment of JSON Schemas", + "description": "If a JSON AnySchema fails validation against this meta-schema, it may be unsafe to validate untrusted data", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": {"$ref": "#"} + } + }, + "dependencies": { + "patternProperties": { + "description": "prevent slow validation of large property names", + "required": ["propertyNames"], + "properties": { + "propertyNames": { + "required": ["maxLength"] + } + } + }, + "uniqueItems": { + "description": "prevent slow validation of large non-scalar arrays", + "if": { + "properties": { + "uniqueItems": {"const": true}, + "items": { + "properties": { + "type": { + "anyOf": [ + { + "enum": ["object", "array"] + }, + { + "type": "array", + "contains": {"enum": ["object", "array"]} + } + ] + } + } + } + } + }, + "then": { + "required": ["maxItems"] + } + }, + "pattern": { + "description": "prevent slow pattern matching of large strings", + "required": ["maxLength"] + }, + "format": { + "description": "prevent slow format validation of large strings", + "required": ["maxLength"] + } + }, + "properties": { + "additionalItems": {"$ref": "#"}, + "additionalProperties": {"$ref": "#"}, + "dependencies": { + "additionalProperties": { + "anyOf": [{"type": "array"}, {"$ref": "#"}] + } + }, + "items": { + "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}] + }, + "definitions": { + "additionalProperties": {"$ref": "#"} + }, + "patternProperties": { + "additionalProperties": {"$ref": "#"} + }, + "properties": { + "additionalProperties": {"$ref": "#"} + }, + "if": {"$ref": "#"}, + "then": {"$ref": "#"}, + "else": {"$ref": "#"}, + "allOf": {"$ref": "#/definitions/schemaArray"}, + "anyOf": {"$ref": "#/definitions/schemaArray"}, + "oneOf": {"$ref": "#/definitions/schemaArray"}, + "not": {"$ref": "#"}, + "contains": {"$ref": "#"}, + "propertyNames": {"$ref": "#"} + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/refs/jtd-schema.ts b/front_end/third_party/mcp-sdk/ajv/lib/refs/jtd-schema.ts new file mode 100644 index 0000000000..c019812898 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/refs/jtd-schema.ts @@ -0,0 +1,130 @@ +import {SchemaObject} from "../types" + +type MetaSchema = (root: boolean) => SchemaObject + +const shared: MetaSchema = (root) => { + const sch: SchemaObject = { + nullable: {type: "boolean"}, + metadata: { + optionalProperties: { + union: {elements: {ref: "schema"}}, + }, + additionalProperties: true, + }, + } + if (root) sch.definitions = {values: {ref: "schema"}} + return sch +} + +const emptyForm: MetaSchema = (root) => ({ + optionalProperties: shared(root), +}) + +const refForm: MetaSchema = (root) => ({ + properties: { + ref: {type: "string"}, + }, + optionalProperties: shared(root), +}) + +const typeForm: MetaSchema = (root) => ({ + properties: { + type: { + enum: [ + "boolean", + "timestamp", + "string", + "float32", + "float64", + "int8", + "uint8", + "int16", + "uint16", + "int32", + "uint32", + ], + }, + }, + optionalProperties: shared(root), +}) + +const enumForm: MetaSchema = (root) => ({ + properties: { + enum: {elements: {type: "string"}}, + }, + optionalProperties: shared(root), +}) + +const elementsForm: MetaSchema = (root) => ({ + properties: { + elements: {ref: "schema"}, + }, + optionalProperties: shared(root), +}) + +const propertiesForm: MetaSchema = (root) => ({ + properties: { + properties: {values: {ref: "schema"}}, + }, + optionalProperties: { + optionalProperties: {values: {ref: "schema"}}, + additionalProperties: {type: "boolean"}, + ...shared(root), + }, +}) + +const optionalPropertiesForm: MetaSchema = (root) => ({ + properties: { + optionalProperties: {values: {ref: "schema"}}, + }, + optionalProperties: { + additionalProperties: {type: "boolean"}, + ...shared(root), + }, +}) + +const discriminatorForm: MetaSchema = (root) => ({ + properties: { + discriminator: {type: "string"}, + mapping: { + values: { + metadata: { + union: [propertiesForm(false), optionalPropertiesForm(false)], + }, + }, + }, + }, + optionalProperties: shared(root), +}) + +const valuesForm: MetaSchema = (root) => ({ + properties: { + values: {ref: "schema"}, + }, + optionalProperties: shared(root), +}) + +const schema: MetaSchema = (root) => ({ + metadata: { + union: [ + emptyForm, + refForm, + typeForm, + enumForm, + elementsForm, + propertiesForm, + optionalPropertiesForm, + discriminatorForm, + valuesForm, + ].map((s) => s(root)), + }, +}) + +const jtdMetaSchema: SchemaObject = { + definitions: { + schema: schema(false), + }, + ...schema(true), +} + +export default jtdMetaSchema diff --git a/front_end/third_party/mcp-sdk/ajv/lib/runtime/equal.ts b/front_end/third_party/mcp-sdk/ajv/lib/runtime/equal.ts new file mode 100644 index 0000000000..3cb00631a2 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/runtime/equal.ts @@ -0,0 +1,7 @@ +// https://github.com/ajv-validator/ajv/issues/889 +import * as equal from "fast-deep-equal" + +type Equal = typeof equal & {code: string} +;(equal as Equal).code = 'require("ajv/dist/runtime/equal").default' + +export default equal as Equal diff --git a/front_end/third_party/mcp-sdk/ajv/lib/runtime/parseJson.ts b/front_end/third_party/mcp-sdk/ajv/lib/runtime/parseJson.ts new file mode 100644 index 0000000000..472e5e5078 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/runtime/parseJson.ts @@ -0,0 +1,177 @@ +const rxParseJson = /position\s(\d+)(?: \(line \d+ column \d+\))?$/ + +export function parseJson(s: string, pos: number): unknown { + let endPos: number | undefined + parseJson.message = undefined + let matches: RegExpExecArray | null + if (pos) s = s.slice(pos) + try { + parseJson.position = pos + s.length + return JSON.parse(s) + } catch (e) { + matches = rxParseJson.exec((e as Error).message) + if (!matches) { + parseJson.message = "unexpected end" + return undefined + } + endPos = +matches[1] + const c = s[endPos] + s = s.slice(0, endPos) + parseJson.position = pos + endPos + try { + return JSON.parse(s) + } catch (e1) { + parseJson.message = `unexpected token ${c}` + return undefined + } + } +} + +parseJson.message = undefined as string | undefined +parseJson.position = 0 as number +parseJson.code = 'require("ajv/dist/runtime/parseJson").parseJson' + +export function parseJsonNumber(s: string, pos: number, maxDigits?: number): number | undefined { + let numStr = "" + let c: string + parseJsonNumber.message = undefined + if (s[pos] === "-") { + numStr += "-" + pos++ + } + if (s[pos] === "0") { + numStr += "0" + pos++ + } else { + if (!parseDigits(maxDigits)) { + errorMessage() + return undefined + } + } + if (maxDigits) { + parseJsonNumber.position = pos + return +numStr + } + if (s[pos] === ".") { + numStr += "." + pos++ + if (!parseDigits()) { + errorMessage() + return undefined + } + } + if (((c = s[pos]), c === "e" || c === "E")) { + numStr += "e" + pos++ + if (((c = s[pos]), c === "+" || c === "-")) { + numStr += c + pos++ + } + if (!parseDigits()) { + errorMessage() + return undefined + } + } + parseJsonNumber.position = pos + return +numStr + + function parseDigits(maxLen?: number): boolean { + let digit = false + while (((c = s[pos]), c >= "0" && c <= "9" && (maxLen === undefined || maxLen-- > 0))) { + digit = true + numStr += c + pos++ + } + return digit + } + + function errorMessage(): void { + parseJsonNumber.position = pos + parseJsonNumber.message = pos < s.length ? `unexpected token ${s[pos]}` : "unexpected end" + } +} + +parseJsonNumber.message = undefined as string | undefined +parseJsonNumber.position = 0 as number +parseJsonNumber.code = 'require("ajv/dist/runtime/parseJson").parseJsonNumber' + +const escapedChars: {[X in string]?: string} = { + b: "\b", + f: "\f", + n: "\n", + r: "\r", + t: "\t", + '"': '"', + "/": "/", + "\\": "\\", +} + +const CODE_A: number = "a".charCodeAt(0) +const CODE_0: number = "0".charCodeAt(0) + +export function parseJsonString(s: string, pos: number): string | undefined { + let str = "" + let c: string | undefined + parseJsonString.message = undefined + // eslint-disable-next-line no-constant-condition, @typescript-eslint/no-unnecessary-condition + while (true) { + c = s[pos++] + if (c === '"') break + if (c === "\\") { + c = s[pos] + if (c in escapedChars) { + str += escapedChars[c] + pos++ + } else if (c === "u") { + pos++ + let count = 4 + let code = 0 + while (count--) { + code <<= 4 + c = s[pos] + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + if (c === undefined) { + errorMessage("unexpected end") + return undefined + } + c = c.toLowerCase() + if (c >= "a" && c <= "f") { + code += c.charCodeAt(0) - CODE_A + 10 + } else if (c >= "0" && c <= "9") { + code += c.charCodeAt(0) - CODE_0 + } else { + errorMessage(`unexpected token ${c}`) + return undefined + } + pos++ + } + str += String.fromCharCode(code) + } else { + errorMessage(`unexpected token ${c}`) + return undefined + } + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + } else if (c === undefined) { + errorMessage("unexpected end") + return undefined + } else { + if (c.charCodeAt(0) >= 0x20) { + str += c + } else { + errorMessage(`unexpected token ${c}`) + return undefined + } + } + } + parseJsonString.position = pos + return str + + function errorMessage(msg: string): void { + parseJsonString.position = pos + parseJsonString.message = msg + } +} + +parseJsonString.message = undefined as string | undefined +parseJsonString.position = 0 as number +parseJsonString.code = 'require("ajv/dist/runtime/parseJson").parseJsonString' diff --git a/front_end/third_party/mcp-sdk/ajv/lib/runtime/quote.ts b/front_end/third_party/mcp-sdk/ajv/lib/runtime/quote.ts new file mode 100644 index 0000000000..1160e6a238 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/runtime/quote.ts @@ -0,0 +1,31 @@ +const rxEscapable = + // eslint-disable-next-line no-control-regex, no-misleading-character-class + /[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g + +const escaped: {[K in string]?: string} = { + "\b": "\\b", + "\t": "\\t", + "\n": "\\n", + "\f": "\\f", + "\r": "\\r", + '"': '\\"', + "\\": "\\\\", +} + +export default function quote(s: string): string { + rxEscapable.lastIndex = 0 + return ( + '"' + + (rxEscapable.test(s) + ? s.replace(rxEscapable, (a) => { + const c = escaped[a] + return typeof c === "string" + ? c + : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4) + }) + : s) + + '"' + ) +} + +quote.code = 'require("ajv/dist/runtime/quote").default' diff --git a/front_end/third_party/mcp-sdk/ajv/lib/runtime/re2.ts b/front_end/third_party/mcp-sdk/ajv/lib/runtime/re2.ts new file mode 100644 index 0000000000..0c769bc7ae --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/runtime/re2.ts @@ -0,0 +1,6 @@ +import * as re2 from "re2" + +type Re2 = typeof re2 & {code: string} +;(re2 as Re2).code = 'require("ajv/dist/runtime/re2").default' + +export default re2 as Re2 diff --git a/front_end/third_party/mcp-sdk/ajv/lib/runtime/timestamp.ts b/front_end/third_party/mcp-sdk/ajv/lib/runtime/timestamp.ts new file mode 100644 index 0000000000..1625f9a40f --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/runtime/timestamp.ts @@ -0,0 +1,46 @@ +const DT_SEPARATOR = /t|\s/i +const DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/ +const TIME = /^(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:z|([+-]\d\d)(?::?(\d\d))?)$/i +const DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] + +export default function validTimestamp(str: string, allowDate: boolean): boolean { + // http://tools.ietf.org/html/rfc3339#section-5.6 + const dt: string[] = str.split(DT_SEPARATOR) + return ( + (dt.length === 2 && validDate(dt[0]) && validTime(dt[1])) || + (allowDate && dt.length === 1 && validDate(dt[0])) + ) +} + +function validDate(str: string): boolean { + const matches: string[] | null = DATE.exec(str) + if (!matches) return false + const y: number = +matches[1] + const m: number = +matches[2] + const d: number = +matches[3] + return ( + m >= 1 && + m <= 12 && + d >= 1 && + (d <= DAYS[m] || + // leap year: https://tools.ietf.org/html/rfc3339#appendix-C + (m === 2 && d === 29 && (y % 100 === 0 ? y % 400 === 0 : y % 4 === 0))) + ) +} + +function validTime(str: string): boolean { + const matches: string[] | null = TIME.exec(str) + if (!matches) return false + const hr: number = +matches[1] + const min: number = +matches[2] + const sec: number = +matches[3] + const tzH: number = +(matches[4] || 0) + const tzM: number = +(matches[5] || 0) + return ( + (hr <= 23 && min <= 59 && sec <= 59) || + // leap second + (hr - tzH === 23 && min - tzM === 59 && sec === 60) + ) +} + +validTimestamp.code = 'require("ajv/dist/runtime/timestamp").default' diff --git a/front_end/third_party/mcp-sdk/ajv/lib/runtime/ucs2length.ts b/front_end/third_party/mcp-sdk/ajv/lib/runtime/ucs2length.ts new file mode 100644 index 0000000000..47d8292b83 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/runtime/ucs2length.ts @@ -0,0 +1,20 @@ +// https://mathiasbynens.be/notes/javascript-encoding +// https://github.com/bestiejs/punycode.js - punycode.ucs2.decode +export default function ucs2length(str: string): number { + const len = str.length + let length = 0 + let pos = 0 + let value: number + while (pos < len) { + length++ + value = str.charCodeAt(pos++) + if (value >= 0xd800 && value <= 0xdbff && pos < len) { + // high surrogate, and there is a next character + value = str.charCodeAt(pos) + if ((value & 0xfc00) === 0xdc00) pos++ // low surrogate + } + } + return length +} + +ucs2length.code = 'require("ajv/dist/runtime/ucs2length").default' diff --git a/front_end/third_party/mcp-sdk/ajv/lib/runtime/uri.ts b/front_end/third_party/mcp-sdk/ajv/lib/runtime/uri.ts new file mode 100644 index 0000000000..5450549cd5 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/runtime/uri.ts @@ -0,0 +1,6 @@ +import * as uri from "fast-uri" + +type URI = typeof uri & {code: string} +;(uri as URI).code = 'require("ajv/dist/runtime/uri").default' + +export default uri as URI diff --git a/front_end/third_party/mcp-sdk/ajv/lib/runtime/validation_error.ts b/front_end/third_party/mcp-sdk/ajv/lib/runtime/validation_error.ts new file mode 100644 index 0000000000..2d19a46a22 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/runtime/validation_error.ts @@ -0,0 +1,13 @@ +import type {ErrorObject} from "../types" + +export default class ValidationError extends Error { + readonly errors: Partial[] + readonly ajv: true + readonly validation: true + + constructor(errors: Partial[]) { + super("validation failed") + this.errors = errors + this.ajv = this.validation = true + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/standalone/index.ts b/front_end/third_party/mcp-sdk/ajv/lib/standalone/index.ts new file mode 100644 index 0000000000..b6129ce9e5 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/standalone/index.ts @@ -0,0 +1,100 @@ +import type AjvCore from "../core" +import type {AnyValidateFunction, SourceCode} from "../types" +import type {SchemaEnv} from "../compile" +import {UsedScopeValues, UsedValueState, ValueScopeName, varKinds} from "../compile/codegen/scope" +import {_, nil, _Code, Code, getProperty, getEsmExportName} from "../compile/codegen/code" + +function standaloneCode( + ajv: AjvCore, + refsOrFunc?: {[K in string]?: string} | AnyValidateFunction +): string { + if (!ajv.opts.code.source) { + throw new Error("moduleCode: ajv instance must have code.source option") + } + const {_n} = ajv.scope.opts + return typeof refsOrFunc == "function" + ? funcExportCode(refsOrFunc.source) + : refsOrFunc !== undefined + ? multiExportsCode(refsOrFunc, getValidate) + : multiExportsCode(ajv.schemas, (sch) => + sch.meta ? undefined : ajv.compile(sch.schema) + ) + + function getValidate(id: string): AnyValidateFunction { + const v = ajv.getSchema(id) + if (!v) throw new Error(`moduleCode: no schema with id ${id}`) + return v + } + + function funcExportCode(source?: SourceCode): string { + const usedValues: UsedScopeValues = {} + const n = source?.validateName + const vCode = validateCode(usedValues, source) + if (ajv.opts.code.esm) { + // Always do named export as `validate` rather than the variable `n` which is `validateXX` for known export value + return `"use strict";${_n}export const validate = ${n};${_n}export default ${n};${_n}${vCode}` + } + return `"use strict";${_n}module.exports = ${n};${_n}module.exports.default = ${n};${_n}${vCode}` + } + + function multiExportsCode( + schemas: {[K in string]?: T}, + getValidateFunc: (schOrId: T) => AnyValidateFunction | undefined + ): string { + const usedValues: UsedScopeValues = {} + let code = _`"use strict";` + for (const name in schemas) { + const v = getValidateFunc(schemas[name] as T) + if (v) { + const vCode = validateCode(usedValues, v.source) + const exportSyntax = ajv.opts.code.esm + ? _`export const ${getEsmExportName(name)}` + : _`exports${getProperty(name)}` + code = _`${code}${_n}${exportSyntax} = ${v.source?.validateName};${_n}${vCode}` + } + } + return `${code}` + } + + function validateCode(usedValues: UsedScopeValues, s?: SourceCode): Code { + if (!s) throw new Error('moduleCode: function does not have "source" property') + if (usedState(s.validateName) === UsedValueState.Completed) return nil + setUsedState(s.validateName, UsedValueState.Started) + + const scopeCode = ajv.scope.scopeCode(s.scopeValues, usedValues, refValidateCode) + const code = new _Code(`${scopeCode}${_n}${s.validateCode}`) + return s.evaluated ? _`${code}${s.validateName}.evaluated = ${s.evaluated};${_n}` : code + + function refValidateCode(n: ValueScopeName): Code | undefined { + const vRef = n.value?.ref + if (n.prefix === "validate" && typeof vRef == "function") { + const v = vRef as AnyValidateFunction + return validateCode(usedValues, v.source) + } else if ((n.prefix === "root" || n.prefix === "wrapper") && typeof vRef == "object") { + const {validate, validateName} = vRef as SchemaEnv + if (!validateName) throw new Error("ajv internal error") + const def = ajv.opts.code.es5 ? varKinds.var : varKinds.const + const wrapper = _`${def} ${n} = {validate: ${validateName}};` + if (usedState(validateName) === UsedValueState.Started) return wrapper + const vCode = validateCode(usedValues, validate?.source) + return _`${wrapper}${_n}${vCode}` + } + return undefined + } + + function usedState(name: ValueScopeName): UsedValueState | undefined { + return usedValues[name.prefix]?.get(name) + } + + function setUsedState(name: ValueScopeName, state: UsedValueState): void { + const {prefix} = name + const names = (usedValues[prefix] = usedValues[prefix] || new Map()) + names.set(name, state) + } + } +} + +module.exports = exports = standaloneCode +Object.defineProperty(exports, "__esModule", {value: true}) + +export default standaloneCode diff --git a/front_end/third_party/mcp-sdk/ajv/lib/standalone/instance.ts b/front_end/third_party/mcp-sdk/ajv/lib/standalone/instance.ts new file mode 100644 index 0000000000..c4b2c30b58 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/standalone/instance.ts @@ -0,0 +1,36 @@ +import Ajv, {AnySchema, AnyValidateFunction, ErrorObject} from "../core" +import standaloneCode from "." +import * as requireFromString from "require-from-string" + +export default class AjvPack { + errors?: ErrorObject[] | null // errors from the last validation + constructor(readonly ajv: Ajv) {} + + validate(schemaKeyRef: AnySchema | string, data: unknown): boolean | Promise { + return Ajv.prototype.validate.call(this, schemaKeyRef, data) + } + + compile(schema: AnySchema, meta?: boolean): AnyValidateFunction { + return this.getStandalone(this.ajv.compile(schema, meta)) + } + + getSchema(keyRef: string): AnyValidateFunction | undefined { + const v = this.ajv.getSchema(keyRef) + if (!v) return undefined + return this.getStandalone(v) + } + + private getStandalone(v: AnyValidateFunction): AnyValidateFunction { + return requireFromString(standaloneCode(this.ajv, v)) as AnyValidateFunction + } + + addSchema(...args: Parameters): AjvPack { + this.ajv.addSchema.call(this.ajv, ...args) + return this + } + + addKeyword(...args: Parameters): AjvPack { + this.ajv.addKeyword.call(this.ajv, ...args) + return this + } +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/types/index.ts b/front_end/third_party/mcp-sdk/ajv/lib/types/index.ts new file mode 100644 index 0000000000..39bc51b0b9 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/types/index.ts @@ -0,0 +1,244 @@ +import {URIComponent} from "fast-uri" +import type {CodeGen, Code, Name, ScopeValueSets, ValueScopeName} from "../compile/codegen" +import type {SchemaEnv, SchemaCxt, SchemaObjCxt} from "../compile" +import type {JSONType} from "../compile/rules" +import type {KeywordCxt} from "../compile/validate" +import type Ajv from "../core" + +interface _SchemaObject { + id?: string + $id?: string + $schema?: string + [x: string]: any // TODO +} + +export interface SchemaObject extends _SchemaObject { + id?: string + $id?: string + $schema?: string + $async?: false + [x: string]: any // TODO +} + +export interface AsyncSchema extends _SchemaObject { + $async: true +} + +export type AnySchemaObject = SchemaObject | AsyncSchema + +export type Schema = SchemaObject | boolean + +export type AnySchema = Schema | AsyncSchema + +export type SchemaMap = {[Key in string]?: AnySchema} + +export interface SourceCode { + validateName: ValueScopeName + validateCode: string + scopeValues: ScopeValueSets + evaluated?: Code +} + +export interface DataValidationCxt { + instancePath: string + parentData: {[K in T]: any} // object or array + parentDataProperty: T // string or number + rootData: Record | any[] + dynamicAnchors: {[Ref in string]?: ValidateFunction} +} + +export interface ValidateFunction { + // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents + (this: Ajv | any, data: any, dataCxt?: DataValidationCxt): data is T + errors?: null | ErrorObject[] + evaluated?: Evaluated + schema: AnySchema + schemaEnv: SchemaEnv + source?: SourceCode +} + +export interface JTDParser { + (json: string): T | undefined + message?: string + position?: number +} + +export type EvaluatedProperties = {[K in string]?: true} | true + +export type EvaluatedItems = number | true + +export interface Evaluated { + // determined at compile time if staticProps/Items is true + props?: EvaluatedProperties + items?: EvaluatedItems + // whether props/items determined at compile time + dynamicProps: boolean + dynamicItems: boolean +} + +export interface AsyncValidateFunction extends ValidateFunction { + (...args: Parameters>): Promise + $async: true +} + +export type AnyValidateFunction = ValidateFunction | AsyncValidateFunction + +export interface ErrorObject, S = unknown> { + keyword: K + instancePath: string + schemaPath: string + params: P + // Added to validation errors of "propertyNames" keyword schema + propertyName?: string + // Excluded if option `messages` set to false. + message?: string + // These are added with the `verbose` option. + schema?: S + parentSchema?: AnySchemaObject + data?: unknown +} + +export type ErrorNoParams = ErrorObject, S> + +interface _KeywordDef { + keyword: string | string[] + type?: JSONType | JSONType[] // data types that keyword applies to + schemaType?: JSONType | JSONType[] // allowed type(s) of keyword value in the schema + allowUndefined?: boolean // used for keywords that can be invoked by other keywords, not being present in the schema + $data?: boolean // keyword supports [$data reference](../../docs/guide/combining-schemas.md#data-reference) + implements?: string[] // other schema keywords that this keyword implements + before?: string // keyword should be executed before this keyword (should be applicable to the same type) + post?: boolean // keyword should be executed after other keywords without post flag + metaSchema?: AnySchemaObject // meta-schema for keyword schema value - it is better to use schemaType where applicable + validateSchema?: AnyValidateFunction // compiled keyword metaSchema - should not be passed + dependencies?: string[] // keywords that must be present in the same schema + error?: KeywordErrorDefinition + $dataError?: KeywordErrorDefinition +} + +export interface CodeKeywordDefinition extends _KeywordDef { + code: (cxt: KeywordCxt, ruleType?: string) => void + trackErrors?: boolean +} + +export type MacroKeywordFunc = ( + schema: any, + parentSchema: AnySchemaObject, + it: SchemaCxt +) => AnySchema + +export type CompileKeywordFunc = ( + schema: any, + parentSchema: AnySchemaObject, + it: SchemaObjCxt +) => DataValidateFunction + +export interface DataValidateFunction { + (...args: Parameters): boolean | Promise + errors?: Partial[] +} + +export interface SchemaValidateFunction { + ( + schema: any, + data: any, + parentSchema?: AnySchemaObject, + dataCxt?: DataValidationCxt + ): boolean | Promise + errors?: Partial[] +} + +export interface FuncKeywordDefinition extends _KeywordDef { + validate?: SchemaValidateFunction | DataValidateFunction + compile?: CompileKeywordFunc + // schema: false makes validate not to expect schema (DataValidateFunction) + schema?: boolean // requires "validate" + modifying?: boolean + async?: boolean + valid?: boolean + errors?: boolean | "full" +} + +export interface MacroKeywordDefinition extends FuncKeywordDefinition { + macro: MacroKeywordFunc +} + +export type KeywordDefinition = + | CodeKeywordDefinition + | FuncKeywordDefinition + | MacroKeywordDefinition + +export type AddedKeywordDefinition = KeywordDefinition & { + type: JSONType[] + schemaType: JSONType[] +} + +export interface KeywordErrorDefinition { + message: string | Code | ((cxt: KeywordErrorCxt) => string | Code) + params?: Code | ((cxt: KeywordErrorCxt) => Code) +} + +export type Vocabulary = (KeywordDefinition | string)[] + +export interface KeywordErrorCxt { + gen: CodeGen + keyword: string + data: Name + $data?: string | false + schema: any // TODO + parentSchema?: AnySchemaObject + schemaCode: Code | number | boolean + schemaValue: Code | number | boolean + schemaType?: JSONType[] + errsCount?: Name + params: KeywordCxtParams + it: SchemaCxt +} + +export type KeywordCxtParams = {[P in string]?: Code | string | number} + +export type FormatValidator = (data: T) => boolean + +export type FormatCompare = (data1: T, data2: T) => number | undefined + +export type AsyncFormatValidator = (data: T) => Promise + +export interface FormatDefinition { + type?: T extends string ? "string" | undefined : "number" + validate: FormatValidator | (T extends string ? string | RegExp : never) + async?: false | undefined + compare?: FormatCompare +} + +export interface AsyncFormatDefinition { + type?: T extends string ? "string" | undefined : "number" + validate: AsyncFormatValidator + async: true + compare?: FormatCompare +} + +export type AddedFormat = + | true + | RegExp + | FormatValidator + | FormatDefinition + | FormatDefinition + | AsyncFormatDefinition + | AsyncFormatDefinition + +export type Format = AddedFormat | string + +export interface RegExpEngine { + (pattern: string, u: string): RegExpLike + code: string +} + +export interface RegExpLike { + test: (s: string) => boolean +} + +export interface UriResolver { + parse(uri: string): URIComponent + resolve(base: string, path: string): string + serialize(component: URIComponent): string +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/types/json-schema.ts b/front_end/third_party/mcp-sdk/ajv/lib/types/json-schema.ts new file mode 100644 index 0000000000..065c972e54 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/types/json-schema.ts @@ -0,0 +1,187 @@ +/* eslint-disable @typescript-eslint/no-empty-interface */ +type StrictNullChecksWrapper = undefined extends null + ? `strictNullChecks must be true in tsconfig to use ${Name}` + : Type + +type UnionToIntersection = (U extends any ? (_: U) => void : never) extends (_: infer I) => void + ? I + : never + +export type SomeJSONSchema = UncheckedJSONSchemaType + +type UncheckedPartialSchema = Partial> + +export type PartialSchema = StrictNullChecksWrapper<"PartialSchema", UncheckedPartialSchema> + +type JSONType = IsPartial extends true + ? T | undefined + : T + +interface NumberKeywords { + minimum?: number + maximum?: number + exclusiveMinimum?: number + exclusiveMaximum?: number + multipleOf?: number + format?: string +} + +interface StringKeywords { + minLength?: number + maxLength?: number + pattern?: string + format?: string +} + +type UncheckedJSONSchemaType = ( + | // these two unions allow arbitrary unions of types + { + anyOf: readonly UncheckedJSONSchemaType[] + } + | { + oneOf: readonly UncheckedJSONSchemaType[] + } + // this union allows for { type: (primitive)[] } style schemas + | ({ + type: readonly (T extends number + ? JSONType<"number" | "integer", IsPartial> + : T extends string + ? JSONType<"string", IsPartial> + : T extends boolean + ? JSONType<"boolean", IsPartial> + : never)[] + } & UnionToIntersection< + T extends number + ? NumberKeywords + : T extends string + ? StringKeywords + : T extends boolean + ? // eslint-disable-next-line @typescript-eslint/ban-types + {} + : never + >) + // this covers "normal" types; it's last so typescript looks to it first for errors + | ((T extends number + ? { + type: JSONType<"number" | "integer", IsPartial> + } & NumberKeywords + : T extends string + ? { + type: JSONType<"string", IsPartial> + } & StringKeywords + : T extends boolean + ? { + type: JSONType<"boolean", IsPartial> + } + : T extends readonly [any, ...any[]] + ? { + // JSON AnySchema for tuple + type: JSONType<"array", IsPartial> + items: { + readonly [K in keyof T]-?: UncheckedJSONSchemaType & Nullable + } & {length: T["length"]} + minItems: T["length"] + } & ({maxItems: T["length"]} | {additionalItems: false}) + : T extends readonly any[] + ? { + type: JSONType<"array", IsPartial> + items: UncheckedJSONSchemaType + contains?: UncheckedPartialSchema + minItems?: number + maxItems?: number + minContains?: number + maxContains?: number + uniqueItems?: true + additionalItems?: never + } + : T extends Record + ? { + // JSON AnySchema for records and dictionaries + // "required" is not optional because it is often forgotten + // "properties" are optional for more concise dictionary schemas + // "patternProperties" and can be only used with interfaces that have string index + type: JSONType<"object", IsPartial> + additionalProperties?: boolean | UncheckedJSONSchemaType + unevaluatedProperties?: boolean | UncheckedJSONSchemaType + properties?: IsPartial extends true + ? Partial> + : UncheckedPropertiesSchema + patternProperties?: Record> + propertyNames?: Omit, "type"> & {type?: "string"} + dependencies?: {[K in keyof T]?: readonly (keyof T)[] | UncheckedPartialSchema} + dependentRequired?: {[K in keyof T]?: readonly (keyof T)[]} + dependentSchemas?: {[K in keyof T]?: UncheckedPartialSchema} + minProperties?: number + maxProperties?: number + } & (IsPartial extends true // "required" is not necessary if it's a non-partial type with no required keys // are listed it only asserts that optional cannot be listed. // "required" type does not guarantee that all required properties + ? {required: readonly (keyof T)[]} + : [UncheckedRequiredMembers] extends [never] + ? {required?: readonly UncheckedRequiredMembers[]} + : {required: readonly UncheckedRequiredMembers[]}) + : T extends null + ? { + type: JSONType<"null", IsPartial> + nullable: true + } + : never) & { + allOf?: readonly UncheckedPartialSchema[] + anyOf?: readonly UncheckedPartialSchema[] + oneOf?: readonly UncheckedPartialSchema[] + if?: UncheckedPartialSchema + then?: UncheckedPartialSchema + else?: UncheckedPartialSchema + not?: UncheckedPartialSchema + }) +) & { + [keyword: string]: any + $id?: string + $ref?: string + $defs?: Record> + definitions?: Record> +} + +export type JSONSchemaType = StrictNullChecksWrapper< + "JSONSchemaType", + UncheckedJSONSchemaType +> + +type Known = + | {[key: string]: Known} + | [Known, ...Known[]] + | Known[] + | number + | string + | boolean + | null + +type UncheckedPropertiesSchema = { + [K in keyof T]-?: (UncheckedJSONSchemaType & Nullable) | {$ref: string} +} + +export type PropertiesSchema = StrictNullChecksWrapper< + "PropertiesSchema", + UncheckedPropertiesSchema +> + +type UncheckedRequiredMembers = { + [K in keyof T]-?: undefined extends T[K] ? never : K +}[keyof T] + +export type RequiredMembers = StrictNullChecksWrapper< + "RequiredMembers", + UncheckedRequiredMembers +> + +type Nullable = undefined extends T + ? { + nullable: true + const?: null // any non-null value would fail `const: null`, `null` would fail any other value in const + enum?: readonly (T | null)[] // `null` must be explicitly included in "enum" for `null` to pass + default?: T | null + } + : { + nullable?: false + const?: T + enum?: readonly T[] + default?: T + } diff --git a/front_end/third_party/mcp-sdk/ajv/lib/types/jtd-schema.ts b/front_end/third_party/mcp-sdk/ajv/lib/types/jtd-schema.ts new file mode 100644 index 0000000000..61b2bde81d --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/types/jtd-schema.ts @@ -0,0 +1,273 @@ +/** numeric strings */ +type NumberType = "float32" | "float64" | "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32" + +/** string strings */ +type StringType = "string" | "timestamp" + +/** Generic JTD Schema without inference of the represented type */ +export type SomeJTDSchemaType = ( + | // ref + {ref: string} + // primitives + | {type: NumberType | StringType | "boolean"} + // enum + | {enum: string[]} + // elements + | {elements: SomeJTDSchemaType} + // values + | {values: SomeJTDSchemaType} + // properties + | { + properties: Record + optionalProperties?: Record + additionalProperties?: boolean + } + | { + properties?: Record + optionalProperties: Record + additionalProperties?: boolean + } + // discriminator + | {discriminator: string; mapping: Record} + // empty + // NOTE see the end of + // https://github.com/typescript-eslint/typescript-eslint/issues/2063#issuecomment-675156492 + // eslint-disable-next-line @typescript-eslint/ban-types + | {} +) & { + nullable?: boolean + metadata?: Record + definitions?: Record +} + +/** required keys of an object, not undefined */ +type RequiredKeys = { + [K in keyof T]-?: undefined extends T[K] ? never : K +}[keyof T] + +/** optional or undifined-able keys of an object */ +type OptionalKeys = { + [K in keyof T]-?: undefined extends T[K] ? K : never +}[keyof T] + +/** type is true if T is a union type */ +type IsUnion_ = false extends ( + T extends unknown ? ([U] extends [T] ? false : true) : never +) + ? false + : true +type IsUnion = IsUnion_ + +/** type is true if T is identically E */ +type TypeEquality = [T] extends [E] ? ([E] extends [T] ? true : false) : false + +/** type is true if T or null is identically E or null*/ +type NullTypeEquality = TypeEquality + +/** gets only the string literals of a type or null if a type isn't a string literal */ +type EnumString = [T] extends [never] + ? null + : T extends string + ? string extends T + ? null + : T + : null + +/** true if type is a union of string literals */ +type IsEnum = null extends EnumString ? false : true + +/** true only if all types are array types (not tuples) */ +// NOTE relies on the fact that tuples don't have an index at 0.5, but arrays +// have an index at every number +type IsElements = false extends IsUnion + ? [T] extends [readonly unknown[]] + ? undefined extends T[0.5] + ? false + : true + : false + : false + +/** true if the the type is a values type */ +type IsValues = false extends IsUnion ? TypeEquality : false + +/** true if type is a properties type and Union is false, or type is a discriminator type and Union is true */ +type IsRecord = Union extends IsUnion + ? null extends EnumString + ? false + : true + : false + +/** true if type represents an empty record */ +type IsEmptyRecord = [T] extends [Record] + ? [T] extends [never] + ? false + : true + : false + +/** actual schema */ +export type JTDSchemaType = Record> = ( + | // refs - where null wasn't specified, must match exactly + (null extends EnumString + ? never + : + | ({[K in keyof D]: [T] extends [D[K]] ? {ref: K} : never}[keyof D] & {nullable?: false}) + // nulled refs - if ref is nullable and nullable is specified, then it can + // match either null or non-null definitions + | (null extends T + ? { + [K in keyof D]: [Exclude] extends [Exclude] + ? {ref: K} + : never + }[keyof D] & {nullable: true} + : never)) + // empty - empty schemas also treat nullable differently in that it's now fully ignored + | (unknown extends T ? {nullable?: boolean} : never) + // all other types // numbers - only accepts the type number + | ((true extends NullTypeEquality + ? {type: NumberType} + : // booleans - accepts the type boolean + true extends NullTypeEquality + ? {type: "boolean"} + : // strings - only accepts the type string + true extends NullTypeEquality + ? {type: StringType} + : // strings - only accepts the type Date + true extends NullTypeEquality + ? {type: "timestamp"} + : // enums - only accepts union of string literals + // TODO we can't actually check that everything in the union was specified + true extends IsEnum> + ? {enum: EnumString>[]} + : // arrays - only accepts arrays, could be array of unions to be resolved later + true extends IsElements> + ? T extends readonly (infer E)[] + ? { + elements: JTDSchemaType + } + : never + : // empty properties + true extends IsEmptyRecord> + ? + | {properties: Record; optionalProperties?: Record} + | {optionalProperties: Record} + : // values + true extends IsValues> + ? T extends Record + ? { + values: JTDSchemaType + } + : never + : // properties + true extends IsRecord, false> + ? ([RequiredKeys>] extends [never] + ? { + properties?: Record + } + : { + properties: {[K in RequiredKeys]: JTDSchemaType} + }) & + ([OptionalKeys>] extends [never] + ? { + optionalProperties?: Record + } + : { + optionalProperties: { + [K in OptionalKeys]: JTDSchemaType, D> + } + }) & { + additionalProperties?: boolean + } + : // discriminator + true extends IsRecord, true> + ? { + [K in keyof Exclude]-?: Exclude[K] extends string + ? { + discriminator: K + mapping: { + // TODO currently allows descriminator to be present in schema + [M in Exclude[K]]: JTDSchemaType< + Omit ? T : never, K>, + D + > + } + } + : never + }[keyof Exclude] + : never) & + (null extends T + ? { + nullable: true + } + : {nullable?: false})) +) & { + // extra properties + metadata?: Record + // TODO these should only be allowed at the top level + definitions?: {[K in keyof D]: JTDSchemaType} +} + +type JTDDataDef> = + | // ref + (S extends {ref: string} + ? D extends {[K in S["ref"]]: infer V} + ? JTDDataDef + : never + : // type + S extends {type: NumberType} + ? number + : S extends {type: "boolean"} + ? boolean + : S extends {type: "string"} + ? string + : S extends {type: "timestamp"} + ? string | Date + : // enum + S extends {enum: readonly (infer E)[]} + ? string extends E + ? never + : [E] extends [string] + ? E + : never + : // elements + S extends {elements: infer E} + ? JTDDataDef[] + : // properties + S extends { + properties: Record + optionalProperties?: Record + additionalProperties?: boolean + } + ? {-readonly [K in keyof S["properties"]]-?: JTDDataDef} & { + -readonly [K in keyof S["optionalProperties"]]+?: JTDDataDef< + S["optionalProperties"][K], + D + > + } & ([S["additionalProperties"]] extends [true] ? Record : unknown) + : S extends { + properties?: Record + optionalProperties: Record + additionalProperties?: boolean + } + ? {-readonly [K in keyof S["properties"]]-?: JTDDataDef} & { + -readonly [K in keyof S["optionalProperties"]]+?: JTDDataDef< + S["optionalProperties"][K], + D + > + } & ([S["additionalProperties"]] extends [true] ? Record : unknown) + : // values + S extends {values: infer V} + ? Record> + : // discriminator + S extends {discriminator: infer M; mapping: Record} + ? [M] extends [string] + ? { + [K in keyof S["mapping"]]: JTDDataDef & {[KM in M]: K} + }[keyof S["mapping"]] + : never + : // empty + unknown) + | (S extends {nullable: true} ? null : never) + +export type JTDDataType = S extends {definitions: Record} + ? JTDDataDef + : JTDDataDef> diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/additionalItems.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/additionalItems.ts new file mode 100644 index 0000000000..755e5b3daf --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/additionalItems.ts @@ -0,0 +1,56 @@ +import type { + CodeKeywordDefinition, + ErrorObject, + KeywordErrorDefinition, + AnySchema, +} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, str, not, Name} from "../../compile/codegen" +import {alwaysValidSchema, checkStrictMode, Type} from "../../compile/util" + +export type AdditionalItemsError = ErrorObject<"additionalItems", {limit: number}, AnySchema> + +const error: KeywordErrorDefinition = { + message: ({params: {len}}) => str`must NOT have more than ${len} items`, + params: ({params: {len}}) => _`{limit: ${len}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "additionalItems" as const, + type: "array", + schemaType: ["boolean", "object"], + before: "uniqueItems", + error, + code(cxt: KeywordCxt) { + const {parentSchema, it} = cxt + const {items} = parentSchema + if (!Array.isArray(items)) { + checkStrictMode(it, '"additionalItems" is ignored when "items" is not an array of schemas') + return + } + validateAdditionalItems(cxt, items) + }, +} + +export function validateAdditionalItems(cxt: KeywordCxt, items: AnySchema[]): void { + const {gen, schema, data, keyword, it} = cxt + it.items = true + const len = gen.const("len", _`${data}.length`) + if (schema === false) { + cxt.setParams({len: items.length}) + cxt.pass(_`${len} <= ${items.length}`) + } else if (typeof schema == "object" && !alwaysValidSchema(it, schema)) { + const valid = gen.var("valid", _`${len} <= ${items.length}`) // TODO var + gen.if(not(valid), () => validateItems(valid)) + cxt.ok(valid) + } + + function validateItems(valid: Name): void { + gen.forRange("i", items.length, len, (i) => { + cxt.subschema({keyword, dataProp: i, dataPropType: Type.Num}, valid) + if (!it.allErrors) gen.if(not(valid), () => gen.break()) + }) + } +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/additionalProperties.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/additionalProperties.ts new file mode 100644 index 0000000000..bfb511ce51 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/additionalProperties.ts @@ -0,0 +1,118 @@ +import type { + CodeKeywordDefinition, + AddedKeywordDefinition, + ErrorObject, + KeywordErrorDefinition, + AnySchema, +} from "../../types" +import {allSchemaProperties, usePattern, isOwnProperty} from "../code" +import {_, nil, or, not, Code, Name} from "../../compile/codegen" +import N from "../../compile/names" +import type {SubschemaArgs} from "../../compile/validate/subschema" +import {alwaysValidSchema, schemaRefOrVal, Type} from "../../compile/util" + +export type AdditionalPropertiesError = ErrorObject< + "additionalProperties", + {additionalProperty: string}, + AnySchema +> + +const error: KeywordErrorDefinition = { + message: "must NOT have additional properties", + params: ({params}) => _`{additionalProperty: ${params.additionalProperty}}`, +} + +const def: CodeKeywordDefinition & AddedKeywordDefinition = { + keyword: "additionalProperties", + type: ["object"], + schemaType: ["boolean", "object"], + allowUndefined: true, + trackErrors: true, + error, + code(cxt) { + const {gen, schema, parentSchema, data, errsCount, it} = cxt + /* istanbul ignore if */ + if (!errsCount) throw new Error("ajv implementation error") + const {allErrors, opts} = it + it.props = true + if (opts.removeAdditional !== "all" && alwaysValidSchema(it, schema)) return + const props = allSchemaProperties(parentSchema.properties) + const patProps = allSchemaProperties(parentSchema.patternProperties) + checkAdditionalProperties() + cxt.ok(_`${errsCount} === ${N.errors}`) + + function checkAdditionalProperties(): void { + gen.forIn("key", data, (key: Name) => { + if (!props.length && !patProps.length) additionalPropertyCode(key) + else gen.if(isAdditional(key), () => additionalPropertyCode(key)) + }) + } + + function isAdditional(key: Name): Code { + let definedProp: Code + if (props.length > 8) { + // TODO maybe an option instead of hard-coded 8? + const propsSchema = schemaRefOrVal(it, parentSchema.properties, "properties") + definedProp = isOwnProperty(gen, propsSchema as Code, key) + } else if (props.length) { + definedProp = or(...props.map((p) => _`${key} === ${p}`)) + } else { + definedProp = nil + } + if (patProps.length) { + definedProp = or(definedProp, ...patProps.map((p) => _`${usePattern(cxt, p)}.test(${key})`)) + } + return not(definedProp) + } + + function deleteAdditional(key: Name): void { + gen.code(_`delete ${data}[${key}]`) + } + + function additionalPropertyCode(key: Name): void { + if (opts.removeAdditional === "all" || (opts.removeAdditional && schema === false)) { + deleteAdditional(key) + return + } + + if (schema === false) { + cxt.setParams({additionalProperty: key}) + cxt.error() + if (!allErrors) gen.break() + return + } + + if (typeof schema == "object" && !alwaysValidSchema(it, schema)) { + const valid = gen.name("valid") + if (opts.removeAdditional === "failing") { + applyAdditionalSchema(key, valid, false) + gen.if(not(valid), () => { + cxt.reset() + deleteAdditional(key) + }) + } else { + applyAdditionalSchema(key, valid) + if (!allErrors) gen.if(not(valid), () => gen.break()) + } + } + } + + function applyAdditionalSchema(key: Name, valid: Name, errors?: false): void { + const subschema: SubschemaArgs = { + keyword: "additionalProperties", + dataProp: key, + dataPropType: Type.Str, + } + if (errors === false) { + Object.assign(subschema, { + compositeRule: true, + createErrors: false, + allErrors: false, + }) + } + cxt.subschema(subschema, valid) + } + }, +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/allOf.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/allOf.ts new file mode 100644 index 0000000000..cdfa86ff43 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/allOf.ts @@ -0,0 +1,22 @@ +import type {CodeKeywordDefinition, AnySchema} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {alwaysValidSchema} from "../../compile/util" + +const def: CodeKeywordDefinition = { + keyword: "allOf", + schemaType: "array", + code(cxt: KeywordCxt) { + const {gen, schema, it} = cxt + /* istanbul ignore if */ + if (!Array.isArray(schema)) throw new Error("ajv implementation error") + const valid = gen.name("valid") + schema.forEach((sch: AnySchema, i: number) => { + if (alwaysValidSchema(it, sch)) return + const schCxt = cxt.subschema({keyword: "allOf", schemaProp: i}, valid) + cxt.ok(valid) + cxt.mergeEvaluated(schCxt) + }) + }, +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/anyOf.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/anyOf.ts new file mode 100644 index 0000000000..bd331b5ae9 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/anyOf.ts @@ -0,0 +1,14 @@ +import type {CodeKeywordDefinition, ErrorNoParams, AnySchema} from "../../types" +import {validateUnion} from "../code" + +export type AnyOfError = ErrorNoParams<"anyOf", AnySchema[]> + +const def: CodeKeywordDefinition = { + keyword: "anyOf", + schemaType: "array", + trackErrors: true, + code: validateUnion, + error: {message: "must match a schema in anyOf"}, +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/contains.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/contains.ts new file mode 100644 index 0000000000..d88675c6c2 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/contains.ts @@ -0,0 +1,109 @@ +import type { + CodeKeywordDefinition, + KeywordErrorDefinition, + ErrorObject, + AnySchema, +} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, str, Name} from "../../compile/codegen" +import {alwaysValidSchema, checkStrictMode, Type} from "../../compile/util" + +export type ContainsError = ErrorObject< + "contains", + {minContains: number; maxContains?: number}, + AnySchema +> + +const error: KeywordErrorDefinition = { + message: ({params: {min, max}}) => + max === undefined + ? str`must contain at least ${min} valid item(s)` + : str`must contain at least ${min} and no more than ${max} valid item(s)`, + params: ({params: {min, max}}) => + max === undefined ? _`{minContains: ${min}}` : _`{minContains: ${min}, maxContains: ${max}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "contains", + type: "array", + schemaType: ["object", "boolean"], + before: "uniqueItems", + trackErrors: true, + error, + code(cxt: KeywordCxt) { + const {gen, schema, parentSchema, data, it} = cxt + let min: number + let max: number | undefined + const {minContains, maxContains} = parentSchema + if (it.opts.next) { + min = minContains === undefined ? 1 : minContains + max = maxContains + } else { + min = 1 + } + const len = gen.const("len", _`${data}.length`) + cxt.setParams({min, max}) + if (max === undefined && min === 0) { + checkStrictMode(it, `"minContains" == 0 without "maxContains": "contains" keyword ignored`) + return + } + if (max !== undefined && min > max) { + checkStrictMode(it, `"minContains" > "maxContains" is always invalid`) + cxt.fail() + return + } + if (alwaysValidSchema(it, schema)) { + let cond = _`${len} >= ${min}` + if (max !== undefined) cond = _`${cond} && ${len} <= ${max}` + cxt.pass(cond) + return + } + + it.items = true + const valid = gen.name("valid") + if (max === undefined && min === 1) { + validateItems(valid, () => gen.if(valid, () => gen.break())) + } else if (min === 0) { + gen.let(valid, true) + if (max !== undefined) gen.if(_`${data}.length > 0`, validateItemsWithCount) + } else { + gen.let(valid, false) + validateItemsWithCount() + } + cxt.result(valid, () => cxt.reset()) + + function validateItemsWithCount(): void { + const schValid = gen.name("_valid") + const count = gen.let("count", 0) + validateItems(schValid, () => gen.if(schValid, () => checkLimits(count))) + } + + function validateItems(_valid: Name, block: () => void): void { + gen.forRange("i", 0, len, (i) => { + cxt.subschema( + { + keyword: "contains", + dataProp: i, + dataPropType: Type.Num, + compositeRule: true, + }, + _valid + ) + block() + }) + } + + function checkLimits(count: Name): void { + gen.code(_`${count}++`) + if (max === undefined) { + gen.if(_`${count} >= ${min}`, () => gen.assign(valid, true).break()) + } else { + gen.if(_`${count} > ${max}`, () => gen.assign(valid, false).break()) + if (min === 1) gen.assign(valid, true) + else gen.if(_`${count} >= ${min}`, () => gen.assign(valid, true)) + } + } + }, +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/dependencies.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/dependencies.ts new file mode 100644 index 0000000000..f676112869 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/dependencies.ts @@ -0,0 +1,112 @@ +import type { + CodeKeywordDefinition, + ErrorObject, + KeywordErrorDefinition, + SchemaMap, + AnySchema, +} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, str} from "../../compile/codegen" +import {alwaysValidSchema} from "../../compile/util" +import {checkReportMissingProp, checkMissingProp, reportMissingProp, propertyInData} from "../code" + +export type PropertyDependencies = {[K in string]?: string[]} + +export interface DependenciesErrorParams { + property: string + missingProperty: string + depsCount: number + deps: string // TODO change to string[] +} + +type SchemaDependencies = SchemaMap + +export type DependenciesError = ErrorObject< + "dependencies", + DependenciesErrorParams, + {[K in string]?: string[] | AnySchema} +> + +export const error: KeywordErrorDefinition = { + message: ({params: {property, depsCount, deps}}) => { + const property_ies = depsCount === 1 ? "property" : "properties" + return str`must have ${property_ies} ${deps} when property ${property} is present` + }, + params: ({params: {property, depsCount, deps, missingProperty}}) => + _`{property: ${property}, + missingProperty: ${missingProperty}, + depsCount: ${depsCount}, + deps: ${deps}}`, // TODO change to reference +} + +const def: CodeKeywordDefinition = { + keyword: "dependencies", + type: "object", + schemaType: "object", + error, + code(cxt: KeywordCxt) { + const [propDeps, schDeps] = splitDependencies(cxt) + validatePropertyDeps(cxt, propDeps) + validateSchemaDeps(cxt, schDeps) + }, +} + +function splitDependencies({schema}: KeywordCxt): [PropertyDependencies, SchemaDependencies] { + const propertyDeps: PropertyDependencies = {} + const schemaDeps: SchemaDependencies = {} + for (const key in schema) { + if (key === "__proto__") continue + const deps = Array.isArray(schema[key]) ? propertyDeps : schemaDeps + deps[key] = schema[key] + } + return [propertyDeps, schemaDeps] +} + +export function validatePropertyDeps( + cxt: KeywordCxt, + propertyDeps: {[K in string]?: string[]} = cxt.schema +): void { + const {gen, data, it} = cxt + if (Object.keys(propertyDeps).length === 0) return + const missing = gen.let("missing") + for (const prop in propertyDeps) { + const deps = propertyDeps[prop] as string[] + if (deps.length === 0) continue + const hasProperty = propertyInData(gen, data, prop, it.opts.ownProperties) + cxt.setParams({ + property: prop, + depsCount: deps.length, + deps: deps.join(", "), + }) + if (it.allErrors) { + gen.if(hasProperty, () => { + for (const depProp of deps) { + checkReportMissingProp(cxt, depProp) + } + }) + } else { + gen.if(_`${hasProperty} && (${checkMissingProp(cxt, deps, missing)})`) + reportMissingProp(cxt, missing) + gen.else() + } + } +} + +export function validateSchemaDeps(cxt: KeywordCxt, schemaDeps: SchemaMap = cxt.schema): void { + const {gen, data, keyword, it} = cxt + const valid = gen.name("valid") + for (const prop in schemaDeps) { + if (alwaysValidSchema(it, schemaDeps[prop] as AnySchema)) continue + gen.if( + propertyInData(gen, data, prop, it.opts.ownProperties), + () => { + const schCxt = cxt.subschema({keyword, schemaProp: prop}, valid) + cxt.mergeValidEvaluated(schCxt, valid) + }, + () => gen.var(valid, true) // TODO var + ) + cxt.ok(valid) + } +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/dependentSchemas.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/dependentSchemas.ts new file mode 100644 index 0000000000..dbd3ae45c3 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/dependentSchemas.ts @@ -0,0 +1,11 @@ +import type {CodeKeywordDefinition} from "../../types" +import {validateSchemaDeps} from "./dependencies" + +const def: CodeKeywordDefinition = { + keyword: "dependentSchemas", + type: "object", + schemaType: "object", + code: (cxt) => validateSchemaDeps(cxt), +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/if.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/if.ts new file mode 100644 index 0000000000..5a40d5e3ad --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/if.ts @@ -0,0 +1,80 @@ +import type { + CodeKeywordDefinition, + ErrorObject, + KeywordErrorDefinition, + AnySchema, +} from "../../types" +import type {SchemaObjCxt} from "../../compile" +import type {KeywordCxt} from "../../compile/validate" +import {_, str, not, Name} from "../../compile/codegen" +import {alwaysValidSchema, checkStrictMode} from "../../compile/util" + +export type IfKeywordError = ErrorObject<"if", {failingKeyword: string}, AnySchema> + +const error: KeywordErrorDefinition = { + message: ({params}) => str`must match "${params.ifClause}" schema`, + params: ({params}) => _`{failingKeyword: ${params.ifClause}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "if", + schemaType: ["object", "boolean"], + trackErrors: true, + error, + code(cxt: KeywordCxt) { + const {gen, parentSchema, it} = cxt + if (parentSchema.then === undefined && parentSchema.else === undefined) { + checkStrictMode(it, '"if" without "then" and "else" is ignored') + } + const hasThen = hasSchema(it, "then") + const hasElse = hasSchema(it, "else") + if (!hasThen && !hasElse) return + + const valid = gen.let("valid", true) + const schValid = gen.name("_valid") + validateIf() + cxt.reset() + + if (hasThen && hasElse) { + const ifClause = gen.let("ifClause") + cxt.setParams({ifClause}) + gen.if(schValid, validateClause("then", ifClause), validateClause("else", ifClause)) + } else if (hasThen) { + gen.if(schValid, validateClause("then")) + } else { + gen.if(not(schValid), validateClause("else")) + } + + cxt.pass(valid, () => cxt.error(true)) + + function validateIf(): void { + const schCxt = cxt.subschema( + { + keyword: "if", + compositeRule: true, + createErrors: false, + allErrors: false, + }, + schValid + ) + cxt.mergeEvaluated(schCxt) + } + + function validateClause(keyword: string, ifClause?: Name): () => void { + return () => { + const schCxt = cxt.subschema({keyword}, schValid) + gen.assign(valid, schValid) + cxt.mergeValidEvaluated(schCxt, valid) + if (ifClause) gen.assign(ifClause, _`${keyword}`) + else cxt.setParams({ifClause: keyword}) + } + } + }, +} + +function hasSchema(it: SchemaObjCxt, keyword: string): boolean { + const schema = it.schema[keyword] + return schema !== undefined && !alwaysValidSchema(it, schema) +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/index.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/index.ts new file mode 100644 index 0000000000..fc52716996 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/index.ts @@ -0,0 +1,53 @@ +import type {ErrorNoParams, Vocabulary} from "../../types" +import additionalItems, {AdditionalItemsError} from "./additionalItems" +import prefixItems from "./prefixItems" +import items from "./items" +import items2020, {ItemsError} from "./items2020" +import contains, {ContainsError} from "./contains" +import dependencies, {DependenciesError} from "./dependencies" +import propertyNames, {PropertyNamesError} from "./propertyNames" +import additionalProperties, {AdditionalPropertiesError} from "./additionalProperties" +import properties from "./properties" +import patternProperties from "./patternProperties" +import notKeyword, {NotKeywordError} from "./not" +import anyOf, {AnyOfError} from "./anyOf" +import oneOf, {OneOfError} from "./oneOf" +import allOf from "./allOf" +import ifKeyword, {IfKeywordError} from "./if" +import thenElse from "./thenElse" + +export default function getApplicator(draft2020 = false): Vocabulary { + const applicator = [ + // any + notKeyword, + anyOf, + oneOf, + allOf, + ifKeyword, + thenElse, + // object + propertyNames, + additionalProperties, + dependencies, + properties, + patternProperties, + ] + // array + if (draft2020) applicator.push(prefixItems, items2020) + else applicator.push(additionalItems, items) + applicator.push(contains) + return applicator +} + +export type ApplicatorKeywordError = + | ErrorNoParams<"false schema"> + | AdditionalItemsError + | ItemsError + | ContainsError + | AdditionalPropertiesError + | DependenciesError + | IfKeywordError + | AnyOfError + | OneOfError + | NotKeywordError + | PropertyNamesError diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/items.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/items.ts new file mode 100644 index 0000000000..033cb39773 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/items.ts @@ -0,0 +1,59 @@ +import type {CodeKeywordDefinition, AnySchema, AnySchemaObject} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_} from "../../compile/codegen" +import {alwaysValidSchema, mergeEvaluated, checkStrictMode} from "../../compile/util" +import {validateArray} from "../code" + +const def: CodeKeywordDefinition = { + keyword: "items", + type: "array", + schemaType: ["object", "array", "boolean"], + before: "uniqueItems", + code(cxt: KeywordCxt) { + const {schema, it} = cxt + if (Array.isArray(schema)) return validateTuple(cxt, "additionalItems", schema) + it.items = true + if (alwaysValidSchema(it, schema)) return + cxt.ok(validateArray(cxt)) + }, +} + +export function validateTuple( + cxt: KeywordCxt, + extraItems: string, + schArr: AnySchema[] = cxt.schema +): void { + const {gen, parentSchema, data, keyword, it} = cxt + checkStrictTuple(parentSchema) + if (it.opts.unevaluated && schArr.length && it.items !== true) { + it.items = mergeEvaluated.items(gen, schArr.length, it.items) + } + const valid = gen.name("valid") + const len = gen.const("len", _`${data}.length`) + schArr.forEach((sch: AnySchema, i: number) => { + if (alwaysValidSchema(it, sch)) return + gen.if(_`${len} > ${i}`, () => + cxt.subschema( + { + keyword, + schemaProp: i, + dataProp: i, + }, + valid + ) + ) + cxt.ok(valid) + }) + + function checkStrictTuple(sch: AnySchemaObject): void { + const {opts, errSchemaPath} = it + const l = schArr.length + const fullTuple = l === sch.minItems && (l === sch.maxItems || sch[extraItems] === false) + if (opts.strictTuples && !fullTuple) { + const msg = `"${keyword}" is ${l}-tuple, but minItems or maxItems/${extraItems} are not specified or different at path "${errSchemaPath}"` + checkStrictMode(it, msg, opts.strictTuples) + } + } +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/items2020.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/items2020.ts new file mode 100644 index 0000000000..2a99b08d59 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/items2020.ts @@ -0,0 +1,36 @@ +import type { + CodeKeywordDefinition, + KeywordErrorDefinition, + ErrorObject, + AnySchema, +} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, str} from "../../compile/codegen" +import {alwaysValidSchema} from "../../compile/util" +import {validateArray} from "../code" +import {validateAdditionalItems} from "./additionalItems" + +export type ItemsError = ErrorObject<"items", {limit: number}, AnySchema> + +const error: KeywordErrorDefinition = { + message: ({params: {len}}) => str`must NOT have more than ${len} items`, + params: ({params: {len}}) => _`{limit: ${len}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "items", + type: "array", + schemaType: ["object", "boolean"], + before: "uniqueItems", + error, + code(cxt: KeywordCxt) { + const {schema, parentSchema, it} = cxt + const {prefixItems} = parentSchema + it.items = true + if (alwaysValidSchema(it, schema)) return + if (prefixItems) validateAdditionalItems(cxt, prefixItems) + else cxt.ok(validateArray(cxt)) + }, +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/not.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/not.ts new file mode 100644 index 0000000000..8691db0bf2 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/not.ts @@ -0,0 +1,38 @@ +import type {CodeKeywordDefinition, ErrorNoParams, AnySchema} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {alwaysValidSchema} from "../../compile/util" + +export type NotKeywordError = ErrorNoParams<"not", AnySchema> + +const def: CodeKeywordDefinition = { + keyword: "not", + schemaType: ["object", "boolean"], + trackErrors: true, + code(cxt: KeywordCxt) { + const {gen, schema, it} = cxt + if (alwaysValidSchema(it, schema)) { + cxt.fail() + return + } + + const valid = gen.name("valid") + cxt.subschema( + { + keyword: "not", + compositeRule: true, + createErrors: false, + allErrors: false, + }, + valid + ) + + cxt.failResult( + valid, + () => cxt.reset(), + () => cxt.error() + ) + }, + error: {message: "must NOT be valid"}, +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/oneOf.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/oneOf.ts new file mode 100644 index 0000000000..c25353ffd6 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/oneOf.ts @@ -0,0 +1,82 @@ +import type { + CodeKeywordDefinition, + ErrorObject, + KeywordErrorDefinition, + AnySchema, +} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, Name} from "../../compile/codegen" +import {alwaysValidSchema} from "../../compile/util" +import {SchemaCxt} from "../../compile" + +export type OneOfError = ErrorObject< + "oneOf", + {passingSchemas: [number, number] | null}, + AnySchema[] +> + +const error: KeywordErrorDefinition = { + message: "must match exactly one schema in oneOf", + params: ({params}) => _`{passingSchemas: ${params.passing}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "oneOf", + schemaType: "array", + trackErrors: true, + error, + code(cxt: KeywordCxt) { + const {gen, schema, parentSchema, it} = cxt + /* istanbul ignore if */ + if (!Array.isArray(schema)) throw new Error("ajv implementation error") + if (it.opts.discriminator && parentSchema.discriminator) return + const schArr: AnySchema[] = schema + const valid = gen.let("valid", false) + const passing = gen.let("passing", null) + const schValid = gen.name("_valid") + cxt.setParams({passing}) + // TODO possibly fail straight away (with warning or exception) if there are two empty always valid schemas + + gen.block(validateOneOf) + + cxt.result( + valid, + () => cxt.reset(), + () => cxt.error(true) + ) + + function validateOneOf(): void { + schArr.forEach((sch: AnySchema, i: number) => { + let schCxt: SchemaCxt | undefined + if (alwaysValidSchema(it, sch)) { + gen.var(schValid, true) + } else { + schCxt = cxt.subschema( + { + keyword: "oneOf", + schemaProp: i, + compositeRule: true, + }, + schValid + ) + } + + if (i > 0) { + gen + .if(_`${schValid} && ${valid}`) + .assign(valid, false) + .assign(passing, _`[${passing}, ${i}]`) + .else() + } + + gen.if(schValid, () => { + gen.assign(valid, true) + gen.assign(passing, i) + if (schCxt) cxt.mergeEvaluated(schCxt, Name) + }) + }) + } + }, +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/patternProperties.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/patternProperties.ts new file mode 100644 index 0000000000..ea624e230d --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/patternProperties.ts @@ -0,0 +1,91 @@ +import type {CodeKeywordDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {allSchemaProperties, usePattern} from "../code" +import {_, not, Name} from "../../compile/codegen" +import {alwaysValidSchema, checkStrictMode} from "../../compile/util" +import {evaluatedPropsToName, Type} from "../../compile/util" +import {AnySchema} from "../../types" + +const def: CodeKeywordDefinition = { + keyword: "patternProperties", + type: "object", + schemaType: "object", + code(cxt: KeywordCxt) { + const {gen, schema, data, parentSchema, it} = cxt + const {opts} = it + const patterns = allSchemaProperties(schema) + const alwaysValidPatterns = patterns.filter((p) => + alwaysValidSchema(it, schema[p] as AnySchema) + ) + + if ( + patterns.length === 0 || + (alwaysValidPatterns.length === patterns.length && + (!it.opts.unevaluated || it.props === true)) + ) { + return + } + + const checkProperties = + opts.strictSchema && !opts.allowMatchingProperties && parentSchema.properties + const valid = gen.name("valid") + if (it.props !== true && !(it.props instanceof Name)) { + it.props = evaluatedPropsToName(gen, it.props) + } + const {props} = it + validatePatternProperties() + + function validatePatternProperties(): void { + for (const pat of patterns) { + if (checkProperties) checkMatchingProperties(pat) + if (it.allErrors) { + validateProperties(pat) + } else { + gen.var(valid, true) // TODO var + validateProperties(pat) + gen.if(valid) + } + } + } + + function checkMatchingProperties(pat: string): void { + for (const prop in checkProperties) { + if (new RegExp(pat).test(prop)) { + checkStrictMode( + it, + `property ${prop} matches pattern ${pat} (use allowMatchingProperties)` + ) + } + } + } + + function validateProperties(pat: string): void { + gen.forIn("key", data, (key) => { + gen.if(_`${usePattern(cxt, pat)}.test(${key})`, () => { + const alwaysValid = alwaysValidPatterns.includes(pat) + if (!alwaysValid) { + cxt.subschema( + { + keyword: "patternProperties", + schemaProp: pat, + dataProp: key, + dataPropType: Type.Str, + }, + valid + ) + } + + if (it.opts.unevaluated && props !== true) { + gen.assign(_`${props}[${key}]`, true) + } else if (!alwaysValid && !it.allErrors) { + // can short-circuit if `unevaluatedProperties` is not supported (opts.next === false) + // or if all properties were evaluated (props === true) + gen.if(not(valid), () => gen.break()) + } + }) + }) + } + }, +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/prefixItems.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/prefixItems.ts new file mode 100644 index 0000000000..008fb2db1d --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/prefixItems.ts @@ -0,0 +1,12 @@ +import type {CodeKeywordDefinition} from "../../types" +import {validateTuple} from "./items" + +const def: CodeKeywordDefinition = { + keyword: "prefixItems", + type: "array", + schemaType: ["array"], + before: "uniqueItems", + code: (cxt) => validateTuple(cxt, "items"), +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/properties.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/properties.ts new file mode 100644 index 0000000000..a55b19ce5b --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/properties.ts @@ -0,0 +1,57 @@ +import type {CodeKeywordDefinition} from "../../types" +import {KeywordCxt} from "../../compile/validate" +import {propertyInData, allSchemaProperties} from "../code" +import {alwaysValidSchema, toHash, mergeEvaluated} from "../../compile/util" +import apDef from "./additionalProperties" + +const def: CodeKeywordDefinition = { + keyword: "properties", + type: "object", + schemaType: "object", + code(cxt: KeywordCxt) { + const {gen, schema, parentSchema, data, it} = cxt + if (it.opts.removeAdditional === "all" && parentSchema.additionalProperties === undefined) { + apDef.code(new KeywordCxt(it, apDef, "additionalProperties")) + } + const allProps = allSchemaProperties(schema) + for (const prop of allProps) { + it.definedProperties.add(prop) + } + if (it.opts.unevaluated && allProps.length && it.props !== true) { + it.props = mergeEvaluated.props(gen, toHash(allProps), it.props) + } + const properties = allProps.filter((p) => !alwaysValidSchema(it, schema[p])) + if (properties.length === 0) return + const valid = gen.name("valid") + + for (const prop of properties) { + if (hasDefault(prop)) { + applyPropertySchema(prop) + } else { + gen.if(propertyInData(gen, data, prop, it.opts.ownProperties)) + applyPropertySchema(prop) + if (!it.allErrors) gen.else().var(valid, true) + gen.endIf() + } + cxt.it.definedProperties.add(prop) + cxt.ok(valid) + } + + function hasDefault(prop: string): boolean | undefined { + return it.opts.useDefaults && !it.compositeRule && schema[prop].default !== undefined + } + + function applyPropertySchema(prop: string): void { + cxt.subschema( + { + keyword: "properties", + schemaProp: prop, + dataProp: prop, + }, + valid + ) + } + }, +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/propertyNames.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/propertyNames.ts new file mode 100644 index 0000000000..1c54d60525 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/propertyNames.ts @@ -0,0 +1,50 @@ +import type { + CodeKeywordDefinition, + ErrorObject, + KeywordErrorDefinition, + AnySchema, +} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, not} from "../../compile/codegen" +import {alwaysValidSchema} from "../../compile/util" + +export type PropertyNamesError = ErrorObject<"propertyNames", {propertyName: string}, AnySchema> + +const error: KeywordErrorDefinition = { + message: "property name must be valid", + params: ({params}) => _`{propertyName: ${params.propertyName}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "propertyNames", + type: "object", + schemaType: ["object", "boolean"], + error, + code(cxt: KeywordCxt) { + const {gen, schema, data, it} = cxt + if (alwaysValidSchema(it, schema)) return + const valid = gen.name("valid") + + gen.forIn("key", data, (key) => { + cxt.setParams({propertyName: key}) + cxt.subschema( + { + keyword: "propertyNames", + data: key, + dataTypes: ["string"], + propertyName: key, + compositeRule: true, + }, + valid + ) + gen.if(not(valid), () => { + cxt.error(true) + if (!it.allErrors) gen.break() + }) + }) + + cxt.ok(valid) + }, +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/thenElse.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/thenElse.ts new file mode 100644 index 0000000000..5055182e89 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/applicator/thenElse.ts @@ -0,0 +1,13 @@ +import type {CodeKeywordDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {checkStrictMode} from "../../compile/util" + +const def: CodeKeywordDefinition = { + keyword: ["then", "else"], + schemaType: ["object", "boolean"], + code({keyword, parentSchema, it}: KeywordCxt) { + if (parentSchema.if === undefined) checkStrictMode(it, `"${keyword}" without "if" is ignored`) + }, +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/code.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/code.ts new file mode 100644 index 0000000000..92cdd5b04e --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/code.ts @@ -0,0 +1,168 @@ +import type {AnySchema, SchemaMap} from "../types" +import type {SchemaCxt} from "../compile" +import type {KeywordCxt} from "../compile/validate" +import {CodeGen, _, and, or, not, nil, strConcat, getProperty, Code, Name} from "../compile/codegen" +import {alwaysValidSchema, Type} from "../compile/util" +import N from "../compile/names" +import {useFunc} from "../compile/util" +export function checkReportMissingProp(cxt: KeywordCxt, prop: string): void { + const {gen, data, it} = cxt + gen.if(noPropertyInData(gen, data, prop, it.opts.ownProperties), () => { + cxt.setParams({missingProperty: _`${prop}`}, true) + cxt.error() + }) +} + +export function checkMissingProp( + {gen, data, it: {opts}}: KeywordCxt, + properties: string[], + missing: Name +): Code { + return or( + ...properties.map((prop) => + and(noPropertyInData(gen, data, prop, opts.ownProperties), _`${missing} = ${prop}`) + ) + ) +} + +export function reportMissingProp(cxt: KeywordCxt, missing: Name): void { + cxt.setParams({missingProperty: missing}, true) + cxt.error() +} + +export function hasPropFunc(gen: CodeGen): Name { + return gen.scopeValue("func", { + // eslint-disable-next-line @typescript-eslint/unbound-method + ref: Object.prototype.hasOwnProperty, + code: _`Object.prototype.hasOwnProperty`, + }) +} + +export function isOwnProperty(gen: CodeGen, data: Name, property: Name | string): Code { + return _`${hasPropFunc(gen)}.call(${data}, ${property})` +} + +export function propertyInData( + gen: CodeGen, + data: Name, + property: Name | string, + ownProperties?: boolean +): Code { + const cond = _`${data}${getProperty(property)} !== undefined` + return ownProperties ? _`${cond} && ${isOwnProperty(gen, data, property)}` : cond +} + +export function noPropertyInData( + gen: CodeGen, + data: Name, + property: Name | string, + ownProperties?: boolean +): Code { + const cond = _`${data}${getProperty(property)} === undefined` + return ownProperties ? or(cond, not(isOwnProperty(gen, data, property))) : cond +} + +export function allSchemaProperties(schemaMap?: SchemaMap): string[] { + return schemaMap ? Object.keys(schemaMap).filter((p) => p !== "__proto__") : [] +} + +export function schemaProperties(it: SchemaCxt, schemaMap: SchemaMap): string[] { + return allSchemaProperties(schemaMap).filter( + (p) => !alwaysValidSchema(it, schemaMap[p] as AnySchema) + ) +} + +export function callValidateCode( + {schemaCode, data, it: {gen, topSchemaRef, schemaPath, errorPath}, it}: KeywordCxt, + func: Code, + context: Code, + passSchema?: boolean +): Code { + const dataAndSchema = passSchema ? _`${schemaCode}, ${data}, ${topSchemaRef}${schemaPath}` : data + const valCxt: [Name, Code | number][] = [ + [N.instancePath, strConcat(N.instancePath, errorPath)], + [N.parentData, it.parentData], + [N.parentDataProperty, it.parentDataProperty], + [N.rootData, N.rootData], + ] + if (it.opts.dynamicRef) valCxt.push([N.dynamicAnchors, N.dynamicAnchors]) + const args = _`${dataAndSchema}, ${gen.object(...valCxt)}` + return context !== nil ? _`${func}.call(${context}, ${args})` : _`${func}(${args})` +} + +const newRegExp = _`new RegExp` + +export function usePattern({gen, it: {opts}}: KeywordCxt, pattern: string): Name { + const u = opts.unicodeRegExp ? "u" : "" + const {regExp} = opts.code + const rx = regExp(pattern, u) + + return gen.scopeValue("pattern", { + key: rx.toString(), + ref: rx, + code: _`${regExp.code === "new RegExp" ? newRegExp : useFunc(gen, regExp)}(${pattern}, ${u})`, + }) +} + +export function validateArray(cxt: KeywordCxt): Name { + const {gen, data, keyword, it} = cxt + const valid = gen.name("valid") + if (it.allErrors) { + const validArr = gen.let("valid", true) + validateItems(() => gen.assign(validArr, false)) + return validArr + } + gen.var(valid, true) + validateItems(() => gen.break()) + return valid + + function validateItems(notValid: () => void): void { + const len = gen.const("len", _`${data}.length`) + gen.forRange("i", 0, len, (i) => { + cxt.subschema( + { + keyword, + dataProp: i, + dataPropType: Type.Num, + }, + valid + ) + gen.if(not(valid), notValid) + }) + } +} + +export function validateUnion(cxt: KeywordCxt): void { + const {gen, schema, keyword, it} = cxt + /* istanbul ignore if */ + if (!Array.isArray(schema)) throw new Error("ajv implementation error") + const alwaysValid = schema.some((sch: AnySchema) => alwaysValidSchema(it, sch)) + if (alwaysValid && !it.opts.unevaluated) return + + const valid = gen.let("valid", false) + const schValid = gen.name("_valid") + + gen.block(() => + schema.forEach((_sch: AnySchema, i: number) => { + const schCxt = cxt.subschema( + { + keyword, + schemaProp: i, + compositeRule: true, + }, + schValid + ) + gen.assign(valid, _`${valid} || ${schValid}`) + const merged = cxt.mergeValidEvaluated(schCxt, schValid) + // can short-circuit if `unevaluatedProperties/Items` not supported (opts.unevaluated !== true) + // or if all properties and items were evaluated (it.props === true && it.items === true) + if (!merged) gen.if(not(valid)) + }) + ) + + cxt.result( + valid, + () => cxt.reset(), + () => cxt.error(true) + ) +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/core/id.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/core/id.ts new file mode 100644 index 0000000000..aa36c4bb20 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/core/id.ts @@ -0,0 +1,10 @@ +import type {CodeKeywordDefinition} from "../../types" + +const def: CodeKeywordDefinition = { + keyword: "id", + code() { + throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID') + }, +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/core/index.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/core/index.ts new file mode 100644 index 0000000000..e63e2895d0 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/core/index.ts @@ -0,0 +1,16 @@ +import type {Vocabulary} from "../../types" +import idKeyword from "./id" +import refKeyword from "./ref" + +const core: Vocabulary = [ + "$schema", + "$id", + "$defs", + "$vocabulary", + {keyword: "$comment"}, + "definitions", + idKeyword, + refKeyword, +] + +export default core diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/core/ref.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/core/ref.ts new file mode 100644 index 0000000000..5d59fbcb2a --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/core/ref.ts @@ -0,0 +1,129 @@ +import type {CodeKeywordDefinition, AnySchema} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import MissingRefError from "../../compile/ref_error" +import {callValidateCode} from "../code" +import {_, nil, stringify, Code, Name} from "../../compile/codegen" +import N from "../../compile/names" +import {SchemaEnv, resolveRef} from "../../compile" +import {mergeEvaluated} from "../../compile/util" + +const def: CodeKeywordDefinition = { + keyword: "$ref", + schemaType: "string", + code(cxt: KeywordCxt): void { + const {gen, schema: $ref, it} = cxt + const {baseId, schemaEnv: env, validateName, opts, self} = it + const {root} = env + if (($ref === "#" || $ref === "#/") && baseId === root.baseId) return callRootRef() + const schOrEnv = resolveRef.call(self, root, baseId, $ref) + if (schOrEnv === undefined) throw new MissingRefError(it.opts.uriResolver, baseId, $ref) + if (schOrEnv instanceof SchemaEnv) return callValidate(schOrEnv) + return inlineRefSchema(schOrEnv) + + function callRootRef(): void { + if (env === root) return callRef(cxt, validateName, env, env.$async) + const rootName = gen.scopeValue("root", {ref: root}) + return callRef(cxt, _`${rootName}.validate`, root, root.$async) + } + + function callValidate(sch: SchemaEnv): void { + const v = getValidate(cxt, sch) + callRef(cxt, v, sch, sch.$async) + } + + function inlineRefSchema(sch: AnySchema): void { + const schName = gen.scopeValue( + "schema", + opts.code.source === true ? {ref: sch, code: stringify(sch)} : {ref: sch} + ) + const valid = gen.name("valid") + const schCxt = cxt.subschema( + { + schema: sch, + dataTypes: [], + schemaPath: nil, + topSchemaRef: schName, + errSchemaPath: $ref, + }, + valid + ) + cxt.mergeEvaluated(schCxt) + cxt.ok(valid) + } + }, +} + +export function getValidate(cxt: KeywordCxt, sch: SchemaEnv): Code { + const {gen} = cxt + return sch.validate + ? gen.scopeValue("validate", {ref: sch.validate}) + : _`${gen.scopeValue("wrapper", {ref: sch})}.validate` +} + +export function callRef(cxt: KeywordCxt, v: Code, sch?: SchemaEnv, $async?: boolean): void { + const {gen, it} = cxt + const {allErrors, schemaEnv: env, opts} = it + const passCxt = opts.passContext ? N.this : nil + if ($async) callAsyncRef() + else callSyncRef() + + function callAsyncRef(): void { + if (!env.$async) throw new Error("async schema referenced by sync schema") + const valid = gen.let("valid") + gen.try( + () => { + gen.code(_`await ${callValidateCode(cxt, v, passCxt)}`) + addEvaluatedFrom(v) // TODO will not work with async, it has to be returned with the result + if (!allErrors) gen.assign(valid, true) + }, + (e) => { + gen.if(_`!(${e} instanceof ${it.ValidationError as Name})`, () => gen.throw(e)) + addErrorsFrom(e) + if (!allErrors) gen.assign(valid, false) + } + ) + cxt.ok(valid) + } + + function callSyncRef(): void { + cxt.result( + callValidateCode(cxt, v, passCxt), + () => addEvaluatedFrom(v), + () => addErrorsFrom(v) + ) + } + + function addErrorsFrom(source: Code): void { + const errs = _`${source}.errors` + gen.assign(N.vErrors, _`${N.vErrors} === null ? ${errs} : ${N.vErrors}.concat(${errs})`) // TODO tagged + gen.assign(N.errors, _`${N.vErrors}.length`) + } + + function addEvaluatedFrom(source: Code): void { + if (!it.opts.unevaluated) return + const schEvaluated = sch?.validate?.evaluated + // TODO refactor + if (it.props !== true) { + if (schEvaluated && !schEvaluated.dynamicProps) { + if (schEvaluated.props !== undefined) { + it.props = mergeEvaluated.props(gen, schEvaluated.props, it.props) + } + } else { + const props = gen.var("props", _`${source}.evaluated.props`) + it.props = mergeEvaluated.props(gen, props, it.props, Name) + } + } + if (it.items !== true) { + if (schEvaluated && !schEvaluated.dynamicItems) { + if (schEvaluated.items !== undefined) { + it.items = mergeEvaluated.items(gen, schEvaluated.items, it.items) + } + } else { + const items = gen.var("items", _`${source}.evaluated.items`) + it.items = mergeEvaluated.items(gen, items, it.items, Name) + } + } + } +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/discriminator/index.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/discriminator/index.ts new file mode 100644 index 0000000000..19ae6049f3 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/discriminator/index.ts @@ -0,0 +1,113 @@ +import type {CodeKeywordDefinition, AnySchemaObject, KeywordErrorDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, getProperty, Name} from "../../compile/codegen" +import {DiscrError, DiscrErrorObj} from "../discriminator/types" +import {resolveRef, SchemaEnv} from "../../compile" +import MissingRefError from "../../compile/ref_error" +import {schemaHasRulesButRef} from "../../compile/util" + +export type DiscriminatorError = DiscrErrorObj | DiscrErrorObj + +const error: KeywordErrorDefinition = { + message: ({params: {discrError, tagName}}) => + discrError === DiscrError.Tag + ? `tag "${tagName}" must be string` + : `value of tag "${tagName}" must be in oneOf`, + params: ({params: {discrError, tag, tagName}}) => + _`{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "discriminator", + type: "object", + schemaType: "object", + error, + code(cxt: KeywordCxt) { + const {gen, data, schema, parentSchema, it} = cxt + const {oneOf} = parentSchema + if (!it.opts.discriminator) { + throw new Error("discriminator: requires discriminator option") + } + const tagName = schema.propertyName + if (typeof tagName != "string") throw new Error("discriminator: requires propertyName") + if (schema.mapping) throw new Error("discriminator: mapping is not supported") + if (!oneOf) throw new Error("discriminator: requires oneOf keyword") + const valid = gen.let("valid", false) + const tag = gen.const("tag", _`${data}${getProperty(tagName)}`) + gen.if( + _`typeof ${tag} == "string"`, + () => validateMapping(), + () => cxt.error(false, {discrError: DiscrError.Tag, tag, tagName}) + ) + cxt.ok(valid) + + function validateMapping(): void { + const mapping = getMapping() + gen.if(false) + for (const tagValue in mapping) { + gen.elseIf(_`${tag} === ${tagValue}`) + gen.assign(valid, applyTagSchema(mapping[tagValue])) + } + gen.else() + cxt.error(false, {discrError: DiscrError.Mapping, tag, tagName}) + gen.endIf() + } + + function applyTagSchema(schemaProp?: number): Name { + const _valid = gen.name("valid") + const schCxt = cxt.subschema({keyword: "oneOf", schemaProp}, _valid) + cxt.mergeEvaluated(schCxt, Name) + return _valid + } + + function getMapping(): {[T in string]?: number} { + const oneOfMapping: {[T in string]?: number} = {} + const topRequired = hasRequired(parentSchema) + let tagRequired = true + for (let i = 0; i < oneOf.length; i++) { + let sch = oneOf[i] + if (sch?.$ref && !schemaHasRulesButRef(sch, it.self.RULES)) { + const ref = sch.$ref + sch = resolveRef.call(it.self, it.schemaEnv.root, it.baseId, ref) + if (sch instanceof SchemaEnv) sch = sch.schema + if (sch === undefined) throw new MissingRefError(it.opts.uriResolver, it.baseId, ref) + } + const propSch = sch?.properties?.[tagName] + if (typeof propSch != "object") { + throw new Error( + `discriminator: oneOf subschemas (or referenced schemas) must have "properties/${tagName}"` + ) + } + tagRequired = tagRequired && (topRequired || hasRequired(sch)) + addMappings(propSch, i) + } + if (!tagRequired) throw new Error(`discriminator: "${tagName}" must be required`) + return oneOfMapping + + function hasRequired({required}: AnySchemaObject): boolean { + return Array.isArray(required) && required.includes(tagName) + } + + function addMappings(sch: AnySchemaObject, i: number): void { + if (sch.const) { + addMapping(sch.const, i) + } else if (sch.enum) { + for (const tagValue of sch.enum) { + addMapping(tagValue, i) + } + } else { + throw new Error(`discriminator: "properties/${tagName}" must have "const" or "enum"`) + } + } + + function addMapping(tagValue: unknown, i: number): void { + if (typeof tagValue != "string" || tagValue in oneOfMapping) { + throw new Error(`discriminator: "${tagName}" values must be unique strings`) + } + oneOfMapping[tagValue] = i + } + } + }, +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/discriminator/types.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/discriminator/types.ts new file mode 100644 index 0000000000..bee5a27850 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/discriminator/types.ts @@ -0,0 +1,12 @@ +import type {ErrorObject} from "../../types" + +export enum DiscrError { + Tag = "tag", + Mapping = "mapping", +} + +export type DiscrErrorObj = ErrorObject< + "discriminator", + {error: E; tag: string; tagValue: unknown}, + string +> diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/draft2020.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/draft2020.ts new file mode 100644 index 0000000000..47fbf0ee6d --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/draft2020.ts @@ -0,0 +1,23 @@ +import type {Vocabulary} from "../types" +import coreVocabulary from "./core" +import validationVocabulary from "./validation" +import getApplicatorVocabulary from "./applicator" +import dynamicVocabulary from "./dynamic" +import nextVocabulary from "./next" +import unevaluatedVocabulary from "./unevaluated" +import formatVocabulary from "./format" +import {metadataVocabulary, contentVocabulary} from "./metadata" + +const draft2020Vocabularies: Vocabulary[] = [ + dynamicVocabulary, + coreVocabulary, + validationVocabulary, + getApplicatorVocabulary(true), + formatVocabulary, + metadataVocabulary, + contentVocabulary, + nextVocabulary, + unevaluatedVocabulary, +] + +export default draft2020Vocabularies diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/draft7.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/draft7.ts new file mode 100644 index 0000000000..226a644aa4 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/draft7.ts @@ -0,0 +1,17 @@ +import type {Vocabulary} from "../types" +import coreVocabulary from "./core" +import validationVocabulary from "./validation" +import getApplicatorVocabulary from "./applicator" +import formatVocabulary from "./format" +import {metadataVocabulary, contentVocabulary} from "./metadata" + +const draft7Vocabularies: Vocabulary[] = [ + coreVocabulary, + validationVocabulary, + getApplicatorVocabulary(), + formatVocabulary, + metadataVocabulary, + contentVocabulary, +] + +export default draft7Vocabularies diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/dynamic/dynamicAnchor.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/dynamic/dynamicAnchor.ts new file mode 100644 index 0000000000..ca1adb912a --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/dynamic/dynamicAnchor.ts @@ -0,0 +1,31 @@ +import type {CodeKeywordDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, getProperty, Code} from "../../compile/codegen" +import N from "../../compile/names" +import {SchemaEnv, compileSchema} from "../../compile" +import {getValidate} from "../core/ref" + +const def: CodeKeywordDefinition = { + keyword: "$dynamicAnchor", + schemaType: "string", + code: (cxt) => dynamicAnchor(cxt, cxt.schema), +} + +export function dynamicAnchor(cxt: KeywordCxt, anchor: string): void { + const {gen, it} = cxt + it.schemaEnv.root.dynamicAnchors[anchor] = true + const v = _`${N.dynamicAnchors}${getProperty(anchor)}` + const validate = it.errSchemaPath === "#" ? it.validateName : _getValidate(cxt) + gen.if(_`!${v}`, () => gen.assign(v, validate)) +} + +function _getValidate(cxt: KeywordCxt): Code { + const {schemaEnv, schema, self} = cxt.it + const {root, baseId, localRefs, meta} = schemaEnv.root + const {schemaId} = self.opts + const sch = new SchemaEnv({schema, schemaId, root, baseId, localRefs, meta}) + compileSchema.call(self, sch) + return getValidate(cxt, sch) +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/dynamic/dynamicRef.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/dynamic/dynamicRef.ts new file mode 100644 index 0000000000..6a573f3302 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/dynamic/dynamicRef.ts @@ -0,0 +1,51 @@ +import type {CodeKeywordDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, getProperty, Code, Name} from "../../compile/codegen" +import N from "../../compile/names" +import {callRef} from "../core/ref" + +const def: CodeKeywordDefinition = { + keyword: "$dynamicRef", + schemaType: "string", + code: (cxt) => dynamicRef(cxt, cxt.schema), +} + +export function dynamicRef(cxt: KeywordCxt, ref: string): void { + const {gen, keyword, it} = cxt + if (ref[0] !== "#") throw new Error(`"${keyword}" only supports hash fragment reference`) + const anchor = ref.slice(1) + if (it.allErrors) { + _dynamicRef() + } else { + const valid = gen.let("valid", false) + _dynamicRef(valid) + cxt.ok(valid) + } + + function _dynamicRef(valid?: Name): void { + // TODO the assumption here is that `recursiveRef: #` always points to the root + // of the schema object, which is not correct, because there may be $id that + // makes # point to it, and the target schema may not contain dynamic/recursiveAnchor. + // Because of that 2 tests in recursiveRef.json fail. + // This is a similar problem to #815 (`$id` doesn't alter resolution scope for `{ "$ref": "#" }`). + // (This problem is not tested in JSON-Schema-Test-Suite) + if (it.schemaEnv.root.dynamicAnchors[anchor]) { + const v = gen.let("_v", _`${N.dynamicAnchors}${getProperty(anchor)}`) + gen.if(v, _callRef(v, valid), _callRef(it.validateName, valid)) + } else { + _callRef(it.validateName, valid)() + } + } + + function _callRef(validate: Code, valid?: Name): () => void { + return valid + ? () => + gen.block(() => { + callRef(cxt, validate) + gen.let(valid, true) + }) + : () => callRef(cxt, validate) + } +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/dynamic/index.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/dynamic/index.ts new file mode 100644 index 0000000000..6d521db663 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/dynamic/index.ts @@ -0,0 +1,9 @@ +import type {Vocabulary} from "../../types" +import dynamicAnchor from "./dynamicAnchor" +import dynamicRef from "./dynamicRef" +import recursiveAnchor from "./recursiveAnchor" +import recursiveRef from "./recursiveRef" + +const dynamic: Vocabulary = [dynamicAnchor, dynamicRef, recursiveAnchor, recursiveRef] + +export default dynamic diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/dynamic/recursiveAnchor.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/dynamic/recursiveAnchor.ts new file mode 100644 index 0000000000..25f3db96bf --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/dynamic/recursiveAnchor.ts @@ -0,0 +1,14 @@ +import type {CodeKeywordDefinition} from "../../types" +import {dynamicAnchor} from "./dynamicAnchor" +import {checkStrictMode} from "../../compile/util" + +const def: CodeKeywordDefinition = { + keyword: "$recursiveAnchor", + schemaType: "boolean", + code(cxt) { + if (cxt.schema) dynamicAnchor(cxt, "") + else checkStrictMode(cxt.it, "$recursiveAnchor: false is ignored") + }, +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/dynamic/recursiveRef.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/dynamic/recursiveRef.ts new file mode 100644 index 0000000000..c84af0f057 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/dynamic/recursiveRef.ts @@ -0,0 +1,10 @@ +import type {CodeKeywordDefinition} from "../../types" +import {dynamicRef} from "./dynamicRef" + +const def: CodeKeywordDefinition = { + keyword: "$recursiveRef", + schemaType: "string", + code: (cxt) => dynamicRef(cxt, cxt.schema), +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/errors.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/errors.ts new file mode 100644 index 0000000000..c9ca3f02f0 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/errors.ts @@ -0,0 +1,18 @@ +import type {TypeError} from "../compile/validate/dataType" +import type {ApplicatorKeywordError} from "./applicator" +import type {ValidationKeywordError} from "./validation" +import type {FormatError} from "./format/format" +import type {UnevaluatedPropertiesError} from "./unevaluated/unevaluatedProperties" +import type {UnevaluatedItemsError} from "./unevaluated/unevaluatedItems" +import type {DependentRequiredError} from "./validation/dependentRequired" +import type {DiscriminatorError} from "./discriminator" + +export type DefinedError = + | TypeError + | ApplicatorKeywordError + | ValidationKeywordError + | FormatError + | UnevaluatedPropertiesError + | UnevaluatedItemsError + | DependentRequiredError + | DiscriminatorError diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/format/format.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/format/format.ts new file mode 100644 index 0000000000..4b1c13e764 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/format/format.ts @@ -0,0 +1,120 @@ +import type { + AddedFormat, + FormatValidator, + AsyncFormatValidator, + CodeKeywordDefinition, + KeywordErrorDefinition, + ErrorObject, +} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, str, nil, or, Code, getProperty, regexpCode} from "../../compile/codegen" + +type FormatValidate = + | FormatValidator + | FormatValidator + | AsyncFormatValidator + | AsyncFormatValidator + | RegExp + | string + | true + +export type FormatError = ErrorObject<"format", {format: string}, string | {$data: string}> + +const error: KeywordErrorDefinition = { + message: ({schemaCode}) => str`must match format "${schemaCode}"`, + params: ({schemaCode}) => _`{format: ${schemaCode}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "format", + type: ["number", "string"], + schemaType: "string", + $data: true, + error, + code(cxt: KeywordCxt, ruleType?: string) { + const {gen, data, $data, schema, schemaCode, it} = cxt + const {opts, errSchemaPath, schemaEnv, self} = it + if (!opts.validateFormats) return + + if ($data) validate$DataFormat() + else validateFormat() + + function validate$DataFormat(): void { + const fmts = gen.scopeValue("formats", { + ref: self.formats, + code: opts.code.formats, + }) + const fDef = gen.const("fDef", _`${fmts}[${schemaCode}]`) + const fType = gen.let("fType") + const format = gen.let("format") + // TODO simplify + gen.if( + _`typeof ${fDef} == "object" && !(${fDef} instanceof RegExp)`, + () => gen.assign(fType, _`${fDef}.type || "string"`).assign(format, _`${fDef}.validate`), + () => gen.assign(fType, _`"string"`).assign(format, fDef) + ) + cxt.fail$data(or(unknownFmt(), invalidFmt())) + + function unknownFmt(): Code { + if (opts.strictSchema === false) return nil + return _`${schemaCode} && !${format}` + } + + function invalidFmt(): Code { + const callFormat = schemaEnv.$async + ? _`(${fDef}.async ? await ${format}(${data}) : ${format}(${data}))` + : _`${format}(${data})` + const validData = _`(typeof ${format} == "function" ? ${callFormat} : ${format}.test(${data}))` + return _`${format} && ${format} !== true && ${fType} === ${ruleType} && !${validData}` + } + } + + function validateFormat(): void { + const formatDef: AddedFormat | undefined = self.formats[schema] + if (!formatDef) { + unknownFormat() + return + } + if (formatDef === true) return + const [fmtType, format, fmtRef] = getFormat(formatDef) + if (fmtType === ruleType) cxt.pass(validCondition()) + + function unknownFormat(): void { + if (opts.strictSchema === false) { + self.logger.warn(unknownMsg()) + return + } + throw new Error(unknownMsg()) + + function unknownMsg(): string { + return `unknown format "${schema as string}" ignored in schema at path "${errSchemaPath}"` + } + } + + function getFormat(fmtDef: AddedFormat): [string, FormatValidate, Code] { + const code = + fmtDef instanceof RegExp + ? regexpCode(fmtDef) + : opts.code.formats + ? _`${opts.code.formats}${getProperty(schema)}` + : undefined + const fmt = gen.scopeValue("formats", {key: schema, ref: fmtDef, code}) + if (typeof fmtDef == "object" && !(fmtDef instanceof RegExp)) { + return [fmtDef.type || "string", fmtDef.validate, _`${fmt}.validate`] + } + + return ["string", fmtDef, fmt] + } + + function validCondition(): Code { + if (typeof formatDef == "object" && !(formatDef instanceof RegExp) && formatDef.async) { + if (!schemaEnv.$async) throw new Error("async format in sync schema") + return _`await ${fmtRef}(${data})` + } + return typeof format == "function" ? _`${fmtRef}(${data})` : _`${fmtRef}.test(${data})` + } + } + }, +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/format/index.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/format/index.ts new file mode 100644 index 0000000000..bca2f5b3d8 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/format/index.ts @@ -0,0 +1,6 @@ +import type {Vocabulary} from "../../types" +import formatKeyword from "./format" + +const format: Vocabulary = [formatKeyword] + +export default format diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/discriminator.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/discriminator.ts new file mode 100644 index 0000000000..f487c97f84 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/discriminator.ts @@ -0,0 +1,89 @@ +import type {CodeKeywordDefinition, KeywordErrorDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, not, getProperty, Name} from "../../compile/codegen" +import {checkMetadata} from "./metadata" +import {checkNullableObject} from "./nullable" +import {typeErrorMessage, typeErrorParams, _JTDTypeError} from "./error" +import {DiscrError, DiscrErrorObj} from "../discriminator/types" + +export type JTDDiscriminatorError = + | _JTDTypeError<"discriminator", "object", string> + | DiscrErrorObj + | DiscrErrorObj + +const error: KeywordErrorDefinition = { + message: (cxt) => { + const {schema, params} = cxt + return params.discrError + ? params.discrError === DiscrError.Tag + ? `tag "${schema}" must be string` + : `value of tag "${schema}" must be in mapping` + : typeErrorMessage(cxt, "object") + }, + params: (cxt) => { + const {schema, params} = cxt + return params.discrError + ? _`{error: ${params.discrError}, tag: ${schema}, tagValue: ${params.tag}}` + : typeErrorParams(cxt, "object") + }, +} + +const def: CodeKeywordDefinition = { + keyword: "discriminator", + schemaType: "string", + implements: ["mapping"], + error, + code(cxt: KeywordCxt) { + checkMetadata(cxt) + const {gen, data, schema, parentSchema} = cxt + const [valid, cond] = checkNullableObject(cxt, data) + + gen.if(cond) + validateDiscriminator() + gen.elseIf(not(valid)) + cxt.error() + gen.endIf() + cxt.ok(valid) + + function validateDiscriminator(): void { + const tag = gen.const("tag", _`${data}${getProperty(schema)}`) + gen.if(_`${tag} === undefined`) + cxt.error(false, {discrError: DiscrError.Tag, tag}) + gen.elseIf(_`typeof ${tag} == "string"`) + validateMapping(tag) + gen.else() + cxt.error(false, {discrError: DiscrError.Tag, tag}, {instancePath: schema}) + gen.endIf() + } + + function validateMapping(tag: Name): void { + gen.if(false) + for (const tagValue in parentSchema.mapping) { + gen.elseIf(_`${tag} === ${tagValue}`) + gen.assign(valid, applyTagSchema(tagValue)) + } + gen.else() + cxt.error( + false, + {discrError: DiscrError.Mapping, tag}, + {instancePath: schema, schemaPath: "mapping", parentSchema: true} + ) + gen.endIf() + } + + function applyTagSchema(schemaProp: string): Name { + const _valid = gen.name("valid") + cxt.subschema( + { + keyword: "mapping", + schemaProp, + jtdDiscriminator: schema, + }, + _valid + ) + return _valid + } + }, +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/elements.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/elements.ts new file mode 100644 index 0000000000..983af7c027 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/elements.ts @@ -0,0 +1,32 @@ +import type {CodeKeywordDefinition, SchemaObject} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {alwaysValidSchema} from "../../compile/util" +import {validateArray} from "../code" +import {_, not} from "../../compile/codegen" +import {checkMetadata} from "./metadata" +import {checkNullable} from "./nullable" +import {typeError, _JTDTypeError} from "./error" + +export type JTDElementsError = _JTDTypeError<"elements", "array", SchemaObject> + +const def: CodeKeywordDefinition = { + keyword: "elements", + schemaType: "object", + error: typeError("array"), + code(cxt: KeywordCxt) { + checkMetadata(cxt) + const {gen, data, schema, it} = cxt + if (alwaysValidSchema(it, schema)) return + const [valid] = checkNullable(cxt) + gen.if(not(valid), () => + gen.if( + _`Array.isArray(${data})`, + () => gen.assign(valid, validateArray(cxt)), + () => cxt.error() + ) + ) + cxt.ok(valid) + }, +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/enum.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/enum.ts new file mode 100644 index 0000000000..75464ff8e1 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/enum.ts @@ -0,0 +1,45 @@ +import type {CodeKeywordDefinition, KeywordErrorDefinition, ErrorObject} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, or, and, Code} from "../../compile/codegen" +import {checkMetadata} from "./metadata" +import {checkNullable} from "./nullable" + +export type JTDEnumError = ErrorObject<"enum", {allowedValues: string[]}, string[]> + +const error: KeywordErrorDefinition = { + message: "must be equal to one of the allowed values", + params: ({schemaCode}) => _`{allowedValues: ${schemaCode}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "enum", + schemaType: "array", + error, + code(cxt: KeywordCxt) { + checkMetadata(cxt) + const {gen, data, schema, schemaValue, parentSchema, it} = cxt + if (schema.length === 0) throw new Error("enum must have non-empty array") + if (schema.length !== new Set(schema).size) throw new Error("enum items must be unique") + let valid: Code + const isString = _`typeof ${data} == "string"` + if (schema.length >= it.opts.loopEnum) { + let cond: Code + ;[valid, cond] = checkNullable(cxt, isString) + gen.if(cond, loopEnum) + } else { + /* istanbul ignore if */ + if (!Array.isArray(schema)) throw new Error("ajv implementation error") + valid = and(isString, or(...schema.map((value: string) => _`${data} === ${value}`))) + if (parentSchema.nullable) valid = or(_`${data} === null`, valid) + } + cxt.pass(valid) + + function loopEnum(): void { + gen.forOf("v", schemaValue as Code, (v) => + gen.if(_`${valid} = ${data} === ${v}`, () => gen.break()) + ) + } + }, +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/error.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/error.ts new file mode 100644 index 0000000000..5069322588 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/error.ts @@ -0,0 +1,23 @@ +import type {KeywordErrorDefinition, KeywordErrorCxt, ErrorObject} from "../../types" +import {_, Code} from "../../compile/codegen" + +export type _JTDTypeError = ErrorObject< + K, + {type: T; nullable: boolean}, + S +> + +export function typeError(t: string): KeywordErrorDefinition { + return { + message: (cxt) => typeErrorMessage(cxt, t), + params: (cxt) => typeErrorParams(cxt, t), + } +} + +export function typeErrorMessage({parentSchema}: KeywordErrorCxt, t: string): string { + return parentSchema?.nullable ? `must be ${t} or null` : `must be ${t}` +} + +export function typeErrorParams({parentSchema}: KeywordErrorCxt, t: string): Code { + return _`{type: ${t}, nullable: ${!!parentSchema?.nullable}}` +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/index.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/index.ts new file mode 100644 index 0000000000..f7baebc307 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/index.ts @@ -0,0 +1,37 @@ +import type {Vocabulary} from "../../types" +import refKeyword from "./ref" +import typeKeyword, {JTDTypeError} from "./type" +import enumKeyword, {JTDEnumError} from "./enum" +import elements, {JTDElementsError} from "./elements" +import properties, {JTDPropertiesError} from "./properties" +import optionalProperties from "./optionalProperties" +import discriminator, {JTDDiscriminatorError} from "./discriminator" +import values, {JTDValuesError} from "./values" +import union from "./union" +import metadata from "./metadata" + +const jtdVocabulary: Vocabulary = [ + "definitions", + refKeyword, + typeKeyword, + enumKeyword, + elements, + properties, + optionalProperties, + discriminator, + values, + union, + metadata, + {keyword: "additionalProperties", schemaType: "boolean"}, + {keyword: "nullable", schemaType: "boolean"}, +] + +export default jtdVocabulary + +export type JTDErrorObject = + | JTDTypeError + | JTDEnumError + | JTDElementsError + | JTDPropertiesError + | JTDDiscriminatorError + | JTDValuesError diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/metadata.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/metadata.ts new file mode 100644 index 0000000000..19eeb8c7d5 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/metadata.ts @@ -0,0 +1,24 @@ +import {KeywordCxt} from "../../ajv" +import type {CodeKeywordDefinition} from "../../types" +import {alwaysValidSchema} from "../../compile/util" + +const def: CodeKeywordDefinition = { + keyword: "metadata", + schemaType: "object", + code(cxt: KeywordCxt) { + checkMetadata(cxt) + const {gen, schema, it} = cxt + if (alwaysValidSchema(it, schema)) return + const valid = gen.name("valid") + cxt.subschema({keyword: "metadata", jtdMetadata: true}, valid) + cxt.ok(valid) + }, +} + +export function checkMetadata({it, keyword}: KeywordCxt, metadata?: boolean): void { + if (it.jtdMetadata !== metadata) { + throw new Error(`JTD: "${keyword}" cannot be used in this schema location`) + } +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/nullable.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/nullable.ts new file mode 100644 index 0000000000..c74b05da72 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/nullable.ts @@ -0,0 +1,21 @@ +import type {KeywordCxt} from "../../compile/validate" +import {_, not, nil, Code, Name} from "../../compile/codegen" + +export function checkNullable( + {gen, data, parentSchema}: KeywordCxt, + cond: Code = nil +): [Name, Code] { + const valid = gen.name("valid") + if (parentSchema.nullable) { + gen.let(valid, _`${data} === null`) + cond = not(valid) + } else { + gen.let(valid, false) + } + return [valid, cond] +} + +export function checkNullableObject(cxt: KeywordCxt, cond: Code): [Name, Code] { + const [valid, cond_] = checkNullable(cxt, cond) + return [valid, _`${cond_} && typeof ${cxt.data} == "object" && !Array.isArray(${cxt.data})`] +} diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/optionalProperties.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/optionalProperties.ts new file mode 100644 index 0000000000..8e91c8d918 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/optionalProperties.ts @@ -0,0 +1,15 @@ +import type {CodeKeywordDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {validateProperties, error} from "./properties" + +const def: CodeKeywordDefinition = { + keyword: "optionalProperties", + schemaType: "object", + error, + code(cxt: KeywordCxt) { + if (cxt.parentSchema.properties) return + validateProperties(cxt) + }, +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/properties.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/properties.ts new file mode 100644 index 0000000000..9dd24c5cd6 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/properties.ts @@ -0,0 +1,184 @@ +import type { + CodeKeywordDefinition, + ErrorObject, + KeywordErrorDefinition, + SchemaObject, +} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {propertyInData, allSchemaProperties, isOwnProperty} from "../code" +import {alwaysValidSchema, schemaRefOrVal} from "../../compile/util" +import {_, and, not, Code, Name} from "../../compile/codegen" +import {checkMetadata} from "./metadata" +import {checkNullableObject} from "./nullable" +import {typeErrorMessage, typeErrorParams, _JTDTypeError} from "./error" + +enum PropError { + Additional = "additional", + Missing = "missing", +} + +type PropKeyword = "properties" | "optionalProperties" + +type PropSchema = {[P in string]?: SchemaObject} + +export type JTDPropertiesError = + | _JTDTypeError + | ErrorObject + | ErrorObject + +export const error: KeywordErrorDefinition = { + message: (cxt) => { + const {params} = cxt + return params.propError + ? params.propError === PropError.Additional + ? "must NOT have additional properties" + : `must have property '${params.missingProperty}'` + : typeErrorMessage(cxt, "object") + }, + params: (cxt) => { + const {params} = cxt + return params.propError + ? params.propError === PropError.Additional + ? _`{error: ${params.propError}, additionalProperty: ${params.additionalProperty}}` + : _`{error: ${params.propError}, missingProperty: ${params.missingProperty}}` + : typeErrorParams(cxt, "object") + }, +} + +const def: CodeKeywordDefinition = { + keyword: "properties", + schemaType: "object", + error, + code: validateProperties, +} + +// const error: KeywordErrorDefinition = { +// message: "should NOT have additional properties", +// params: ({params}) => _`{additionalProperty: ${params.additionalProperty}}`, +// } + +export function validateProperties(cxt: KeywordCxt): void { + checkMetadata(cxt) + const {gen, data, parentSchema, it} = cxt + const {additionalProperties, nullable} = parentSchema + if (it.jtdDiscriminator && nullable) throw new Error("JTD: nullable inside discriminator mapping") + if (commonProperties()) { + throw new Error("JTD: properties and optionalProperties have common members") + } + const [allProps, properties] = schemaProperties("properties") + const [allOptProps, optProperties] = schemaProperties("optionalProperties") + if (properties.length === 0 && optProperties.length === 0 && additionalProperties) { + return + } + + const [valid, cond] = + it.jtdDiscriminator === undefined + ? checkNullableObject(cxt, data) + : [gen.let("valid", false), true] + gen.if(cond, () => + gen.assign(valid, true).block(() => { + validateProps(properties, "properties", true) + validateProps(optProperties, "optionalProperties") + if (!additionalProperties) validateAdditional() + }) + ) + cxt.pass(valid) + + function commonProperties(): boolean { + const props = parentSchema.properties as Record | undefined + const optProps = parentSchema.optionalProperties as Record | undefined + if (!(props && optProps)) return false + for (const p in props) { + if (Object.prototype.hasOwnProperty.call(optProps, p)) return true + } + return false + } + + function schemaProperties(keyword: string): [string[], string[]] { + const schema = parentSchema[keyword] + const allPs = schema ? allSchemaProperties(schema) : [] + if (it.jtdDiscriminator && allPs.some((p) => p === it.jtdDiscriminator)) { + throw new Error(`JTD: discriminator tag used in ${keyword}`) + } + const ps = allPs.filter((p) => !alwaysValidSchema(it, schema[p])) + return [allPs, ps] + } + + function validateProps(props: string[], keyword: string, required?: boolean): void { + const _valid = gen.var("valid") + for (const prop of props) { + gen.if( + propertyInData(gen, data, prop, it.opts.ownProperties), + () => applyPropertySchema(prop, keyword, _valid), + () => missingProperty(prop) + ) + cxt.ok(_valid) + } + + function missingProperty(prop: string): void { + if (required) { + gen.assign(_valid, false) + cxt.error(false, {propError: PropError.Missing, missingProperty: prop}, {schemaPath: prop}) + } else { + gen.assign(_valid, true) + } + } + } + + function applyPropertySchema(prop: string, keyword: string, _valid: Name): void { + cxt.subschema( + { + keyword, + schemaProp: prop, + dataProp: prop, + }, + _valid + ) + } + + function validateAdditional(): void { + gen.forIn("key", data, (key: Name) => { + const addProp = isAdditional(key, allProps, "properties", it.jtdDiscriminator) + const addOptProp = isAdditional(key, allOptProps, "optionalProperties") + const extra = + addProp === true ? addOptProp : addOptProp === true ? addProp : and(addProp, addOptProp) + gen.if(extra, () => { + if (it.opts.removeAdditional) { + gen.code(_`delete ${data}[${key}]`) + } else { + cxt.error( + false, + {propError: PropError.Additional, additionalProperty: key}, + {instancePath: key, parentSchema: true} + ) + if (!it.opts.allErrors) gen.break() + } + }) + }) + } + + function isAdditional( + key: Name, + props: string[], + keyword: string, + jtdDiscriminator?: string + ): Code | true { + let additional: Code | boolean + if (props.length > 8) { + // TODO maybe an option instead of hard-coded 8? + const propsSchema = schemaRefOrVal(it, parentSchema[keyword], keyword) + additional = not(isOwnProperty(gen, propsSchema as Code, key)) + if (jtdDiscriminator !== undefined) { + additional = and(additional, _`${key} !== ${jtdDiscriminator}`) + } + } else if (props.length || jtdDiscriminator !== undefined) { + const ps = jtdDiscriminator === undefined ? props : [jtdDiscriminator].concat(props) + additional = and(...ps.map((p) => _`${key} !== ${p}`)) + } else { + additional = true + } + return additional + } +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/ref.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/ref.ts new file mode 100644 index 0000000000..97646ee1b6 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/ref.ts @@ -0,0 +1,76 @@ +import type {CodeKeywordDefinition, AnySchemaObject} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {compileSchema, SchemaEnv} from "../../compile" +import {_, not, nil, stringify} from "../../compile/codegen" +import MissingRefError from "../../compile/ref_error" +import N from "../../compile/names" +import {getValidate, callRef} from "../core/ref" +import {checkMetadata} from "./metadata" + +const def: CodeKeywordDefinition = { + keyword: "ref", + schemaType: "string", + code(cxt: KeywordCxt) { + checkMetadata(cxt) + const {gen, data, schema: ref, parentSchema, it} = cxt + const { + schemaEnv: {root}, + } = it + const valid = gen.name("valid") + if (parentSchema.nullable) { + gen.var(valid, _`${data} === null`) + gen.if(not(valid), validateJtdRef) + } else { + gen.var(valid, false) + validateJtdRef() + } + cxt.ok(valid) + + function validateJtdRef(): void { + const refSchema = (root.schema as AnySchemaObject).definitions?.[ref] + if (!refSchema) { + throw new MissingRefError(it.opts.uriResolver, "", ref, `No definition ${ref}`) + } + if (hasRef(refSchema) || !it.opts.inlineRefs) callValidate(refSchema) + else inlineRefSchema(refSchema) + } + + function callValidate(schema: AnySchemaObject): void { + const sch = compileSchema.call( + it.self, + new SchemaEnv({schema, root, schemaPath: `/definitions/${ref}`}) + ) + const v = getValidate(cxt, sch) + const errsCount = gen.const("_errs", N.errors) + callRef(cxt, v, sch, sch.$async) + gen.assign(valid, _`${errsCount} === ${N.errors}`) + } + + function inlineRefSchema(schema: AnySchemaObject): void { + const schName = gen.scopeValue( + "schema", + it.opts.code.source === true ? {ref: schema, code: stringify(schema)} : {ref: schema} + ) + cxt.subschema( + { + schema, + dataTypes: [], + schemaPath: nil, + topSchemaRef: schName, + errSchemaPath: `/definitions/${ref}`, + }, + valid + ) + } + }, +} + +export function hasRef(schema: AnySchemaObject): boolean { + for (const key in schema) { + let sch: AnySchemaObject + if (key === "ref" || (typeof (sch = schema[key]) == "object" && hasRef(sch))) return true + } + return false +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/type.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/type.ts new file mode 100644 index 0000000000..17274300b7 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/type.ts @@ -0,0 +1,75 @@ +import type {CodeKeywordDefinition, KeywordErrorDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, nil, or, Code} from "../../compile/codegen" +import validTimestamp from "../../runtime/timestamp" +import {useFunc} from "../../compile/util" +import {checkMetadata} from "./metadata" +import {typeErrorMessage, typeErrorParams, _JTDTypeError} from "./error" + +export type JTDTypeError = _JTDTypeError<"type", JTDType, JTDType> + +export type IntType = "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32" + +export const intRange: {[T in IntType]: [number, number, number]} = { + int8: [-128, 127, 3], + uint8: [0, 255, 3], + int16: [-32768, 32767, 5], + uint16: [0, 65535, 5], + int32: [-2147483648, 2147483647, 10], + uint32: [0, 4294967295, 10], +} + +export type JTDType = "boolean" | "string" | "timestamp" | "float32" | "float64" | IntType + +const error: KeywordErrorDefinition = { + message: (cxt) => typeErrorMessage(cxt, cxt.schema), + params: (cxt) => typeErrorParams(cxt, cxt.schema), +} + +function timestampCode(cxt: KeywordCxt): Code { + const {gen, data, it} = cxt + const {timestamp, allowDate} = it.opts + if (timestamp === "date") return _`${data} instanceof Date ` + const vts = useFunc(gen, validTimestamp) + const allowDateArg = allowDate ? _`, true` : nil + const validString = _`typeof ${data} == "string" && ${vts}(${data}${allowDateArg})` + return timestamp === "string" ? validString : or(_`${data} instanceof Date`, validString) +} + +const def: CodeKeywordDefinition = { + keyword: "type", + schemaType: "string", + error, + code(cxt: KeywordCxt) { + checkMetadata(cxt) + const {data, schema, parentSchema, it} = cxt + let cond: Code + switch (schema) { + case "boolean": + case "string": + cond = _`typeof ${data} == ${schema}` + break + case "timestamp": { + cond = timestampCode(cxt) + break + } + case "float32": + case "float64": + cond = _`typeof ${data} == "number"` + break + default: { + const sch = schema as IntType + cond = _`typeof ${data} == "number" && isFinite(${data}) && !(${data} % 1)` + if (!it.opts.int32range && (sch === "int32" || sch === "uint32")) { + if (sch === "uint32") cond = _`${cond} && ${data} >= 0` + } else { + const [min, max] = intRange[sch] + cond = _`${cond} && ${data} >= ${min} && ${data} <= ${max}` + } + } + } + cxt.pass(parentSchema.nullable ? or(_`${data} === null`, cond) : cond) + }, +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/union.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/union.ts new file mode 100644 index 0000000000..588f07ab4a --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/union.ts @@ -0,0 +1,12 @@ +import type {CodeKeywordDefinition} from "../../types" +import {validateUnion} from "../code" + +const def: CodeKeywordDefinition = { + keyword: "union", + schemaType: "array", + trackErrors: true, + code: validateUnion, + error: {message: "must match a schema in union"}, +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/values.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/values.ts new file mode 100644 index 0000000000..e649450776 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/jtd/values.ts @@ -0,0 +1,58 @@ +import type {CodeKeywordDefinition, SchemaObject} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {alwaysValidSchema, Type} from "../../compile/util" +import {not, or, Name} from "../../compile/codegen" +import {checkMetadata} from "./metadata" +import {checkNullableObject} from "./nullable" +import {typeError, _JTDTypeError} from "./error" + +export type JTDValuesError = _JTDTypeError<"values", "object", SchemaObject> + +const def: CodeKeywordDefinition = { + keyword: "values", + schemaType: "object", + error: typeError("object"), + code(cxt: KeywordCxt) { + checkMetadata(cxt) + const {gen, data, schema, it} = cxt + const [valid, cond] = checkNullableObject(cxt, data) + if (alwaysValidSchema(it, schema)) { + gen.if(not(or(cond, valid)), () => cxt.error()) + } else { + gen.if(cond) + gen.assign(valid, validateMap()) + gen.elseIf(not(valid)) + cxt.error() + gen.endIf() + } + cxt.ok(valid) + + function validateMap(): Name | boolean { + const _valid = gen.name("valid") + if (it.allErrors) { + const validMap = gen.let("valid", true) + validateValues(() => gen.assign(validMap, false)) + return validMap + } + gen.var(_valid, true) + validateValues(() => gen.break()) + return _valid + + function validateValues(notValid: () => void): void { + gen.forIn("key", data, (key) => { + cxt.subschema( + { + keyword: "values", + dataProp: key, + dataPropType: Type.Str, + }, + _valid + ) + gen.if(not(_valid), notValid) + }) + } + } + }, +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/metadata.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/metadata.ts new file mode 100644 index 0000000000..b9d5af85fe --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/metadata.ts @@ -0,0 +1,17 @@ +import type {Vocabulary} from "../types" + +export const metadataVocabulary: Vocabulary = [ + "title", + "description", + "default", + "deprecated", + "readOnly", + "writeOnly", + "examples", +] + +export const contentVocabulary: Vocabulary = [ + "contentMediaType", + "contentEncoding", + "contentSchema", +] diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/next.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/next.ts new file mode 100644 index 0000000000..1e987ad212 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/next.ts @@ -0,0 +1,8 @@ +import type {Vocabulary} from "../types" +import dependentRequired from "./validation/dependentRequired" +import dependentSchemas from "./applicator/dependentSchemas" +import limitContains from "./validation/limitContains" + +const next: Vocabulary = [dependentRequired, dependentSchemas, limitContains] + +export default next diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/unevaluated/index.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/unevaluated/index.ts new file mode 100644 index 0000000000..f7f0815dbb --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/unevaluated/index.ts @@ -0,0 +1,7 @@ +import type {Vocabulary} from "../../types" +import unevaluatedProperties from "./unevaluatedProperties" +import unevaluatedItems from "./unevaluatedItems" + +const unevaluated: Vocabulary = [unevaluatedProperties, unevaluatedItems] + +export default unevaluated diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/unevaluated/unevaluatedItems.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/unevaluated/unevaluatedItems.ts new file mode 100644 index 0000000000..50bf0e7c17 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/unevaluated/unevaluatedItems.ts @@ -0,0 +1,47 @@ +import type { + CodeKeywordDefinition, + ErrorObject, + KeywordErrorDefinition, + AnySchema, +} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, str, not, Name} from "../../compile/codegen" +import {alwaysValidSchema, Type} from "../../compile/util" + +export type UnevaluatedItemsError = ErrorObject<"unevaluatedItems", {limit: number}, AnySchema> + +const error: KeywordErrorDefinition = { + message: ({params: {len}}) => str`must NOT have more than ${len} items`, + params: ({params: {len}}) => _`{limit: ${len}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "unevaluatedItems", + type: "array", + schemaType: ["boolean", "object"], + error, + code(cxt: KeywordCxt) { + const {gen, schema, data, it} = cxt + const items = it.items || 0 + if (items === true) return + const len = gen.const("len", _`${data}.length`) + if (schema === false) { + cxt.setParams({len: items}) + cxt.fail(_`${len} > ${items}`) + } else if (typeof schema == "object" && !alwaysValidSchema(it, schema)) { + const valid = gen.var("valid", _`${len} <= ${items}`) + gen.if(not(valid), () => validateItems(valid, items)) + cxt.ok(valid) + } + it.items = true + + function validateItems(valid: Name, from: Name | number): void { + gen.forRange("i", from, len, (i) => { + cxt.subschema({keyword: "unevaluatedItems", dataProp: i, dataPropType: Type.Num}, valid) + if (!it.allErrors) gen.if(not(valid), () => gen.break()) + }) + } + }, +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/unevaluated/unevaluatedProperties.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/unevaluated/unevaluatedProperties.ts new file mode 100644 index 0000000000..0e6868fa32 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/unevaluated/unevaluatedProperties.ts @@ -0,0 +1,85 @@ +import type { + CodeKeywordDefinition, + KeywordErrorDefinition, + ErrorObject, + AnySchema, +} from "../../types" +import {_, not, and, Name, Code} from "../../compile/codegen" +import {alwaysValidSchema, Type} from "../../compile/util" +import N from "../../compile/names" + +export type UnevaluatedPropertiesError = ErrorObject< + "unevaluatedProperties", + {unevaluatedProperty: string}, + AnySchema +> + +const error: KeywordErrorDefinition = { + message: "must NOT have unevaluated properties", + params: ({params}) => _`{unevaluatedProperty: ${params.unevaluatedProperty}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "unevaluatedProperties", + type: "object", + schemaType: ["boolean", "object"], + trackErrors: true, + error, + code(cxt) { + const {gen, schema, data, errsCount, it} = cxt + /* istanbul ignore if */ + if (!errsCount) throw new Error("ajv implementation error") + const {allErrors, props} = it + if (props instanceof Name) { + gen.if(_`${props} !== true`, () => + gen.forIn("key", data, (key: Name) => + gen.if(unevaluatedDynamic(props, key), () => unevaluatedPropCode(key)) + ) + ) + } else if (props !== true) { + gen.forIn("key", data, (key: Name) => + props === undefined + ? unevaluatedPropCode(key) + : gen.if(unevaluatedStatic(props, key), () => unevaluatedPropCode(key)) + ) + } + it.props = true + cxt.ok(_`${errsCount} === ${N.errors}`) + + function unevaluatedPropCode(key: Name): void { + if (schema === false) { + cxt.setParams({unevaluatedProperty: key}) + cxt.error() + if (!allErrors) gen.break() + return + } + + if (!alwaysValidSchema(it, schema)) { + const valid = gen.name("valid") + cxt.subschema( + { + keyword: "unevaluatedProperties", + dataProp: key, + dataPropType: Type.Str, + }, + valid + ) + if (!allErrors) gen.if(not(valid), () => gen.break()) + } + } + + function unevaluatedDynamic(evaluatedProps: Name, key: Name): Code { + return _`!${evaluatedProps} || !${evaluatedProps}[${key}]` + } + + function unevaluatedStatic(evaluatedProps: {[K in string]?: true}, key: Name): Code { + const ps: Code[] = [] + for (const p in evaluatedProps) { + if (evaluatedProps[p] === true) ps.push(_`${key} !== ${p}`) + } + return and(...ps) + } + }, +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/const.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/const.ts new file mode 100644 index 0000000000..a3b94a5dcd --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/const.ts @@ -0,0 +1,28 @@ +import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_} from "../../compile/codegen" +import {useFunc} from "../../compile/util" +import equal from "../../runtime/equal" + +export type ConstError = ErrorObject<"const", {allowedValue: any}> + +const error: KeywordErrorDefinition = { + message: "must be equal to constant", + params: ({schemaCode}) => _`{allowedValue: ${schemaCode}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "const", + $data: true, + error, + code(cxt: KeywordCxt) { + const {gen, data, $data, schemaCode, schema} = cxt + if ($data || (schema && typeof schema == "object")) { + cxt.fail$data(_`!${useFunc(gen, equal)}(${data}, ${schemaCode})`) + } else { + cxt.fail(_`${schema} !== ${data}`) + } + }, +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/dependentRequired.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/dependentRequired.ts new file mode 100644 index 0000000000..4c616cfa9a --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/dependentRequired.ts @@ -0,0 +1,23 @@ +import type {CodeKeywordDefinition, ErrorObject} from "../../types" +import { + validatePropertyDeps, + error, + DependenciesErrorParams, + PropertyDependencies, +} from "../applicator/dependencies" + +export type DependentRequiredError = ErrorObject< + "dependentRequired", + DependenciesErrorParams, + PropertyDependencies +> + +const def: CodeKeywordDefinition = { + keyword: "dependentRequired", + type: "object", + schemaType: "object", + error, + code: (cxt) => validatePropertyDeps(cxt), +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/enum.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/enum.ts new file mode 100644 index 0000000000..76377fb02e --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/enum.ts @@ -0,0 +1,54 @@ +import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, or, Name, Code} from "../../compile/codegen" +import {useFunc} from "../../compile/util" +import equal from "../../runtime/equal" + +export type EnumError = ErrorObject<"enum", {allowedValues: any[]}, any[] | {$data: string}> + +const error: KeywordErrorDefinition = { + message: "must be equal to one of the allowed values", + params: ({schemaCode}) => _`{allowedValues: ${schemaCode}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "enum", + schemaType: "array", + $data: true, + error, + code(cxt: KeywordCxt) { + const {gen, data, $data, schema, schemaCode, it} = cxt + if (!$data && schema.length === 0) throw new Error("enum must have non-empty array") + const useLoop = schema.length >= it.opts.loopEnum + let eql: Name | undefined + const getEql = (): Name => (eql ??= useFunc(gen, equal)) + + let valid: Code + if (useLoop || $data) { + valid = gen.let("valid") + cxt.block$data(valid, loopEnum) + } else { + /* istanbul ignore if */ + if (!Array.isArray(schema)) throw new Error("ajv implementation error") + const vSchema = gen.const("vSchema", schemaCode) + valid = or(...schema.map((_x: unknown, i: number) => equalCode(vSchema, i))) + } + cxt.pass(valid) + + function loopEnum(): void { + gen.assign(valid, false) + gen.forOf("v", schemaCode as Code, (v) => + gen.if(_`${getEql()}(${data}, ${v})`, () => gen.assign(valid, true).break()) + ) + } + + function equalCode(vSchema: Name, i: number): Code { + const sch = schema[i] + return typeof sch === "object" && sch !== null + ? _`${getEql()}(${data}, ${vSchema}[${i}])` + : _`${data} === ${sch}` + } + }, +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/index.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/index.ts new file mode 100644 index 0000000000..3531b19628 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/index.ts @@ -0,0 +1,49 @@ +import type {ErrorObject, Vocabulary} from "../../types" +import limitNumber, {LimitNumberError} from "./limitNumber" +import multipleOf, {MultipleOfError} from "./multipleOf" +import limitLength from "./limitLength" +import pattern, {PatternError} from "./pattern" +import limitProperties from "./limitProperties" +import required, {RequiredError} from "./required" +import limitItems from "./limitItems" +import uniqueItems, {UniqueItemsError} from "./uniqueItems" +import constKeyword, {ConstError} from "./const" +import enumKeyword, {EnumError} from "./enum" + +const validation: Vocabulary = [ + // number + limitNumber, + multipleOf, + // string + limitLength, + pattern, + // object + limitProperties, + required, + // array + limitItems, + uniqueItems, + // any + {keyword: "type", schemaType: ["string", "array"]}, + {keyword: "nullable", schemaType: "boolean"}, + constKeyword, + enumKeyword, +] + +export default validation + +type LimitError = ErrorObject< + "maxItems" | "minItems" | "minProperties" | "maxProperties" | "minLength" | "maxLength", + {limit: number}, + number | {$data: string} +> + +export type ValidationKeywordError = + | LimitError + | LimitNumberError + | MultipleOfError + | PatternError + | RequiredError + | UniqueItemsError + | ConstError + | EnumError diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/limitContains.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/limitContains.ts new file mode 100644 index 0000000000..8bb43c1a4a --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/limitContains.ts @@ -0,0 +1,16 @@ +import type {CodeKeywordDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {checkStrictMode} from "../../compile/util" + +const def: CodeKeywordDefinition = { + keyword: ["maxContains", "minContains"], + type: "array", + schemaType: "number", + code({keyword, parentSchema, it}: KeywordCxt) { + if (parentSchema.contains === undefined) { + checkStrictMode(it, `"${keyword}" without "contains" is ignored`) + } + }, +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/limitItems.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/limitItems.ts new file mode 100644 index 0000000000..566de8588b --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/limitItems.ts @@ -0,0 +1,26 @@ +import type {CodeKeywordDefinition, KeywordErrorDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, str, operators} from "../../compile/codegen" + +const error: KeywordErrorDefinition = { + message({keyword, schemaCode}) { + const comp = keyword === "maxItems" ? "more" : "fewer" + return str`must NOT have ${comp} than ${schemaCode} items` + }, + params: ({schemaCode}) => _`{limit: ${schemaCode}}`, +} + +const def: CodeKeywordDefinition = { + keyword: ["maxItems", "minItems"], + type: "array", + schemaType: "number", + $data: true, + error, + code(cxt: KeywordCxt) { + const {keyword, data, schemaCode} = cxt + const op = keyword === "maxItems" ? operators.GT : operators.LT + cxt.fail$data(_`${data}.length ${op} ${schemaCode}`) + }, +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/limitLength.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/limitLength.ts new file mode 100644 index 0000000000..f4f9472595 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/limitLength.ts @@ -0,0 +1,30 @@ +import type {CodeKeywordDefinition, KeywordErrorDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, str, operators} from "../../compile/codegen" +import {useFunc} from "../../compile/util" +import ucs2length from "../../runtime/ucs2length" + +const error: KeywordErrorDefinition = { + message({keyword, schemaCode}) { + const comp = keyword === "maxLength" ? "more" : "fewer" + return str`must NOT have ${comp} than ${schemaCode} characters` + }, + params: ({schemaCode}) => _`{limit: ${schemaCode}}`, +} + +const def: CodeKeywordDefinition = { + keyword: ["maxLength", "minLength"], + type: "string", + schemaType: "number", + $data: true, + error, + code(cxt: KeywordCxt) { + const {keyword, data, schemaCode, it} = cxt + const op = keyword === "maxLength" ? operators.GT : operators.LT + const len = + it.opts.unicode === false ? _`${data}.length` : _`${useFunc(cxt.gen, ucs2length)}(${data})` + cxt.fail$data(_`${len} ${op} ${schemaCode}`) + }, +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/limitNumber.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/limitNumber.ts new file mode 100644 index 0000000000..5499202efb --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/limitNumber.ts @@ -0,0 +1,42 @@ +import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, str, operators, Code} from "../../compile/codegen" + +const ops = operators + +type Kwd = "maximum" | "minimum" | "exclusiveMaximum" | "exclusiveMinimum" + +type Comparison = "<=" | ">=" | "<" | ">" + +const KWDs: {[K in Kwd]: {okStr: Comparison; ok: Code; fail: Code}} = { + maximum: {okStr: "<=", ok: ops.LTE, fail: ops.GT}, + minimum: {okStr: ">=", ok: ops.GTE, fail: ops.LT}, + exclusiveMaximum: {okStr: "<", ok: ops.LT, fail: ops.GTE}, + exclusiveMinimum: {okStr: ">", ok: ops.GT, fail: ops.LTE}, +} + +export type LimitNumberError = ErrorObject< + Kwd, + {limit: number; comparison: Comparison}, + number | {$data: string} +> + +const error: KeywordErrorDefinition = { + message: ({keyword, schemaCode}) => str`must be ${KWDs[keyword as Kwd].okStr} ${schemaCode}`, + params: ({keyword, schemaCode}) => + _`{comparison: ${KWDs[keyword as Kwd].okStr}, limit: ${schemaCode}}`, +} + +const def: CodeKeywordDefinition = { + keyword: Object.keys(KWDs), + type: "number", + schemaType: "number", + $data: true, + error, + code(cxt: KeywordCxt) { + const {keyword, data, schemaCode} = cxt + cxt.fail$data(_`${data} ${KWDs[keyword as Kwd].fail} ${schemaCode} || isNaN(${data})`) + }, +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/limitProperties.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/limitProperties.ts new file mode 100644 index 0000000000..07fffa8b39 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/limitProperties.ts @@ -0,0 +1,26 @@ +import type {CodeKeywordDefinition, KeywordErrorDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, str, operators} from "../../compile/codegen" + +const error: KeywordErrorDefinition = { + message({keyword, schemaCode}) { + const comp = keyword === "maxProperties" ? "more" : "fewer" + return str`must NOT have ${comp} than ${schemaCode} properties` + }, + params: ({schemaCode}) => _`{limit: ${schemaCode}}`, +} + +const def: CodeKeywordDefinition = { + keyword: ["maxProperties", "minProperties"], + type: "object", + schemaType: "number", + $data: true, + error, + code(cxt: KeywordCxt) { + const {keyword, data, schemaCode} = cxt + const op = keyword === "maxProperties" ? operators.GT : operators.LT + cxt.fail$data(_`Object.keys(${data}).length ${op} ${schemaCode}`) + }, +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/multipleOf.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/multipleOf.ts new file mode 100644 index 0000000000..1fd79abbd9 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/multipleOf.ts @@ -0,0 +1,34 @@ +import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, str} from "../../compile/codegen" + +export type MultipleOfError = ErrorObject< + "multipleOf", + {multipleOf: number}, + number | {$data: string} +> + +const error: KeywordErrorDefinition = { + message: ({schemaCode}) => str`must be multiple of ${schemaCode}`, + params: ({schemaCode}) => _`{multipleOf: ${schemaCode}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "multipleOf", + type: "number", + schemaType: "number", + $data: true, + error, + code(cxt: KeywordCxt) { + const {gen, data, schemaCode, it} = cxt + // const bdt = bad$DataType(schemaCode, def.schemaType, $data) + const prec = it.opts.multipleOfPrecision + const res = gen.let("res") + const invalid = prec + ? _`Math.abs(Math.round(${res}) - ${res}) > 1e-${prec}` + : _`${res} !== parseInt(${res})` + cxt.fail$data(_`(${schemaCode} === 0 || (${res} = ${data}/${schemaCode}, ${invalid}))`) + }, +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/pattern.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/pattern.ts new file mode 100644 index 0000000000..7b27b7d3c0 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/pattern.ts @@ -0,0 +1,28 @@ +import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {usePattern} from "../code" +import {_, str} from "../../compile/codegen" + +export type PatternError = ErrorObject<"pattern", {pattern: string}, string | {$data: string}> + +const error: KeywordErrorDefinition = { + message: ({schemaCode}) => str`must match pattern "${schemaCode}"`, + params: ({schemaCode}) => _`{pattern: ${schemaCode}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "pattern", + type: "string", + schemaType: "string", + $data: true, + error, + code(cxt: KeywordCxt) { + const {data, $data, schema, schemaCode, it} = cxt + // TODO regexp should be wrapped in try/catchs + const u = it.opts.unicodeRegExp ? "u" : "" + const regExp = $data ? _`(new RegExp(${schemaCode}, ${u}))` : usePattern(cxt, schema) + cxt.fail$data(_`!${regExp}.test(${data})`) + }, +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/required.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/required.ts new file mode 100644 index 0000000000..fea7367ed7 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/required.ts @@ -0,0 +1,98 @@ +import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import { + checkReportMissingProp, + checkMissingProp, + reportMissingProp, + propertyInData, + noPropertyInData, +} from "../code" +import {_, str, nil, not, Name, Code} from "../../compile/codegen" +import {checkStrictMode} from "../../compile/util" + +export type RequiredError = ErrorObject< + "required", + {missingProperty: string}, + string[] | {$data: string} +> + +const error: KeywordErrorDefinition = { + message: ({params: {missingProperty}}) => str`must have required property '${missingProperty}'`, + params: ({params: {missingProperty}}) => _`{missingProperty: ${missingProperty}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "required", + type: "object", + schemaType: "array", + $data: true, + error, + code(cxt: KeywordCxt) { + const {gen, schema, schemaCode, data, $data, it} = cxt + const {opts} = it + if (!$data && schema.length === 0) return + const useLoop = schema.length >= opts.loopRequired + if (it.allErrors) allErrorsMode() + else exitOnErrorMode() + + if (opts.strictRequired) { + const props = cxt.parentSchema.properties + const {definedProperties} = cxt.it + for (const requiredKey of schema) { + if (props?.[requiredKey] === undefined && !definedProperties.has(requiredKey)) { + const schemaPath = it.schemaEnv.baseId + it.errSchemaPath + const msg = `required property "${requiredKey}" is not defined at "${schemaPath}" (strictRequired)` + checkStrictMode(it, msg, it.opts.strictRequired) + } + } + } + + function allErrorsMode(): void { + if (useLoop || $data) { + cxt.block$data(nil, loopAllRequired) + } else { + for (const prop of schema) { + checkReportMissingProp(cxt, prop) + } + } + } + + function exitOnErrorMode(): void { + const missing = gen.let("missing") + if (useLoop || $data) { + const valid = gen.let("valid", true) + cxt.block$data(valid, () => loopUntilMissing(missing, valid)) + cxt.ok(valid) + } else { + gen.if(checkMissingProp(cxt, schema, missing)) + reportMissingProp(cxt, missing) + gen.else() + } + } + + function loopAllRequired(): void { + gen.forOf("prop", schemaCode as Code, (prop) => { + cxt.setParams({missingProperty: prop}) + gen.if(noPropertyInData(gen, data, prop, opts.ownProperties), () => cxt.error()) + }) + } + + function loopUntilMissing(missing: Name, valid: Name): void { + cxt.setParams({missingProperty: missing}) + gen.forOf( + missing, + schemaCode as Code, + () => { + gen.assign(valid, propertyInData(gen, data, missing, opts.ownProperties)) + gen.if(not(valid), () => { + cxt.error() + gen.break() + }) + }, + nil + ) + } + }, +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/uniqueItems.ts b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/uniqueItems.ts new file mode 100644 index 0000000000..765c4d04fc --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/lib/vocabularies/validation/uniqueItems.ts @@ -0,0 +1,79 @@ +import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {checkDataTypes, getSchemaTypes, DataType} from "../../compile/validate/dataType" +import {_, str, Name} from "../../compile/codegen" +import {useFunc} from "../../compile/util" +import equal from "../../runtime/equal" + +export type UniqueItemsError = ErrorObject< + "uniqueItems", + {i: number; j: number}, + boolean | {$data: string} +> + +const error: KeywordErrorDefinition = { + message: ({params: {i, j}}) => + str`must NOT have duplicate items (items ## ${j} and ${i} are identical)`, + params: ({params: {i, j}}) => _`{i: ${i}, j: ${j}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "uniqueItems", + type: "array", + schemaType: "boolean", + $data: true, + error, + code(cxt: KeywordCxt) { + const {gen, data, $data, schema, parentSchema, schemaCode, it} = cxt + if (!$data && !schema) return + const valid = gen.let("valid") + const itemTypes = parentSchema.items ? getSchemaTypes(parentSchema.items) : [] + cxt.block$data(valid, validateUniqueItems, _`${schemaCode} === false`) + cxt.ok(valid) + + function validateUniqueItems(): void { + const i = gen.let("i", _`${data}.length`) + const j = gen.let("j") + cxt.setParams({i, j}) + gen.assign(valid, true) + gen.if(_`${i} > 1`, () => (canOptimize() ? loopN : loopN2)(i, j)) + } + + function canOptimize(): boolean { + return itemTypes.length > 0 && !itemTypes.some((t) => t === "object" || t === "array") + } + + function loopN(i: Name, j: Name): void { + const item = gen.name("item") + const wrongType = checkDataTypes(itemTypes, item, it.opts.strictNumbers, DataType.Wrong) + const indices = gen.const("indices", _`{}`) + gen.for(_`;${i}--;`, () => { + gen.let(item, _`${data}[${i}]`) + gen.if(wrongType, _`continue`) + if (itemTypes.length > 1) gen.if(_`typeof ${item} == "string"`, _`${item} += "_"`) + gen + .if(_`typeof ${indices}[${item}] == "number"`, () => { + gen.assign(j, _`${indices}[${item}]`) + cxt.error() + gen.assign(valid, false).break() + }) + .code(_`${indices}[${item}] = ${i}`) + }) + } + + function loopN2(i: Name, j: Name): void { + const eql = useFunc(gen, equal) + const outer = gen.name("outer") + gen.label(outer).for(_`;${i}--;`, () => + gen.for(_`${j} = ${i}; ${j}--;`, () => + gen.if(_`${eql}(${data}[${i}], ${data}[${j}])`, () => { + cxt.error() + gen.assign(valid, false).break(outer) + }) + ) + ) + } + }, +} + +export default def diff --git a/front_end/third_party/mcp-sdk/ajv/package.json b/front_end/third_party/mcp-sdk/ajv/package.json new file mode 100644 index 0000000000..17df7b1473 --- /dev/null +++ b/front_end/third_party/mcp-sdk/ajv/package.json @@ -0,0 +1,126 @@ +{ + "name": "ajv", + "version": "8.17.1", + "description": "Another JSON Schema Validator", + "main": "dist/ajv.js", + "types": "dist/ajv.d.ts", + "files": [ + "lib/", + "dist/", + ".runkit_example.js" + ], + "scripts": { + "eslint": "eslint \"lib/**/*.ts\" \"spec/**/*.*s\" --ignore-pattern spec/JSON-Schema-Test-Suite", + "prettier:write": "prettier --write \"./**/*.{json,yaml,js,ts}\"", + "prettier:check": "prettier --list-different \"./**/*.{json,yaml,js,ts}\"", + "test-spec": "cross-env TS_NODE_PROJECT=spec/tsconfig.json mocha -r ts-node/register \"spec/**/*.spec.{ts,js}\" -R dot", + "test-codegen": "nyc cross-env TS_NODE_PROJECT=spec/tsconfig.json mocha -r ts-node/register 'spec/codegen.spec.ts' -R spec", + "test-debug": "npm run test-spec -- --inspect-brk", + "test-cov": "nyc npm run test-spec", + "rollup": "rm -rf bundle && rollup -c", + "bundle": "rm -rf bundle && node ./scripts/bundle.js ajv ajv7 ajv7 && node ./scripts/bundle.js 2019 ajv2019 ajv2019 && node ./scripts/bundle.js 2020 ajv2020 ajv2020 && node ./scripts/bundle.js jtd ajvJTD ajvJTD", + "build": "rm -rf dist && tsc && cp -r lib/refs dist && rm dist/refs/json-schema-2019-09/index.ts && rm dist/refs/json-schema-2020-12/index.ts && rm dist/refs/jtd-schema.ts", + "json-tests": "rm -rf spec/_json/*.js && node scripts/jsontests", + "test-karma": "karma start", + "test-browser": "rm -rf .browser && npm run bundle && scripts/prepare-tests && karma start", + "test-all": "npm run test-cov && if-node-version 12 npm run test-browser", + "test": "npm run json-tests && npm run prettier:check && npm run eslint && npm link && npm link --legacy-peer-deps ajv && npm run test-cov", + "test-ci": "AJV_FULL_TEST=true npm test", + "prepublish": "npm run build", + "benchmark": "npm i && npm run build && npm link && cd ./benchmark && npm link --legacy-peer-deps ajv && npm i && node ./jtd", + "docs:dev": "./scripts/prepare-site && vuepress dev docs", + "docs:build": "./scripts/prepare-site && vuepress build docs" + }, + "nyc": { + "exclude": [ + "**/spec/**", + "node_modules" + ], + "reporter": [ + "lcov", + "text-summary" + ] + }, + "repository": "ajv-validator/ajv", + "keywords": [ + "JSON", + "schema", + "validator", + "validation", + "jsonschema", + "json-schema", + "json-schema-validator", + "json-schema-validation" + ], + "author": "Evgeny Poberezkin", + "license": "MIT", + "bugs": "https://github.com/ajv-validator/ajv/issues", + "homepage": "https://ajv.js.org", + "runkitExampleFilename": ".runkit_example.js", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "devDependencies": { + "@ajv-validator/config": "^0.5.0", + "@rollup/plugin-commonjs": "^25.0.7", + "@rollup/plugin-json": "^6.1.0", + "@rollup/plugin-node-resolve": "^15.2.3", + "@rollup/plugin-typescript": "^11.1.6", + "@types/chai": "^4.3.11", + "@types/mocha": "^10.0.6", + "@types/node": "^20.11.30", + "@types/require-from-string": "^1.2.3", + "@typescript-eslint/eslint-plugin": "^7.3.1", + "@typescript-eslint/parser": "^7.3.1", + "ajv-formats": "^3.0.1", + "browserify": "^17.0.0", + "chai": "^4.4.1", + "cross-env": "^7.0.3", + "dayjs": "^1.11.10", + "dayjs-plugin-utc": "^0.1.2", + "eslint": "^8.57.0", + "eslint-config-prettier": "^9.1.0", + "glob": "^10.3.10", + "husky": "^9.0.11", + "if-node-version": "^1.1.1", + "jimp": "^0.22.10", + "js-beautify": "^1.15.1", + "json-schema-test": "^2.0.0", + "karma": "^6.4.2", + "karma-chrome-launcher": "^3.2.0", + "karma-mocha": "^2.0.1", + "lint-staged": "^15.2.2", + "mocha": "^10.3.0", + "module-from-string": "^3.3.0", + "node-fetch": "^3.3.2", + "nyc": "^15.1.0", + "prettier": "3.0.3", + "re2": "^1.20.9", + "rollup": "^2.79.1", + "rollup-plugin-terser": "^7.0.2", + "ts-node": "^10.9.2", + "tsify": "^5.0.4", + "typescript": "5.3.3", + "uri-js": "^4.4.1" + }, + "collective": { + "type": "opencollective", + "url": "https://opencollective.com/ajv" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + }, + "prettier": "@ajv-validator/config/prettierrc.json", + "husky": { + "hooks": { + "pre-commit": "lint-staged && npm test" + } + }, + "lint-staged": { + "*.{json,yaml,js,ts}": "prettier --write" + } +} diff --git a/front_end/third_party/mcp-sdk/eventsource-parser/package/LICENSE b/front_end/third_party/mcp-sdk/eventsource-parser/package/LICENSE new file mode 100644 index 0000000000..82f30788b8 --- /dev/null +++ b/front_end/third_party/mcp-sdk/eventsource-parser/package/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Espen Hovlandsdal + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/front_end/third_party/mcp-sdk/eventsource-parser/package/README.md b/front_end/third_party/mcp-sdk/eventsource-parser/package/README.md new file mode 100644 index 0000000000..fdd64f77fe --- /dev/null +++ b/front_end/third_party/mcp-sdk/eventsource-parser/package/README.md @@ -0,0 +1,126 @@ +# eventsource-parser + +[![npm version](https://img.shields.io/npm/v/eventsource-parser.svg?style=flat-square)](https://www.npmjs.com/package/eventsource-parser)[![npm bundle size](https://img.shields.io/bundlephobia/minzip/eventsource-parser?style=flat-square)](https://bundlephobia.com/result?p=eventsource-parser)[![npm weekly downloads](https://img.shields.io/npm/dw/eventsource-parser.svg?style=flat-square)](https://www.npmjs.com/package/eventsource-parser) + +A streaming parser for [server-sent events/eventsource](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events), without any assumptions about how the actual stream of data is retrieved. It is intended to be a building block for [clients](https://github.com/rexxars/eventsource-client) and polyfills in javascript environments such as browsers, node.js and deno. + +If you are looking for a modern client implementation, see [eventsource-client](https://github.com/rexxars/eventsource-client). + +You create an instance of the parser, and _feed_ it chunks of data - partial or complete, and the parse emits parsed messages once it receives a complete message. A [TransformStream variant](#stream-usage) is also available for environments that support it (modern browsers, Node 18 and higher). + +Other modules in the EventSource family: + +- [eventsource-client](https://github.com/rexxars/eventsource-client): modern, feature rich eventsource client for browsers, node.js, bun, deno and other modern JavaScript environments. +- [eventsource-encoder](https://github.com/rexxars/eventsource-encoder): encodes messages in the EventSource/Server-Sent Events format. +- [eventsource](https://github.com/eventsource/eventsource): Node.js polyfill for the WhatWG EventSource API. + +> [!NOTE] +> Migrating from eventsource-parser 1.x/2.x? See the [migration guide](./MIGRATE-v3.md). + +## Installation + +```bash +npm install --save eventsource-parser +``` + +## Usage + +```ts +import {createParser, type EventSourceMessage} from 'eventsource-parser' + +function onEvent(event: EventSourceMessage) { + console.log('Received event!') + console.log('id: %s', event.id || '') + console.log('event: %s', event.event || '') + console.log('data: %s', event.data) +} + +const parser = createParser({onEvent}) +const sseStream = getSomeReadableStream() + +for await (const chunk of sseStream) { + parser.feed(chunk) +} + +// If you want to re-use the parser for a new stream of events, make sure to reset it! +parser.reset() +console.log('Done!') +``` + +### Retry intervals + +If the server sends a `retry` field in the event stream, the parser will call any `onRetry` callback specified to the `createParser` function: + +```ts +const parser = createParser({ + onRetry(retryInterval) { + console.log('Server requested retry interval of %dms', retryInterval) + }, + onEvent(event) { + // … + }, +}) +``` + +### Parse errors + +If the parser encounters an error while parsing, it will call any `onError` callback provided to the `createParser` function: + +```ts +import {type ParseError} from 'eventsource-parser' + +const parser = createParser({ + onError(error: ParseError) { + console.error('Error parsing event:', error) + if (error.type === 'invalid-field') { + console.error('Field name:', error.field) + console.error('Field value:', error.value) + console.error('Line:', error.line) + } else if (error.type === 'invalid-retry') { + console.error('Invalid retry interval:', error.value) + } + }, + onEvent(event) { + // … + }, +}) +``` + +Note that `invalid-field` errors will usually be called for any invalid data - not only data shaped as `field: value`. This is because the EventSource specification says to treat anything prior to a `:` as the field name. Use the `error.line` property to get the full line that caused the error. + +> [!NOTE] +> When encountering the end of a stream, calling `.reset({consume: true})` on the parser to flush any remaining data and reset the parser state. This will trigger the `onError` callback if the pending data is not a valid event. + +### Comments + +The parser will ignore comments (lines starting with `:`) by default. If you want to handle comments, you can provide an `onComment` callback to the `createParser` function: + +```ts +const parser = createParser({ + onComment(comment) { + console.log('Received comment:', comment) + }, + onEvent(event) { + // … + }, +}) +``` + +> [!NOTE] +> Leading whitespace is not stripped from comments, eg `: comment` will give ` comment` as the comment value, not `comment` (note the leading space). + +## Stream usage + +```ts +import {EventSourceParserStream} from 'eventsource-parser/stream' + +const eventStream = response.body + .pipeThrough(new TextDecoderStream()) + .pipeThrough(new EventSourceParserStream()) +``` + +Note that the TransformStream is exposed under a separate export (`eventsource-parser/stream`), in order to maximize compatibility with environments that do not have the `TransformStream` constructor available. + +## License + +MIT © [Espen Hovlandsdal](https://espen.codes/) diff --git a/front_end/third_party/mcp-sdk/eventsource-parser/package/dist/index.cjs b/front_end/third_party/mcp-sdk/eventsource-parser/package/dist/index.cjs new file mode 100644 index 0000000000..a20bb9afec --- /dev/null +++ b/front_end/third_party/mcp-sdk/eventsource-parser/package/dist/index.cjs @@ -0,0 +1,106 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: !0 }); +class ParseError extends Error { + constructor(message, options) { + super(message), this.name = "ParseError", this.type = options.type, this.field = options.field, this.value = options.value, this.line = options.line; + } +} +function noop(_arg) { +} +function createParser(callbacks) { + if (typeof callbacks == "function") + throw new TypeError( + "`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?" + ); + const { onEvent = noop, onError = noop, onRetry = noop, onComment } = callbacks; + let incompleteLine = "", isFirstChunk = !0, id, data = "", eventType = ""; + function feed(newChunk) { + const chunk = isFirstChunk ? newChunk.replace(/^\xEF\xBB\xBF/, "") : newChunk, [complete, incomplete] = splitLines(`${incompleteLine}${chunk}`); + for (const line of complete) + parseLine(line); + incompleteLine = incomplete, isFirstChunk = !1; + } + function parseLine(line) { + if (line === "") { + dispatchEvent(); + return; + } + if (line.startsWith(":")) { + onComment && onComment(line.slice(line.startsWith(": ") ? 2 : 1)); + return; + } + const fieldSeparatorIndex = line.indexOf(":"); + if (fieldSeparatorIndex !== -1) { + const field = line.slice(0, fieldSeparatorIndex), offset = line[fieldSeparatorIndex + 1] === " " ? 2 : 1, value = line.slice(fieldSeparatorIndex + offset); + processField(field, value, line); + return; + } + processField(line, "", line); + } + function processField(field, value, line) { + switch (field) { + case "event": + eventType = value; + break; + case "data": + data = `${data}${value} +`; + break; + case "id": + id = value.includes("\0") ? void 0 : value; + break; + case "retry": + /^\d+$/.test(value) ? onRetry(parseInt(value, 10)) : onError( + new ParseError(`Invalid \`retry\` value: "${value}"`, { + type: "invalid-retry", + value, + line + }) + ); + break; + default: + onError( + new ParseError( + `Unknown field "${field.length > 20 ? `${field.slice(0, 20)}\u2026` : field}"`, + { type: "unknown-field", field, value, line } + ) + ); + break; + } + } + function dispatchEvent() { + data.length > 0 && onEvent({ + id, + event: eventType || void 0, + // If the data buffer's last character is a U+000A LINE FEED (LF) character, + // then remove the last character from the data buffer. + data: data.endsWith(` +`) ? data.slice(0, -1) : data + }), id = void 0, data = "", eventType = ""; + } + function reset(options = {}) { + incompleteLine && options.consume && parseLine(incompleteLine), isFirstChunk = !0, id = void 0, data = "", eventType = "", incompleteLine = ""; + } + return { feed, reset }; +} +function splitLines(chunk) { + const lines = []; + let incompleteLine = "", searchIndex = 0; + for (; searchIndex < chunk.length; ) { + const crIndex = chunk.indexOf("\r", searchIndex), lfIndex = chunk.indexOf(` +`, searchIndex); + let lineEnd = -1; + if (crIndex !== -1 && lfIndex !== -1 ? lineEnd = Math.min(crIndex, lfIndex) : crIndex !== -1 ? crIndex === chunk.length - 1 ? lineEnd = -1 : lineEnd = crIndex : lfIndex !== -1 && (lineEnd = lfIndex), lineEnd === -1) { + incompleteLine = chunk.slice(searchIndex); + break; + } else { + const line = chunk.slice(searchIndex, lineEnd); + lines.push(line), searchIndex = lineEnd + 1, chunk[searchIndex - 1] === "\r" && chunk[searchIndex] === ` +` && searchIndex++; + } + } + return [lines, incompleteLine]; +} +exports.ParseError = ParseError; +exports.createParser = createParser; +//# sourceMappingURL=index.cjs.map diff --git a/front_end/third_party/mcp-sdk/eventsource-parser/package/dist/index.cjs.map b/front_end/third_party/mcp-sdk/eventsource-parser/package/dist/index.cjs.map new file mode 100644 index 0000000000..8baf186cce --- /dev/null +++ b/front_end/third_party/mcp-sdk/eventsource-parser/package/dist/index.cjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.cjs","sources":["../src/errors.ts","../src/parse.ts"],"sourcesContent":["/**\n * The type of error that occurred.\n * @public\n */\nexport type ErrorType = 'invalid-retry' | 'unknown-field'\n\n/**\n * Error thrown when encountering an issue during parsing.\n *\n * @public\n */\nexport class ParseError extends Error {\n /**\n * The type of error that occurred.\n */\n type: ErrorType\n\n /**\n * In the case of an unknown field encountered in the stream, this will be the field name.\n */\n field?: string | undefined\n\n /**\n * In the case of an unknown field encountered in the stream, this will be the value of the field.\n */\n value?: string | undefined\n\n /**\n * The line that caused the error, if available.\n */\n line?: string | undefined\n\n constructor(\n message: string,\n options: {type: ErrorType; field?: string; value?: string; line?: string},\n ) {\n super(message)\n this.name = 'ParseError'\n this.type = options.type\n this.field = options.field\n this.value = options.value\n this.line = options.line\n }\n}\n","/**\n * EventSource/Server-Sent Events parser\n * @see https://html.spec.whatwg.org/multipage/server-sent-events.html\n */\nimport {ParseError} from './errors.ts'\nimport type {EventSourceParser, ParserCallbacks} from './types.ts'\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction noop(_arg: unknown) {\n // intentional noop\n}\n\n/**\n * Creates a new EventSource parser.\n *\n * @param callbacks - Callbacks to invoke on different parsing events:\n * - `onEvent` when a new event is parsed\n * - `onError` when an error occurs\n * - `onRetry` when a new reconnection interval has been sent from the server\n * - `onComment` when a comment is encountered in the stream\n *\n * @returns A new EventSource parser, with `parse` and `reset` methods.\n * @public\n */\nexport function createParser(callbacks: ParserCallbacks): EventSourceParser {\n if (typeof callbacks === 'function') {\n throw new TypeError(\n '`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?',\n )\n }\n\n const {onEvent = noop, onError = noop, onRetry = noop, onComment} = callbacks\n\n let incompleteLine = ''\n\n let isFirstChunk = true\n let id: string | undefined\n let data = ''\n let eventType = ''\n\n function feed(newChunk: string) {\n // Strip any UTF8 byte order mark (BOM) at the start of the stream\n const chunk = isFirstChunk ? newChunk.replace(/^\\xEF\\xBB\\xBF/, '') : newChunk\n\n // If there was a previous incomplete line, append it to the new chunk,\n // so we may process it together as a new (hopefully complete) chunk.\n const [complete, incomplete] = splitLines(`${incompleteLine}${chunk}`)\n\n for (const line of complete) {\n parseLine(line)\n }\n\n incompleteLine = incomplete\n isFirstChunk = false\n }\n\n function parseLine(line: string) {\n // If the line is empty (a blank line), dispatch the event\n if (line === '') {\n dispatchEvent()\n return\n }\n\n // If the line starts with a U+003A COLON character (:), ignore the line.\n if (line.startsWith(':')) {\n if (onComment) {\n onComment(line.slice(line.startsWith(': ') ? 2 : 1))\n }\n return\n }\n\n // If the line contains a U+003A COLON character (:)\n const fieldSeparatorIndex = line.indexOf(':')\n if (fieldSeparatorIndex !== -1) {\n // Collect the characters on the line before the first U+003A COLON character (:),\n // and let `field` be that string.\n const field = line.slice(0, fieldSeparatorIndex)\n\n // Collect the characters on the line after the first U+003A COLON character (:),\n // and let `value` be that string. If value starts with a U+0020 SPACE character,\n // remove it from value.\n const offset = line[fieldSeparatorIndex + 1] === ' ' ? 2 : 1\n const value = line.slice(fieldSeparatorIndex + offset)\n\n processField(field, value, line)\n return\n }\n\n // Otherwise, the string is not empty but does not contain a U+003A COLON character (:)\n // Process the field using the whole line as the field name, and an empty string as the field value.\n // 👆 This is according to spec. That means that a line that has the value `data` will result in\n // a newline being added to the current `data` buffer, for instance.\n processField(line, '', line)\n }\n\n function processField(field: string, value: string, line: string) {\n // Field names must be compared literally, with no case folding performed.\n switch (field) {\n case 'event':\n // Set the `event type` buffer to field value\n eventType = value\n break\n case 'data':\n // Append the field value to the `data` buffer, then append a single U+000A LINE FEED(LF)\n // character to the `data` buffer.\n data = `${data}${value}\\n`\n break\n case 'id':\n // If the field value does not contain U+0000 NULL, then set the `ID` buffer to\n // the field value. Otherwise, ignore the field.\n id = value.includes('\\0') ? undefined : value\n break\n case 'retry':\n // If the field value consists of only ASCII digits, then interpret the field value as an\n // integer in base ten, and set the event stream's reconnection time to that integer.\n // Otherwise, ignore the field.\n if (/^\\d+$/.test(value)) {\n onRetry(parseInt(value, 10))\n } else {\n onError(\n new ParseError(`Invalid \\`retry\\` value: \"${value}\"`, {\n type: 'invalid-retry',\n value,\n line,\n }),\n )\n }\n break\n default:\n // Otherwise, the field is ignored.\n onError(\n new ParseError(\n `Unknown field \"${field.length > 20 ? `${field.slice(0, 20)}…` : field}\"`,\n {type: 'unknown-field', field, value, line},\n ),\n )\n break\n }\n }\n\n function dispatchEvent() {\n const shouldDispatch = data.length > 0\n if (shouldDispatch) {\n onEvent({\n id,\n event: eventType || undefined,\n // If the data buffer's last character is a U+000A LINE FEED (LF) character,\n // then remove the last character from the data buffer.\n data: data.endsWith('\\n') ? data.slice(0, -1) : data,\n })\n }\n\n // Reset for the next event\n id = undefined\n data = ''\n eventType = ''\n }\n\n function reset(options: {consume?: boolean} = {}) {\n if (incompleteLine && options.consume) {\n parseLine(incompleteLine)\n }\n\n isFirstChunk = true\n id = undefined\n data = ''\n eventType = ''\n incompleteLine = ''\n }\n\n return {feed, reset}\n}\n\n/**\n * For the given `chunk`, split it into lines according to spec, and return any remaining incomplete line.\n *\n * @param chunk - The chunk to split into lines\n * @returns A tuple containing an array of complete lines, and any remaining incomplete line\n * @internal\n */\nfunction splitLines(chunk: string): [complete: Array, incomplete: string] {\n /**\n * According to the spec, a line is terminated by either:\n * - U+000D CARRIAGE RETURN U+000A LINE FEED (CRLF) character pair\n * - a single U+000A LINE FEED(LF) character not preceded by a U+000D CARRIAGE RETURN(CR) character\n * - a single U+000D CARRIAGE RETURN(CR) character not followed by a U+000A LINE FEED(LF) character\n */\n const lines: Array = []\n let incompleteLine = ''\n let searchIndex = 0\n\n while (searchIndex < chunk.length) {\n // Find next line terminator\n const crIndex = chunk.indexOf('\\r', searchIndex)\n const lfIndex = chunk.indexOf('\\n', searchIndex)\n\n // Determine line end\n let lineEnd = -1\n if (crIndex !== -1 && lfIndex !== -1) {\n // CRLF case\n lineEnd = Math.min(crIndex, lfIndex)\n } else if (crIndex !== -1) {\n // CR at the end of a chunk might be part of a CRLF sequence that spans chunks,\n // so we shouldn't treat it as a line terminator (yet)\n if (crIndex === chunk.length - 1) {\n lineEnd = -1\n } else {\n lineEnd = crIndex\n }\n } else if (lfIndex !== -1) {\n lineEnd = lfIndex\n }\n\n // Extract line if terminator found\n if (lineEnd === -1) {\n // No terminator found, rest is incomplete\n incompleteLine = chunk.slice(searchIndex)\n break\n } else {\n const line = chunk.slice(searchIndex, lineEnd)\n lines.push(line)\n\n // Move past line terminator\n searchIndex = lineEnd + 1\n if (chunk[searchIndex - 1]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UAAQ;AAEjC,UAAM,UAAU,MAAM,QAAQ,MAAM,WAAW,GACzC,UAAU,MAAM,QAAQ;AAAA,GAAM,WAAW;AAG/C,QAAI,UAAU;AAiBd,QAhBI,YAAY,MAAM,YAAY,KAEhC,UAAU,KAAK,IAAI,SAAS,OAAO,IAC1B,YAAY,KAGjB,YAAY,MAAM,SAAS,IAC7B,UAAU,KAEV,UAAU,UAEH,YAAY,OACrB,UAAU,UAIR,YAAY,IAAI;AAElB,uBAAiB,MAAM,MAAM,WAAW;AACxC;AAAA,IACF,OAAO;AACL,YAAM,OAAO,MAAM,MAAM,aAAa,OAAO;AAC7C,YAAM,KAAK,IAAI,GAGf,cAAc,UAAU,GACpB,MAAM,cAAc,CAAC,MAAM,QAAQ,MAAM,WAAW,MAAM;AAAA,KAC5D;AAAA,IAEJ;AAAA,EACF;AAEA,SAAO,CAAC,OAAO,cAAc;AAC/B;;;"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/eventsource-parser/package/dist/index.d.cts b/front_end/third_party/mcp-sdk/eventsource-parser/package/dist/index.d.cts new file mode 100644 index 0000000000..0e1e2166ae --- /dev/null +++ b/front_end/third_party/mcp-sdk/eventsource-parser/package/dist/index.d.cts @@ -0,0 +1,144 @@ +/** + * Creates a new EventSource parser. + * + * @param callbacks - Callbacks to invoke on different parsing events: + * - `onEvent` when a new event is parsed + * - `onError` when an error occurs + * - `onRetry` when a new reconnection interval has been sent from the server + * - `onComment` when a comment is encountered in the stream + * + * @returns A new EventSource parser, with `parse` and `reset` methods. + * @public + */ +export declare function createParser(callbacks: ParserCallbacks): EventSourceParser + +/** + * The type of error that occurred. + * @public + */ +export declare type ErrorType = 'invalid-retry' | 'unknown-field' + +/** + * A parsed EventSource message event + * + * @public + */ +export declare interface EventSourceMessage { + /** + * The event type sent from the server. Note that this differs from the browser `EventSource` + * implementation in that browsers will default this to `message`, whereas this parser will + * leave this as `undefined` if not explicitly declared. + */ + event?: string | undefined + /** + * ID of the message, if any was provided by the server. Can be used by clients to keep the + * last received message ID in sync when reconnecting. + */ + id?: string | undefined + /** + * The data received for this message + */ + data: string +} + +/** + * EventSource parser instance. + * + * Needs to be reset between reconnections/when switching data source, using the `reset()` method. + * + * @public + */ +export declare interface EventSourceParser { + /** + * Feeds the parser another chunk. The method _does not_ return a parsed message. + * Instead, callbacks passed when creating the parser will be triggered once we see enough data + * for a valid/invalid parsing step (see {@link ParserCallbacks}). + * + * @param chunk - The chunk to parse. Can be a partial, eg in the case of streaming messages. + * @public + */ + feed(chunk: string): void + /** + * Resets the parser state. This is required when you have a new stream of messages - + * for instance in the case of a client being disconnected and reconnecting. + * + * Previously received, incomplete data will NOT be parsed unless you pass `consume: true`, + * which tells the parser to attempt to consume any incomplete data as if it ended with a newline + * character. This is useful for cases when a server sends a non-EventSource message that you + * want to be able to react to in an `onError` callback. + * + * @public + */ + reset(options?: {consume?: boolean}): void +} + +/** + * Error thrown when encountering an issue during parsing. + * + * @public + */ +export declare class ParseError extends Error { + /** + * The type of error that occurred. + */ + type: ErrorType + /** + * In the case of an unknown field encountered in the stream, this will be the field name. + */ + field?: string | undefined + /** + * In the case of an unknown field encountered in the stream, this will be the value of the field. + */ + value?: string | undefined + /** + * The line that caused the error, if available. + */ + line?: string | undefined + constructor( + message: string, + options: { + type: ErrorType + field?: string + value?: string + line?: string + }, + ) +} + +/** + * Callbacks that can be passed to the parser to handle different types of parsed messages + * and errors. + * + * @public + */ +export declare interface ParserCallbacks { + /** + * Callback for when a new event/message is parsed from the stream. + * This is the main callback that clients will use to handle incoming messages. + * + * @param event - The parsed event/message + */ + onEvent?: ((event: EventSourceMessage) => void) | undefined + /** + * Callback for when the server sends a new reconnection interval through the `retry` field. + * + * @param retry - The number of milliseconds to wait before reconnecting. + */ + onRetry?: ((retry: number) => void) | undefined + /** + * Callback for when a comment is encountered in the stream. + * + * @param comment - The comment encountered in the stream. + */ + onComment?: ((comment: string) => void) | undefined + /** + * Callback for when an error occurs during parsing. This is a catch-all for any errors + * that occur during parsing, and can be used to handle them in a custom way. Most clients + * tend to silently ignore any errors and instead retry, but it can be helpful to log/debug. + * + * @param error - The error that occurred during parsing + */ + onError?: ((error: ParseError) => void) | undefined +} + +export {} diff --git a/front_end/third_party/mcp-sdk/eventsource-parser/package/dist/index.d.ts b/front_end/third_party/mcp-sdk/eventsource-parser/package/dist/index.d.ts new file mode 100644 index 0000000000..0e1e2166ae --- /dev/null +++ b/front_end/third_party/mcp-sdk/eventsource-parser/package/dist/index.d.ts @@ -0,0 +1,144 @@ +/** + * Creates a new EventSource parser. + * + * @param callbacks - Callbacks to invoke on different parsing events: + * - `onEvent` when a new event is parsed + * - `onError` when an error occurs + * - `onRetry` when a new reconnection interval has been sent from the server + * - `onComment` when a comment is encountered in the stream + * + * @returns A new EventSource parser, with `parse` and `reset` methods. + * @public + */ +export declare function createParser(callbacks: ParserCallbacks): EventSourceParser + +/** + * The type of error that occurred. + * @public + */ +export declare type ErrorType = 'invalid-retry' | 'unknown-field' + +/** + * A parsed EventSource message event + * + * @public + */ +export declare interface EventSourceMessage { + /** + * The event type sent from the server. Note that this differs from the browser `EventSource` + * implementation in that browsers will default this to `message`, whereas this parser will + * leave this as `undefined` if not explicitly declared. + */ + event?: string | undefined + /** + * ID of the message, if any was provided by the server. Can be used by clients to keep the + * last received message ID in sync when reconnecting. + */ + id?: string | undefined + /** + * The data received for this message + */ + data: string +} + +/** + * EventSource parser instance. + * + * Needs to be reset between reconnections/when switching data source, using the `reset()` method. + * + * @public + */ +export declare interface EventSourceParser { + /** + * Feeds the parser another chunk. The method _does not_ return a parsed message. + * Instead, callbacks passed when creating the parser will be triggered once we see enough data + * for a valid/invalid parsing step (see {@link ParserCallbacks}). + * + * @param chunk - The chunk to parse. Can be a partial, eg in the case of streaming messages. + * @public + */ + feed(chunk: string): void + /** + * Resets the parser state. This is required when you have a new stream of messages - + * for instance in the case of a client being disconnected and reconnecting. + * + * Previously received, incomplete data will NOT be parsed unless you pass `consume: true`, + * which tells the parser to attempt to consume any incomplete data as if it ended with a newline + * character. This is useful for cases when a server sends a non-EventSource message that you + * want to be able to react to in an `onError` callback. + * + * @public + */ + reset(options?: {consume?: boolean}): void +} + +/** + * Error thrown when encountering an issue during parsing. + * + * @public + */ +export declare class ParseError extends Error { + /** + * The type of error that occurred. + */ + type: ErrorType + /** + * In the case of an unknown field encountered in the stream, this will be the field name. + */ + field?: string | undefined + /** + * In the case of an unknown field encountered in the stream, this will be the value of the field. + */ + value?: string | undefined + /** + * The line that caused the error, if available. + */ + line?: string | undefined + constructor( + message: string, + options: { + type: ErrorType + field?: string + value?: string + line?: string + }, + ) +} + +/** + * Callbacks that can be passed to the parser to handle different types of parsed messages + * and errors. + * + * @public + */ +export declare interface ParserCallbacks { + /** + * Callback for when a new event/message is parsed from the stream. + * This is the main callback that clients will use to handle incoming messages. + * + * @param event - The parsed event/message + */ + onEvent?: ((event: EventSourceMessage) => void) | undefined + /** + * Callback for when the server sends a new reconnection interval through the `retry` field. + * + * @param retry - The number of milliseconds to wait before reconnecting. + */ + onRetry?: ((retry: number) => void) | undefined + /** + * Callback for when a comment is encountered in the stream. + * + * @param comment - The comment encountered in the stream. + */ + onComment?: ((comment: string) => void) | undefined + /** + * Callback for when an error occurs during parsing. This is a catch-all for any errors + * that occur during parsing, and can be used to handle them in a custom way. Most clients + * tend to silently ignore any errors and instead retry, but it can be helpful to log/debug. + * + * @param error - The error that occurred during parsing + */ + onError?: ((error: ParseError) => void) | undefined +} + +export {} diff --git a/front_end/third_party/mcp-sdk/eventsource-parser/package/dist/index.js b/front_end/third_party/mcp-sdk/eventsource-parser/package/dist/index.js new file mode 100644 index 0000000000..3a664596bb --- /dev/null +++ b/front_end/third_party/mcp-sdk/eventsource-parser/package/dist/index.js @@ -0,0 +1,106 @@ +class ParseError extends Error { + constructor(message, options) { + super(message), this.name = "ParseError", this.type = options.type, this.field = options.field, this.value = options.value, this.line = options.line; + } +} +function noop(_arg) { +} +function createParser(callbacks) { + if (typeof callbacks == "function") + throw new TypeError( + "`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?" + ); + const { onEvent = noop, onError = noop, onRetry = noop, onComment } = callbacks; + let incompleteLine = "", isFirstChunk = !0, id, data = "", eventType = ""; + function feed(newChunk) { + const chunk = isFirstChunk ? newChunk.replace(/^\xEF\xBB\xBF/, "") : newChunk, [complete, incomplete] = splitLines(`${incompleteLine}${chunk}`); + for (const line of complete) + parseLine(line); + incompleteLine = incomplete, isFirstChunk = !1; + } + function parseLine(line) { + if (line === "") { + dispatchEvent(); + return; + } + if (line.startsWith(":")) { + onComment && onComment(line.slice(line.startsWith(": ") ? 2 : 1)); + return; + } + const fieldSeparatorIndex = line.indexOf(":"); + if (fieldSeparatorIndex !== -1) { + const field = line.slice(0, fieldSeparatorIndex), offset = line[fieldSeparatorIndex + 1] === " " ? 2 : 1, value = line.slice(fieldSeparatorIndex + offset); + processField(field, value, line); + return; + } + processField(line, "", line); + } + function processField(field, value, line) { + switch (field) { + case "event": + eventType = value; + break; + case "data": + data = `${data}${value} +`; + break; + case "id": + id = value.includes("\0") ? void 0 : value; + break; + case "retry": + /^\d+$/.test(value) ? onRetry(parseInt(value, 10)) : onError( + new ParseError(`Invalid \`retry\` value: "${value}"`, { + type: "invalid-retry", + value, + line + }) + ); + break; + default: + onError( + new ParseError( + `Unknown field "${field.length > 20 ? `${field.slice(0, 20)}\u2026` : field}"`, + { type: "unknown-field", field, value, line } + ) + ); + break; + } + } + function dispatchEvent() { + data.length > 0 && onEvent({ + id, + event: eventType || void 0, + // If the data buffer's last character is a U+000A LINE FEED (LF) character, + // then remove the last character from the data buffer. + data: data.endsWith(` +`) ? data.slice(0, -1) : data + }), id = void 0, data = "", eventType = ""; + } + function reset(options = {}) { + incompleteLine && options.consume && parseLine(incompleteLine), isFirstChunk = !0, id = void 0, data = "", eventType = "", incompleteLine = ""; + } + return { feed, reset }; +} +function splitLines(chunk) { + const lines = []; + let incompleteLine = "", searchIndex = 0; + for (; searchIndex < chunk.length; ) { + const crIndex = chunk.indexOf("\r", searchIndex), lfIndex = chunk.indexOf(` +`, searchIndex); + let lineEnd = -1; + if (crIndex !== -1 && lfIndex !== -1 ? lineEnd = Math.min(crIndex, lfIndex) : crIndex !== -1 ? crIndex === chunk.length - 1 ? lineEnd = -1 : lineEnd = crIndex : lfIndex !== -1 && (lineEnd = lfIndex), lineEnd === -1) { + incompleteLine = chunk.slice(searchIndex); + break; + } else { + const line = chunk.slice(searchIndex, lineEnd); + lines.push(line), searchIndex = lineEnd + 1, chunk[searchIndex - 1] === "\r" && chunk[searchIndex] === ` +` && searchIndex++; + } + } + return [lines, incompleteLine]; +} +export { + ParseError, + createParser +}; +//# sourceMappingURL=index.js.map diff --git a/front_end/third_party/mcp-sdk/eventsource-parser/package/dist/index.js.map b/front_end/third_party/mcp-sdk/eventsource-parser/package/dist/index.js.map new file mode 100644 index 0000000000..af44a8b6f0 --- /dev/null +++ b/front_end/third_party/mcp-sdk/eventsource-parser/package/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sources":["../src/errors.ts","../src/parse.ts"],"sourcesContent":["/**\n * The type of error that occurred.\n * @public\n */\nexport type ErrorType = 'invalid-retry' | 'unknown-field'\n\n/**\n * Error thrown when encountering an issue during parsing.\n *\n * @public\n */\nexport class ParseError extends Error {\n /**\n * The type of error that occurred.\n */\n type: ErrorType\n\n /**\n * In the case of an unknown field encountered in the stream, this will be the field name.\n */\n field?: string | undefined\n\n /**\n * In the case of an unknown field encountered in the stream, this will be the value of the field.\n */\n value?: string | undefined\n\n /**\n * The line that caused the error, if available.\n */\n line?: string | undefined\n\n constructor(\n message: string,\n options: {type: ErrorType; field?: string; value?: string; line?: string},\n ) {\n super(message)\n this.name = 'ParseError'\n this.type = options.type\n this.field = options.field\n this.value = options.value\n this.line = options.line\n }\n}\n","/**\n * EventSource/Server-Sent Events parser\n * @see https://html.spec.whatwg.org/multipage/server-sent-events.html\n */\nimport {ParseError} from './errors.ts'\nimport type {EventSourceParser, ParserCallbacks} from './types.ts'\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction noop(_arg: unknown) {\n // intentional noop\n}\n\n/**\n * Creates a new EventSource parser.\n *\n * @param callbacks - Callbacks to invoke on different parsing events:\n * - `onEvent` when a new event is parsed\n * - `onError` when an error occurs\n * - `onRetry` when a new reconnection interval has been sent from the server\n * - `onComment` when a comment is encountered in the stream\n *\n * @returns A new EventSource parser, with `parse` and `reset` methods.\n * @public\n */\nexport function createParser(callbacks: ParserCallbacks): EventSourceParser {\n if (typeof callbacks === 'function') {\n throw new TypeError(\n '`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?',\n )\n }\n\n const {onEvent = noop, onError = noop, onRetry = noop, onComment} = callbacks\n\n let incompleteLine = ''\n\n let isFirstChunk = true\n let id: string | undefined\n let data = ''\n let eventType = ''\n\n function feed(newChunk: string) {\n // Strip any UTF8 byte order mark (BOM) at the start of the stream\n const chunk = isFirstChunk ? newChunk.replace(/^\\xEF\\xBB\\xBF/, '') : newChunk\n\n // If there was a previous incomplete line, append it to the new chunk,\n // so we may process it together as a new (hopefully complete) chunk.\n const [complete, incomplete] = splitLines(`${incompleteLine}${chunk}`)\n\n for (const line of complete) {\n parseLine(line)\n }\n\n incompleteLine = incomplete\n isFirstChunk = false\n }\n\n function parseLine(line: string) {\n // If the line is empty (a blank line), dispatch the event\n if (line === '') {\n dispatchEvent()\n return\n }\n\n // If the line starts with a U+003A COLON character (:), ignore the line.\n if (line.startsWith(':')) {\n if (onComment) {\n onComment(line.slice(line.startsWith(': ') ? 2 : 1))\n }\n return\n }\n\n // If the line contains a U+003A COLON character (:)\n const fieldSeparatorIndex = line.indexOf(':')\n if (fieldSeparatorIndex !== -1) {\n // Collect the characters on the line before the first U+003A COLON character (:),\n // and let `field` be that string.\n const field = line.slice(0, fieldSeparatorIndex)\n\n // Collect the characters on the line after the first U+003A COLON character (:),\n // and let `value` be that string. If value starts with a U+0020 SPACE character,\n // remove it from value.\n const offset = line[fieldSeparatorIndex + 1] === ' ' ? 2 : 1\n const value = line.slice(fieldSeparatorIndex + offset)\n\n processField(field, value, line)\n return\n }\n\n // Otherwise, the string is not empty but does not contain a U+003A COLON character (:)\n // Process the field using the whole line as the field name, and an empty string as the field value.\n // 👆 This is according to spec. That means that a line that has the value `data` will result in\n // a newline being added to the current `data` buffer, for instance.\n processField(line, '', line)\n }\n\n function processField(field: string, value: string, line: string) {\n // Field names must be compared literally, with no case folding performed.\n switch (field) {\n case 'event':\n // Set the `event type` buffer to field value\n eventType = value\n break\n case 'data':\n // Append the field value to the `data` buffer, then append a single U+000A LINE FEED(LF)\n // character to the `data` buffer.\n data = `${data}${value}\\n`\n break\n case 'id':\n // If the field value does not contain U+0000 NULL, then set the `ID` buffer to\n // the field value. Otherwise, ignore the field.\n id = value.includes('\\0') ? undefined : value\n break\n case 'retry':\n // If the field value consists of only ASCII digits, then interpret the field value as an\n // integer in base ten, and set the event stream's reconnection time to that integer.\n // Otherwise, ignore the field.\n if (/^\\d+$/.test(value)) {\n onRetry(parseInt(value, 10))\n } else {\n onError(\n new ParseError(`Invalid \\`retry\\` value: \"${value}\"`, {\n type: 'invalid-retry',\n value,\n line,\n }),\n )\n }\n break\n default:\n // Otherwise, the field is ignored.\n onError(\n new ParseError(\n `Unknown field \"${field.length > 20 ? `${field.slice(0, 20)}…` : field}\"`,\n {type: 'unknown-field', field, value, line},\n ),\n )\n break\n }\n }\n\n function dispatchEvent() {\n const shouldDispatch = data.length > 0\n if (shouldDispatch) {\n onEvent({\n id,\n event: eventType || undefined,\n // If the data buffer's last character is a U+000A LINE FEED (LF) character,\n // then remove the last character from the data buffer.\n data: data.endsWith('\\n') ? data.slice(0, -1) : data,\n })\n }\n\n // Reset for the next event\n id = undefined\n data = ''\n eventType = ''\n }\n\n function reset(options: {consume?: boolean} = {}) {\n if (incompleteLine && options.consume) {\n parseLine(incompleteLine)\n }\n\n isFirstChunk = true\n id = undefined\n data = ''\n eventType = ''\n incompleteLine = ''\n }\n\n return {feed, reset}\n}\n\n/**\n * For the given `chunk`, split it into lines according to spec, and return any remaining incomplete line.\n *\n * @param chunk - The chunk to split into lines\n * @returns A tuple containing an array of complete lines, and any remaining incomplete line\n * @internal\n */\nfunction splitLines(chunk: string): [complete: Array, incomplete: string] {\n /**\n * According to the spec, a line is terminated by either:\n * - U+000D CARRIAGE RETURN U+000A LINE FEED (CRLF) character pair\n * - a single U+000A LINE FEED(LF) character not preceded by a U+000D CARRIAGE RETURN(CR) character\n * - a single U+000D CARRIAGE RETURN(CR) character not followed by a U+000A LINE FEED(LF) character\n */\n const lines: Array = []\n let incompleteLine = ''\n let searchIndex = 0\n\n while (searchIndex < chunk.length) {\n // Find next line terminator\n const crIndex = chunk.indexOf('\\r', searchIndex)\n const lfIndex = chunk.indexOf('\\n', searchIndex)\n\n // Determine line end\n let lineEnd = -1\n if (crIndex !== -1 && lfIndex !== -1) {\n // CRLF case\n lineEnd = Math.min(crIndex, lfIndex)\n } else if (crIndex !== -1) {\n // CR at the end of a chunk might be part of a CRLF sequence that spans chunks,\n // so we shouldn't treat it as a line terminator (yet)\n if (crIndex === chunk.length - 1) {\n lineEnd = -1\n } else {\n lineEnd = crIndex\n }\n } else if (lfIndex !== -1) {\n lineEnd = lfIndex\n }\n\n // Extract line if terminator found\n if (lineEnd === -1) {\n // No terminator found, rest is incomplete\n incompleteLine = chunk.slice(searchIndex)\n break\n } else {\n const line = chunk.slice(searchIndex, lineEnd)\n lines.push(line)\n\n // Move past line terminator\n searchIndex = lineEnd + 1\n if (chunk[searchIndex - 1] === '\\r' && chunk[searchIndex] === '\\n') {\n searchIndex++\n }\n }\n }\n\n return [lines, incompleteLine]\n}\n"],"names":[],"mappings":"AAWO,MAAM,mBAAmB,MAAM;AAAA,EAqBpC,YACE,SACA,SACA;AACA,UAAM,OAAO,GACb,KAAK,OAAO,cACZ,KAAK,OAAO,QAAQ,MACpB,KAAK,QAAQ,QAAQ,OACrB,KAAK,QAAQ,QAAQ,OACrB,KAAK,OAA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IR,YAAY,IAAI;AAElB,uBAAiB,MAAM,MAAM,WAAW;AACxC;AAAA,IACF,OAAO;AACL,YAAM,OAAO,MAAM,MAAM,aAAa,OAAO;AAC7C,YAAM,KAAK,IAAI,GAGf,cAAc,UAAU,GACpB,MAAM,cAAc,CAAC,MAAM,QAAQ,MAAM,WAAW,MAAM;AAAA,KAC5D;AAAA,IAEJ;AAAA,EACF;AAEA,SAAO,CAAC,OAAO,cAAc;AAC/B;"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/eventsource-parser/package/dist/stream.cjs b/front_end/third_party/mcp-sdk/eventsource-parser/package/dist/stream.cjs new file mode 100644 index 0000000000..894e7467be --- /dev/null +++ b/front_end/third_party/mcp-sdk/eventsource-parser/package/dist/stream.cjs @@ -0,0 +1,28 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: !0 }); +var index = require("./index.cjs"); +class EventSourceParserStream extends TransformStream { + constructor({ onError, onRetry, onComment } = {}) { + let parser; + super({ + start(controller) { + parser = index.createParser({ + onEvent: (event) => { + controller.enqueue(event); + }, + onError(error) { + onError === "terminate" ? controller.error(error) : typeof onError == "function" && onError(error); + }, + onRetry, + onComment + }); + }, + transform(chunk) { + parser.feed(chunk); + } + }); + } +} +exports.ParseError = index.ParseError; +exports.EventSourceParserStream = EventSourceParserStream; +//# sourceMappingURL=stream.cjs.map diff --git a/front_end/third_party/mcp-sdk/eventsource-parser/package/dist/stream.cjs.map b/front_end/third_party/mcp-sdk/eventsource-parser/package/dist/stream.cjs.map new file mode 100644 index 0000000000..a72a95591c --- /dev/null +++ b/front_end/third_party/mcp-sdk/eventsource-parser/package/dist/stream.cjs.map @@ -0,0 +1 @@ +{"version":3,"file":"stream.cjs","sources":["../src/stream.ts"],"sourcesContent":["import {createParser} from './parse.ts'\nimport type {EventSourceMessage, EventSourceParser} from './types.ts'\n\n/**\n * Options for the EventSourceParserStream.\n *\n * @public\n */\nexport interface StreamOptions {\n /**\n * Behavior when a parsing error occurs.\n *\n * - A custom function can be provided to handle the error.\n * - `'terminate'` will error the stream and stop parsing.\n * - Any other value will ignore the error and continue parsing.\n *\n * @defaultValue `undefined`\n */\n onError?: ('terminate' | ((error: Error) => void)) | undefined\n\n /**\n * Callback for when a reconnection interval is sent from the server.\n *\n * @param retry - The number of milliseconds to wait before reconnecting.\n */\n onRetry?: ((retry: number) => void) | undefined\n\n /**\n * Callback for when a comment is encountered in the stream.\n *\n * @param comment - The comment encountered in the stream.\n */\n onComment?: ((comment: string) => void) | undefined\n}\n\n/**\n * A TransformStream that ingests a stream of strings and produces a stream of `EventSourceMessage`.\n *\n * @example Basic usage\n * ```\n * const eventStream =\n * response.body\n * .pipeThrough(new TextDecoderStream())\n * .pipeThrough(new EventSourceParserStream())\n * ```\n *\n * @example Terminate stream on parsing errors\n * ```\n * const eventStream =\n * response.body\n * .pipeThrough(new TextDecoderStream())\n * .pipeThrough(new EventSourceParserStream({terminateOnError: true}))\n * ```\n *\n * @public\n */\nexport class EventSourceParserStream extends TransformStream {\n constructor({onError, onRetry, onComment}: StreamOptions = {}) {\n let parser!: EventSourceParser\n\n super({\n start(controller) {\n parser = createParser({\n onEvent: (event) => {\n controller.enqueue(event)\n },\n onError(error) {\n if (onError === 'terminate') {\n controller.error(error)\n } else if (typeof onError === 'function') {\n onError(error)\n }\n\n // Ignore by default\n },\n onRetry,\n onComment,\n })\n },\n transform(chunk) {\n parser.feed(chunk)\n },\n })\n }\n}\n\nexport {type ErrorType, ParseError} from './errors.ts'\nexport type {EventSourceMessage} from './types.ts'\n"],"names":["createParser"],"mappings":";;;AAwDO,MAAM,gCAAgC,gBAA4C;AAAA,EACvF,YAAY,EAAC,SAAS,SAAS,UAAA,IAA4B,CAAA,GAAI;AAC7D,QAAI;AAEJ,UAAM;AAAA,MACJ,MAAM,YAAY;AAChB,iBAASA,MAAAA,aAAa;AAAA,UACpB,SAAS,CAAC,UAAU;AAClB,uBAAW,QAAQ,KAAK;AAAA,UAC1B;AAAA,UACA,QAAQ,OAAO;AACT,wBAAY,cACd,WAAW,MAAM,KAAK,IACb,OAAO,WAAY,cAC5B,QAAQ,KAAK;AAAA,UAIjB;AAAA,UACA;AAAA,UACA;AAAA,QAAA,CACD;AAAA,MACH;AAAA,MACA,UAAU,OAAO;AACf,eAAO,KAAK,KAAK;AAAA,MACnB;AAAA,IAAA,CACD;AAAA,EACH;AACF;;;"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/eventsource-parser/package/dist/stream.d.cts b/front_end/third_party/mcp-sdk/eventsource-parser/package/dist/stream.d.cts new file mode 100644 index 0000000000..f337d75828 --- /dev/null +++ b/front_end/third_party/mcp-sdk/eventsource-parser/package/dist/stream.d.cts @@ -0,0 +1,118 @@ +/** + * The type of error that occurred. + * @public + */ +export declare type ErrorType = 'invalid-retry' | 'unknown-field' + +/** + * A parsed EventSource message event + * + * @public + */ +export declare interface EventSourceMessage { + /** + * The event type sent from the server. Note that this differs from the browser `EventSource` + * implementation in that browsers will default this to `message`, whereas this parser will + * leave this as `undefined` if not explicitly declared. + */ + event?: string | undefined + /** + * ID of the message, if any was provided by the server. Can be used by clients to keep the + * last received message ID in sync when reconnecting. + */ + id?: string | undefined + /** + * The data received for this message + */ + data: string +} + +/** + * A TransformStream that ingests a stream of strings and produces a stream of `EventSourceMessage`. + * + * @example Basic usage + * ``` + * const eventStream = + * response.body + * .pipeThrough(new TextDecoderStream()) + * .pipeThrough(new EventSourceParserStream()) + * ``` + * + * @example Terminate stream on parsing errors + * ``` + * const eventStream = + * response.body + * .pipeThrough(new TextDecoderStream()) + * .pipeThrough(new EventSourceParserStream({terminateOnError: true})) + * ``` + * + * @public + */ +export declare class EventSourceParserStream extends TransformStream { + constructor({onError, onRetry, onComment}?: StreamOptions) +} + +/** + * Error thrown when encountering an issue during parsing. + * + * @public + */ +export declare class ParseError extends Error { + /** + * The type of error that occurred. + */ + type: ErrorType + /** + * In the case of an unknown field encountered in the stream, this will be the field name. + */ + field?: string | undefined + /** + * In the case of an unknown field encountered in the stream, this will be the value of the field. + */ + value?: string | undefined + /** + * The line that caused the error, if available. + */ + line?: string | undefined + constructor( + message: string, + options: { + type: ErrorType + field?: string + value?: string + line?: string + }, + ) +} + +/** + * Options for the EventSourceParserStream. + * + * @public + */ +export declare interface StreamOptions { + /** + * Behavior when a parsing error occurs. + * + * - A custom function can be provided to handle the error. + * - `'terminate'` will error the stream and stop parsing. + * - Any other value will ignore the error and continue parsing. + * + * @defaultValue `undefined` + */ + onError?: ('terminate' | ((error: Error) => void)) | undefined + /** + * Callback for when a reconnection interval is sent from the server. + * + * @param retry - The number of milliseconds to wait before reconnecting. + */ + onRetry?: ((retry: number) => void) | undefined + /** + * Callback for when a comment is encountered in the stream. + * + * @param comment - The comment encountered in the stream. + */ + onComment?: ((comment: string) => void) | undefined +} + +export {} diff --git a/front_end/third_party/mcp-sdk/eventsource-parser/package/dist/stream.d.ts b/front_end/third_party/mcp-sdk/eventsource-parser/package/dist/stream.d.ts new file mode 100644 index 0000000000..f337d75828 --- /dev/null +++ b/front_end/third_party/mcp-sdk/eventsource-parser/package/dist/stream.d.ts @@ -0,0 +1,118 @@ +/** + * The type of error that occurred. + * @public + */ +export declare type ErrorType = 'invalid-retry' | 'unknown-field' + +/** + * A parsed EventSource message event + * + * @public + */ +export declare interface EventSourceMessage { + /** + * The event type sent from the server. Note that this differs from the browser `EventSource` + * implementation in that browsers will default this to `message`, whereas this parser will + * leave this as `undefined` if not explicitly declared. + */ + event?: string | undefined + /** + * ID of the message, if any was provided by the server. Can be used by clients to keep the + * last received message ID in sync when reconnecting. + */ + id?: string | undefined + /** + * The data received for this message + */ + data: string +} + +/** + * A TransformStream that ingests a stream of strings and produces a stream of `EventSourceMessage`. + * + * @example Basic usage + * ``` + * const eventStream = + * response.body + * .pipeThrough(new TextDecoderStream()) + * .pipeThrough(new EventSourceParserStream()) + * ``` + * + * @example Terminate stream on parsing errors + * ``` + * const eventStream = + * response.body + * .pipeThrough(new TextDecoderStream()) + * .pipeThrough(new EventSourceParserStream({terminateOnError: true})) + * ``` + * + * @public + */ +export declare class EventSourceParserStream extends TransformStream { + constructor({onError, onRetry, onComment}?: StreamOptions) +} + +/** + * Error thrown when encountering an issue during parsing. + * + * @public + */ +export declare class ParseError extends Error { + /** + * The type of error that occurred. + */ + type: ErrorType + /** + * In the case of an unknown field encountered in the stream, this will be the field name. + */ + field?: string | undefined + /** + * In the case of an unknown field encountered in the stream, this will be the value of the field. + */ + value?: string | undefined + /** + * The line that caused the error, if available. + */ + line?: string | undefined + constructor( + message: string, + options: { + type: ErrorType + field?: string + value?: string + line?: string + }, + ) +} + +/** + * Options for the EventSourceParserStream. + * + * @public + */ +export declare interface StreamOptions { + /** + * Behavior when a parsing error occurs. + * + * - A custom function can be provided to handle the error. + * - `'terminate'` will error the stream and stop parsing. + * - Any other value will ignore the error and continue parsing. + * + * @defaultValue `undefined` + */ + onError?: ('terminate' | ((error: Error) => void)) | undefined + /** + * Callback for when a reconnection interval is sent from the server. + * + * @param retry - The number of milliseconds to wait before reconnecting. + */ + onRetry?: ((retry: number) => void) | undefined + /** + * Callback for when a comment is encountered in the stream. + * + * @param comment - The comment encountered in the stream. + */ + onComment?: ((comment: string) => void) | undefined +} + +export {} diff --git a/front_end/third_party/mcp-sdk/eventsource-parser/package/dist/stream.js b/front_end/third_party/mcp-sdk/eventsource-parser/package/dist/stream.js new file mode 100644 index 0000000000..b551fc38a6 --- /dev/null +++ b/front_end/third_party/mcp-sdk/eventsource-parser/package/dist/stream.js @@ -0,0 +1,29 @@ +import { createParser } from "./index.js"; +import { ParseError } from "./index.js"; +class EventSourceParserStream extends TransformStream { + constructor({ onError, onRetry, onComment } = {}) { + let parser; + super({ + start(controller) { + parser = createParser({ + onEvent: (event) => { + controller.enqueue(event); + }, + onError(error) { + onError === "terminate" ? controller.error(error) : typeof onError == "function" && onError(error); + }, + onRetry, + onComment + }); + }, + transform(chunk) { + parser.feed(chunk); + } + }); + } +} +export { + EventSourceParserStream, + ParseError +}; +//# sourceMappingURL=stream.js.map diff --git a/front_end/third_party/mcp-sdk/eventsource-parser/package/dist/stream.js.map b/front_end/third_party/mcp-sdk/eventsource-parser/package/dist/stream.js.map new file mode 100644 index 0000000000..1a83826117 --- /dev/null +++ b/front_end/third_party/mcp-sdk/eventsource-parser/package/dist/stream.js.map @@ -0,0 +1 @@ +{"version":3,"file":"stream.js","sources":["../src/stream.ts"],"sourcesContent":["import {createParser} from './parse.ts'\nimport type {EventSourceMessage, EventSourceParser} from './types.ts'\n\n/**\n * Options for the EventSourceParserStream.\n *\n * @public\n */\nexport interface StreamOptions {\n /**\n * Behavior when a parsing error occurs.\n *\n * - A custom function can be provided to handle the error.\n * - `'terminate'` will error the stream and stop parsing.\n * - Any other value will ignore the error and continue parsing.\n *\n * @defaultValue `undefined`\n */\n onError?: ('terminate' | ((error: Error) => void)) | undefined\n\n /**\n * Callback for when a reconnection interval is sent from the server.\n *\n * @param retry - The number of milliseconds to wait before reconnecting.\n */\n onRetry?: ((retry: number) => void) | undefined\n\n /**\n * Callback for when a comment is encountered in the stream.\n *\n * @param comment - The comment encountered in the stream.\n */\n onComment?: ((comment: string) => void) | undefined\n}\n\n/**\n * A TransformStream that ingests a stream of strings and produces a stream of `EventSourceMessage`.\n *\n * @example Basic usage\n * ```\n * const eventStream =\n * response.body\n * .pipeThrough(new TextDecoderStream())\n * .pipeThrough(new EventSourceParserStream())\n * ```\n *\n * @example Terminate stream on parsing errors\n * ```\n * const eventStream =\n * response.body\n * .pipeThrough(new TextDecoderStream())\n * .pipeThrough(new EventSourceParserStream({terminateOnError: true}))\n * ```\n *\n * @public\n */\nexport class EventSourceParserStream extends TransformStream {\n constructor({onError, onRetry, onComment}: StreamOptions = {}) {\n let parser!: EventSourceParser\n\n super({\n start(controller) {\n parser = createParser({\n onEvent: (event) => {\n controller.enqueue(event)\n },\n onError(error) {\n if (onError === 'terminate') {\n controller.error(error)\n } else if (typeof onError === 'function') {\n onError(error)\n }\n\n // Ignore by default\n },\n onRetry,\n onComment,\n })\n },\n transform(chunk) {\n parser.feed(chunk)\n },\n })\n }\n}\n\nexport {type ErrorType, ParseError} from './errors.ts'\nexport type {EventSourceMessage} from './types.ts'\n"],"names":[],"mappings":";;AAwDO,MAAM,gCAAgC,gBAA4C;AAAA,EACvF,YAAY,EAAC,SAAS,SAAS,UAAA,IAA4B,CAAA,GAAI;AAC7D,QAAI;AAEJ,UAAM;AAAA,MACJ,MAAM,YAAY;AAChB,iBAAS,aAAa;AAAA,UACpB,SAAS,CAAC,UAAU;AAClB,uBAAW,QAAQ,KAAK;AAAA,UAC1B;AAAA,UACA,QAAQ,OAAO;AACT,wBAAY,cACd,WAAW,MAAM,KAAK,IACb,OAAO,WAAY,cAC5B,QAAQ,KAAK;AAAA,UAIjB;AAAA,UACA;AAAA,UACA;AAAA,QAAA,CACD;AAAA,MACH;AAAA,MACA,UAAU,OAAO;AACf,eAAO,KAAK,KAAK;AAAA,MACnB;AAAA,IAAA,CACD;AAAA,EACH;AACF;"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/eventsource-parser/package/package.json b/front_end/third_party/mcp-sdk/eventsource-parser/package/package.json new file mode 100644 index 0000000000..e8a3635100 --- /dev/null +++ b/front_end/third_party/mcp-sdk/eventsource-parser/package/package.json @@ -0,0 +1,115 @@ +{ + "name": "eventsource-parser", + "version": "3.0.6", + "description": "Streaming, source-agnostic EventSource/Server-Sent Events parser", + "sideEffects": false, + "type": "module", + "types": "./dist/index.d.ts", + "module": "./dist/index.js", + "main": "./dist/index.cjs", + "exports": { + ".": { + "source": "./src/index.ts", + "import": "./dist/index.js", + "require": "./dist/index.cjs", + "default": "./dist/index.js" + }, + "./stream": { + "source": "./src/stream.ts", + "import": "./dist/stream.js", + "require": "./dist/stream.cjs", + "default": "./dist/stream.js" + }, + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "stream": [ + "./dist/stream.d.ts" + ] + } + }, + "engines": { + "node": ">=18.0.0" + }, + "browserslist": [ + "node >= 20", + "chrome >= 71", + "safari >= 14.1", + "firefox >= 105", + "edge >= 79" + ], + "files": [ + "dist", + "!dist/stats.html", + "src", + "stream.js" + ], + "scripts": { + "build": "pkg-utils build && pkg-utils --strict", + "clean": "rimraf dist coverage", + "lint": "eslint . && tsc --noEmit", + "posttest": "npm run lint", + "prebuild": "npm run clean", + "prepublishOnly": "npm run build", + "test": "npm run test:node", + "test:bun": "bun test", + "test:deno": "deno run --allow-write --allow-net --allow-run --allow-sys --allow-ffi --allow-env --allow-read npm:vitest", + "test:node": "vitest --reporter=verbose" + }, + "author": "Espen Hovlandsdal ", + "keywords": [ + "sse", + "eventsource", + "server-sent-events" + ], + "devDependencies": { + "@sanity/pkg-utils": "^8.0.0", + "@sanity/semantic-release-preset": "^5.0.0", + "@types/node": "^20.19.0", + "@typescript-eslint/eslint-plugin": "^7.0.0", + "@typescript-eslint/parser": "^7.0.0", + "eslint": "^8.51.0", + "eslint-config-prettier": "^9.1.0", + "eslint-config-sanity": "^7.1.2", + "eventsource-encoder": "^1.0.1", + "prettier": "^3.5.3", + "rimraf": "^6.0.1", + "rollup-plugin-visualizer": "^6.0.3", + "semantic-release": "^24.2.3", + "typescript": "^5.8.3", + "vitest": "^3.1.3" + }, + "homepage": "https://github.com/rexxars/eventsource-parser#readme", + "bugs": { + "url": "https://github.com/rexxars/eventsource-parser/issues" + }, + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/rexxars/eventsource-parser.git" + }, + "license": "MIT", + "prettier": { + "bracketSpacing": false, + "printWidth": 100, + "semi": false, + "singleQuote": true + }, + "eslintConfig": { + "parserOptions": { + "ecmaFeatures": { + "modules": true + }, + "ecmaVersion": 9, + "sourceType": "module" + }, + "extends": [ + "sanity", + "sanity/typescript", + "prettier" + ], + "ignorePatterns": [ + "lib/**/" + ] + } +} diff --git a/front_end/third_party/mcp-sdk/eventsource-parser/package/src/errors.ts b/front_end/third_party/mcp-sdk/eventsource-parser/package/src/errors.ts new file mode 100644 index 0000000000..04cd292dbf --- /dev/null +++ b/front_end/third_party/mcp-sdk/eventsource-parser/package/src/errors.ts @@ -0,0 +1,44 @@ +/** + * The type of error that occurred. + * @public + */ +export type ErrorType = 'invalid-retry' | 'unknown-field' + +/** + * Error thrown when encountering an issue during parsing. + * + * @public + */ +export class ParseError extends Error { + /** + * The type of error that occurred. + */ + type: ErrorType + + /** + * In the case of an unknown field encountered in the stream, this will be the field name. + */ + field?: string | undefined + + /** + * In the case of an unknown field encountered in the stream, this will be the value of the field. + */ + value?: string | undefined + + /** + * The line that caused the error, if available. + */ + line?: string | undefined + + constructor( + message: string, + options: {type: ErrorType; field?: string; value?: string; line?: string}, + ) { + super(message) + this.name = 'ParseError' + this.type = options.type + this.field = options.field + this.value = options.value + this.line = options.line + } +} diff --git a/front_end/third_party/mcp-sdk/eventsource-parser/package/src/index.ts b/front_end/third_party/mcp-sdk/eventsource-parser/package/src/index.ts new file mode 100644 index 0000000000..ac3328ef2b --- /dev/null +++ b/front_end/third_party/mcp-sdk/eventsource-parser/package/src/index.ts @@ -0,0 +1,3 @@ +export {type ErrorType, ParseError} from './errors.ts' +export {createParser} from './parse.ts' +export type {EventSourceMessage, EventSourceParser, ParserCallbacks} from './types.ts' diff --git a/front_end/third_party/mcp-sdk/eventsource-parser/package/src/parse.ts b/front_end/third_party/mcp-sdk/eventsource-parser/package/src/parse.ts new file mode 100644 index 0000000000..872309407a --- /dev/null +++ b/front_end/third_party/mcp-sdk/eventsource-parser/package/src/parse.ts @@ -0,0 +1,232 @@ +/** + * EventSource/Server-Sent Events parser + * @see https://html.spec.whatwg.org/multipage/server-sent-events.html + */ +import {ParseError} from './errors.ts' +import type {EventSourceParser, ParserCallbacks} from './types.ts' + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function noop(_arg: unknown) { + // intentional noop +} + +/** + * Creates a new EventSource parser. + * + * @param callbacks - Callbacks to invoke on different parsing events: + * - `onEvent` when a new event is parsed + * - `onError` when an error occurs + * - `onRetry` when a new reconnection interval has been sent from the server + * - `onComment` when a comment is encountered in the stream + * + * @returns A new EventSource parser, with `parse` and `reset` methods. + * @public + */ +export function createParser(callbacks: ParserCallbacks): EventSourceParser { + if (typeof callbacks === 'function') { + throw new TypeError( + '`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?', + ) + } + + const {onEvent = noop, onError = noop, onRetry = noop, onComment} = callbacks + + let incompleteLine = '' + + let isFirstChunk = true + let id: string | undefined + let data = '' + let eventType = '' + + function feed(newChunk: string) { + // Strip any UTF8 byte order mark (BOM) at the start of the stream + const chunk = isFirstChunk ? newChunk.replace(/^\xEF\xBB\xBF/, '') : newChunk + + // If there was a previous incomplete line, append it to the new chunk, + // so we may process it together as a new (hopefully complete) chunk. + const [complete, incomplete] = splitLines(`${incompleteLine}${chunk}`) + + for (const line of complete) { + parseLine(line) + } + + incompleteLine = incomplete + isFirstChunk = false + } + + function parseLine(line: string) { + // If the line is empty (a blank line), dispatch the event + if (line === '') { + dispatchEvent() + return + } + + // If the line starts with a U+003A COLON character (:), ignore the line. + if (line.startsWith(':')) { + if (onComment) { + onComment(line.slice(line.startsWith(': ') ? 2 : 1)) + } + return + } + + // If the line contains a U+003A COLON character (:) + const fieldSeparatorIndex = line.indexOf(':') + if (fieldSeparatorIndex !== -1) { + // Collect the characters on the line before the first U+003A COLON character (:), + // and let `field` be that string. + const field = line.slice(0, fieldSeparatorIndex) + + // Collect the characters on the line after the first U+003A COLON character (:), + // and let `value` be that string. If value starts with a U+0020 SPACE character, + // remove it from value. + const offset = line[fieldSeparatorIndex + 1] === ' ' ? 2 : 1 + const value = line.slice(fieldSeparatorIndex + offset) + + processField(field, value, line) + return + } + + // Otherwise, the string is not empty but does not contain a U+003A COLON character (:) + // Process the field using the whole line as the field name, and an empty string as the field value. + // 👆 This is according to spec. That means that a line that has the value `data` will result in + // a newline being added to the current `data` buffer, for instance. + processField(line, '', line) + } + + function processField(field: string, value: string, line: string) { + // Field names must be compared literally, with no case folding performed. + switch (field) { + case 'event': + // Set the `event type` buffer to field value + eventType = value + break + case 'data': + // Append the field value to the `data` buffer, then append a single U+000A LINE FEED(LF) + // character to the `data` buffer. + data = `${data}${value}\n` + break + case 'id': + // If the field value does not contain U+0000 NULL, then set the `ID` buffer to + // the field value. Otherwise, ignore the field. + id = value.includes('\0') ? undefined : value + break + case 'retry': + // If the field value consists of only ASCII digits, then interpret the field value as an + // integer in base ten, and set the event stream's reconnection time to that integer. + // Otherwise, ignore the field. + if (/^\d+$/.test(value)) { + onRetry(parseInt(value, 10)) + } else { + onError( + new ParseError(`Invalid \`retry\` value: "${value}"`, { + type: 'invalid-retry', + value, + line, + }), + ) + } + break + default: + // Otherwise, the field is ignored. + onError( + new ParseError( + `Unknown field "${field.length > 20 ? `${field.slice(0, 20)}…` : field}"`, + {type: 'unknown-field', field, value, line}, + ), + ) + break + } + } + + function dispatchEvent() { + const shouldDispatch = data.length > 0 + if (shouldDispatch) { + onEvent({ + id, + event: eventType || undefined, + // If the data buffer's last character is a U+000A LINE FEED (LF) character, + // then remove the last character from the data buffer. + data: data.endsWith('\n') ? data.slice(0, -1) : data, + }) + } + + // Reset for the next event + id = undefined + data = '' + eventType = '' + } + + function reset(options: {consume?: boolean} = {}) { + if (incompleteLine && options.consume) { + parseLine(incompleteLine) + } + + isFirstChunk = true + id = undefined + data = '' + eventType = '' + incompleteLine = '' + } + + return {feed, reset} +} + +/** + * For the given `chunk`, split it into lines according to spec, and return any remaining incomplete line. + * + * @param chunk - The chunk to split into lines + * @returns A tuple containing an array of complete lines, and any remaining incomplete line + * @internal + */ +function splitLines(chunk: string): [complete: Array, incomplete: string] { + /** + * According to the spec, a line is terminated by either: + * - U+000D CARRIAGE RETURN U+000A LINE FEED (CRLF) character pair + * - a single U+000A LINE FEED(LF) character not preceded by a U+000D CARRIAGE RETURN(CR) character + * - a single U+000D CARRIAGE RETURN(CR) character not followed by a U+000A LINE FEED(LF) character + */ + const lines: Array = [] + let incompleteLine = '' + let searchIndex = 0 + + while (searchIndex < chunk.length) { + // Find next line terminator + const crIndex = chunk.indexOf('\r', searchIndex) + const lfIndex = chunk.indexOf('\n', searchIndex) + + // Determine line end + let lineEnd = -1 + if (crIndex !== -1 && lfIndex !== -1) { + // CRLF case + lineEnd = Math.min(crIndex, lfIndex) + } else if (crIndex !== -1) { + // CR at the end of a chunk might be part of a CRLF sequence that spans chunks, + // so we shouldn't treat it as a line terminator (yet) + if (crIndex === chunk.length - 1) { + lineEnd = -1 + } else { + lineEnd = crIndex + } + } else if (lfIndex !== -1) { + lineEnd = lfIndex + } + + // Extract line if terminator found + if (lineEnd === -1) { + // No terminator found, rest is incomplete + incompleteLine = chunk.slice(searchIndex) + break + } else { + const line = chunk.slice(searchIndex, lineEnd) + lines.push(line) + + // Move past line terminator + searchIndex = lineEnd + 1 + if (chunk[searchIndex - 1] === '\r' && chunk[searchIndex] === '\n') { + searchIndex++ + } + } + } + + return [lines, incompleteLine] +} diff --git a/front_end/third_party/mcp-sdk/eventsource-parser/package/src/stream.ts b/front_end/third_party/mcp-sdk/eventsource-parser/package/src/stream.ts new file mode 100644 index 0000000000..29887d5f8a --- /dev/null +++ b/front_end/third_party/mcp-sdk/eventsource-parser/package/src/stream.ts @@ -0,0 +1,88 @@ +import {createParser} from './parse.ts' +import type {EventSourceMessage, EventSourceParser} from './types.ts' + +/** + * Options for the EventSourceParserStream. + * + * @public + */ +export interface StreamOptions { + /** + * Behavior when a parsing error occurs. + * + * - A custom function can be provided to handle the error. + * - `'terminate'` will error the stream and stop parsing. + * - Any other value will ignore the error and continue parsing. + * + * @defaultValue `undefined` + */ + onError?: ('terminate' | ((error: Error) => void)) | undefined + + /** + * Callback for when a reconnection interval is sent from the server. + * + * @param retry - The number of milliseconds to wait before reconnecting. + */ + onRetry?: ((retry: number) => void) | undefined + + /** + * Callback for when a comment is encountered in the stream. + * + * @param comment - The comment encountered in the stream. + */ + onComment?: ((comment: string) => void) | undefined +} + +/** + * A TransformStream that ingests a stream of strings and produces a stream of `EventSourceMessage`. + * + * @example Basic usage + * ``` + * const eventStream = + * response.body + * .pipeThrough(new TextDecoderStream()) + * .pipeThrough(new EventSourceParserStream()) + * ``` + * + * @example Terminate stream on parsing errors + * ``` + * const eventStream = + * response.body + * .pipeThrough(new TextDecoderStream()) + * .pipeThrough(new EventSourceParserStream({terminateOnError: true})) + * ``` + * + * @public + */ +export class EventSourceParserStream extends TransformStream { + constructor({onError, onRetry, onComment}: StreamOptions = {}) { + let parser!: EventSourceParser + + super({ + start(controller) { + parser = createParser({ + onEvent: (event) => { + controller.enqueue(event) + }, + onError(error) { + if (onError === 'terminate') { + controller.error(error) + } else if (typeof onError === 'function') { + onError(error) + } + + // Ignore by default + }, + onRetry, + onComment, + }) + }, + transform(chunk) { + parser.feed(chunk) + }, + }) + } +} + +export {type ErrorType, ParseError} from './errors.ts' +export type {EventSourceMessage} from './types.ts' diff --git a/front_end/third_party/mcp-sdk/eventsource-parser/package/src/types.ts b/front_end/third_party/mcp-sdk/eventsource-parser/package/src/types.ts new file mode 100644 index 0000000000..2c87def861 --- /dev/null +++ b/front_end/third_party/mcp-sdk/eventsource-parser/package/src/types.ts @@ -0,0 +1,97 @@ +import type {ParseError} from './errors.ts' + +/** + * EventSource parser instance. + * + * Needs to be reset between reconnections/when switching data source, using the `reset()` method. + * + * @public + */ +export interface EventSourceParser { + /** + * Feeds the parser another chunk. The method _does not_ return a parsed message. + * Instead, callbacks passed when creating the parser will be triggered once we see enough data + * for a valid/invalid parsing step (see {@link ParserCallbacks}). + * + * @param chunk - The chunk to parse. Can be a partial, eg in the case of streaming messages. + * @public + */ + feed(chunk: string): void + + /** + * Resets the parser state. This is required when you have a new stream of messages - + * for instance in the case of a client being disconnected and reconnecting. + * + * Previously received, incomplete data will NOT be parsed unless you pass `consume: true`, + * which tells the parser to attempt to consume any incomplete data as if it ended with a newline + * character. This is useful for cases when a server sends a non-EventSource message that you + * want to be able to react to in an `onError` callback. + * + * @public + */ + reset(options?: {consume?: boolean}): void +} + +/** + * A parsed EventSource message event + * + * @public + */ +export interface EventSourceMessage { + /** + * The event type sent from the server. Note that this differs from the browser `EventSource` + * implementation in that browsers will default this to `message`, whereas this parser will + * leave this as `undefined` if not explicitly declared. + */ + event?: string | undefined + + /** + * ID of the message, if any was provided by the server. Can be used by clients to keep the + * last received message ID in sync when reconnecting. + */ + id?: string | undefined + + /** + * The data received for this message + */ + data: string +} + +/** + * Callbacks that can be passed to the parser to handle different types of parsed messages + * and errors. + * + * @public + */ +export interface ParserCallbacks { + /** + * Callback for when a new event/message is parsed from the stream. + * This is the main callback that clients will use to handle incoming messages. + * + * @param event - The parsed event/message + */ + onEvent?: ((event: EventSourceMessage) => void) | undefined + + /** + * Callback for when the server sends a new reconnection interval through the `retry` field. + * + * @param retry - The number of milliseconds to wait before reconnecting. + */ + onRetry?: ((retry: number) => void) | undefined + + /** + * Callback for when a comment is encountered in the stream. + * + * @param comment - The comment encountered in the stream. + */ + onComment?: ((comment: string) => void) | undefined + + /** + * Callback for when an error occurs during parsing. This is a catch-all for any errors + * that occur during parsing, and can be used to handle them in a custom way. Most clients + * tend to silently ignore any errors and instead retry, but it can be helpful to log/debug. + * + * @param error - The error that occurred during parsing + */ + onError?: ((error: ParseError) => void) | undefined +} diff --git a/front_end/third_party/mcp-sdk/eventsource-parser/package/stream.js b/front_end/third_party/mcp-sdk/eventsource-parser/package/stream.js new file mode 100644 index 0000000000..98d74bcf31 --- /dev/null +++ b/front_end/third_party/mcp-sdk/eventsource-parser/package/stream.js @@ -0,0 +1,2 @@ +/* included for compatibility with react-native without package exports support */ +module.exports = require('./dist/stream.cjs') diff --git a/front_end/third_party/mcp-sdk/mcp-sdk-tsconfig.json b/front_end/third_party/mcp-sdk/mcp-sdk-tsconfig.json new file mode 100644 index 0000000000..23b574d6a5 --- /dev/null +++ b/front_end/third_party/mcp-sdk/mcp-sdk-tsconfig.json @@ -0,0 +1,38 @@ +{ + "compilerOptions": { + "allowJs": true, + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "checkJs": false, + "composite": true, + "declaration": true, + "declarationMap": true, + "exactOptionalPropertyTypes": false, + "experimentalDecorators": true, + "forceConsistentCasingInFileNames": true, + "lib": [ + "esnext", + "dom", + "dom.iterable" + ], + "module": "esnext", + "moduleResolution": "node", + "noEmitOnError": true, + "noFallthroughCasesInSwitch": true, + "noImplicitOverride": true, + "noImplicitReturns": true, + "noUnusedLocals": false, + "noUnusedParameters": false, + "preserveConstEnums": true, + "removeComments": false, + "resolveJsonModule": true, + "sourceMap": true, + "strict": true, + "target": "es2020", + "tsBuildInfoFile": "mcp-sdk-tsconfig.tsbuildinfo", + "types": [], + "useDefineForClassFields": false + }, + "files": [], + "references": [] +} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/mcp-sdk.ts b/front_end/third_party/mcp-sdk/mcp-sdk.ts new file mode 100644 index 0000000000..5702ffe48c --- /dev/null +++ b/front_end/third_party/mcp-sdk/mcp-sdk.ts @@ -0,0 +1,213 @@ +// Copyright 2025 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import { Client as MCPSDKClient } from './package/dist/client/index.js'; +import { SSEClientTransport } from './package/dist/client/sse.js'; +import type { Transport } from './package/dist/shared/transport.js'; +import type { Request, RequestId } from './package/dist/types.js'; + +// Simple logger for this module - we can't use the DevTools logger from third_party +const logger = { + info: (...args: any[]) => console.log('[MCPClientSDK]', ...args), + warn: (...args: any[]) => console.warn('[MCPClientSDK]', ...args), + error: (...args: any[]) => console.error('[MCPClientSDK]', ...args), + debug: (...args: any[]) => console.debug('[MCPClientSDK]', ...args), +}; + +export interface MCPServer { + id: string; + endpoint: string; + token?: string; +} + +export interface MCPToolDef { + name: string; + description: string; + inputSchema: Record; +} + +interface Connection { + server: MCPServer; + connected: boolean; + client: MCPSDKClient; + transport: Transport; +} + +// Custom transport for DevTools that uses fetch with eventsource-parser for SSE handling +class DevToolsStreamableTransport implements Transport { + private url: URL; + private token?: string; + private abortController: AbortController | null = null; + + // Transport interface callbacks + onclose?: () => void; + onerror?: (error: Error) => void; + onmessage?: (message: Request, extra?: any) => void; + sessionId?: string; + + constructor(endpoint: string, token?: string) { + this.url = new URL(endpoint); + this.token = token; + + // Convert SSE endpoints to streamable HTTP endpoints + if (this.url.pathname.endsWith('/sse')) { + this.url.pathname = this.url.pathname.replace('/sse', '/mcp'); + } + } + + async start(): Promise { + logger.info('Starting DevTools transport', { endpoint: this.url.toString() }); + // Transport initialization handled by SDK + } + + async send(message: Request, options?: any): Promise { + logger.debug('Sending message via DevTools transport', { message }); + // In practice, this would send the message via fetch POST + // For now, throw to indicate this fallback transport is not fully implemented + throw new Error('DevToolsStreamableTransport.send() not implemented - use SDK transport instead'); + } + + async close(): Promise { + if (this.abortController) { + this.abortController.abort(); + this.abortController = null; + } + + if (this.onclose) { + this.onclose(); + } + } +} + +export class MCPClientSDK { + private connections = new Map(); + + async connect(server: MCPServer): Promise { + logger.info('Connecting to MCP server using SDK', { endpoint: server.endpoint }); + + // Create transport - prefer streamable HTTP for better browser compatibility + let transport: Transport; + + try { + // Use SSE transport for connecting to MCP servers + transport = new SSEClientTransport(new URL(server.endpoint)); + } catch (error) { + // Fallback to our custom transport if SDK transport fails + logger.warn('SDK transport failed, using custom transport', { error }); + transport = new DevToolsStreamableTransport(server.endpoint, server.token); + } + + // Create SDK client + const client = new MCPSDKClient( + { + name: 'chrome-devtools', + version: '1.0.0', + }, + { + capabilities: {} + } + ); + + try { + await client.connect(transport); + + const connection: Connection = { + server, + connected: true, + client, + transport, + }; + + this.connections.set(server.id, connection); + logger.info('Connected to MCP server via SDK', { serverId: server.id }); + + } catch (error) { + logger.error('Failed to connect via SDK', { error, endpoint: server.endpoint }); + throw error; + } + } + + disconnect(serverId: string): void { + const connection = this.connections.get(serverId); + if (!connection) { + return; + } + + logger.info('Disconnecting MCP server', { serverId }); + + try { + connection.transport.close(); + } catch (error) { + logger.warn('Error closing transport', { error }); + } + + this.connections.delete(serverId); + } + + isConnected(serverId: string): boolean { + return this.connections.get(serverId)?.connected === true; + } + + async listTools(serverId: string): Promise { + const connection = this.connections.get(serverId); + if (!connection) { + throw new Error(`No connection for server ${serverId}`); + } + + try { + logger.debug('Listing tools via SDK', { serverId }); + const result = await connection.client.listTools(); + + // Convert SDK response to our format + const tools: MCPToolDef[] = (result.tools || []).map((tool: any) => ({ + name: tool.name, + description: tool.description || '', + inputSchema: tool.inputSchema || {}, + })); + + logger.info('Listed tools via SDK', { serverId, toolCount: tools.length }); + return tools; + + } catch (error) { + logger.error('Failed to list tools via SDK', { serverId, error }); + throw new Error(`Failed to list tools: ${error instanceof Error ? error.message : error}`); + } + } + + setCachedTools(serverId: string, tools: MCPToolDef[]): void { + // SDK handles tool caching internally + logger.debug('setCachedTools called (SDK handles caching)', { serverId, toolCount: tools.length }); + } + + async callTool( + serverId: string, + name: string, + args: any, + _opts?: { timeoutMs?: number } + ): Promise { + const connection = this.connections.get(serverId); + if (!connection) { + throw new Error(`No connection for server ${serverId}`); + } + + try { + logger.debug('Calling tool via SDK', { serverId, toolName: name, args }); + + const result = await connection.client.callTool({ + name, + arguments: args ?? {}, + }); + + logger.info('Tool call successful via SDK', { serverId, toolName: name }); + return result as T; + + } catch (error) { + logger.error('Tool call failed via SDK', { serverId, toolName: name, error }); + throw error; + } + } +} + +// Export the SDK client as default to replace the current MCPClient +export { MCPClientSDK as MCPClient }; \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/LICENSE b/front_end/third_party/mcp-sdk/package/LICENSE new file mode 100644 index 0000000000..3d48435454 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Anthropic, PBC + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/front_end/third_party/mcp-sdk/package/README.md b/front_end/third_party/mcp-sdk/package/README.md new file mode 100644 index 0000000000..76c45ab9de --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/README.md @@ -0,0 +1,117 @@ +# MCP TypeScript SDK ![NPM Version](https://img.shields.io/npm/v/%40modelcontextprotocol%2Fsdk) + +TypeScript implementation of the [Model Context Protocol](https://modelcontextprotocol.io) (MCP), providing both client and server capabilities for integrating with LLM surfaces. + +## Overview + +The Model Context Protocol allows applications to provide context for LLMs in a standardized way, separating the concerns of providing context from the actual LLM interaction. This TypeScript SDK implements the full MCP specification, making it easy to: + +- Build MCP clients that can connect to any MCP server +- Create MCP servers that expose resources, prompts and tools +- Use standard transports like stdio and SSE +- Handle all MCP protocol messages and lifecycle events + +## Installation + +```bash +npm install @modelcontextprotocol/sdk +``` + +## Quick Start + +### Creating a Client + +```typescript +import { Client } from "@modelcontextprotocol/sdk/client/index.js"; +import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js"; + +const transport = new StdioClientTransport({ + command: "path/to/server", +}); + +const client = new Client({ + name: "example-client", + version: "1.0.0", +}, { + capabilities: {} +}); + +await client.connect(transport); + +// List available resources +const resources = await client.request( + { method: "resources/list" }, + ListResourcesResultSchema +); + +// Read a specific resource +const resourceContent = await client.request( + { + method: "resources/read", + params: { + uri: "file:///example.txt" + } + }, + ReadResourceResultSchema +); +``` + +### Creating a Server + +```typescript +import { Server } from "@modelcontextprotocol/sdk/server/index.js"; +import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; + +const server = new Server({ + name: "example-server", + version: "1.0.0", +}, { + capabilities: { + resources: {} + } +}); + +server.setRequestHandler(ListResourcesRequestSchema, async () => { + return { + resources: [ + { + uri: "file:///example.txt", + name: "Example Resource", + }, + ], + }; +}); + +server.setRequestHandler(ReadResourceRequestSchema, async (request) => { + if (request.params.uri === "file:///example.txt") { + return { + contents: [ + { + uri: "file:///example.txt", + mimeType: "text/plain", + text: "This is the content of the example resource.", + }, + ], + }; + } else { + throw new Error("Resource not found"); + } +}); + +const transport = new StdioServerTransport(); +await server.connect(transport); +``` + +## Documentation + +- [Model Context Protocol documentation](https://modelcontextprotocol.io) +- [MCP Specification](https://spec.modelcontextprotocol.io) +- [Example Servers](https://github.com/modelcontextprotocol/servers) + +## Contributing + +Issues and pull requests are welcome on GitHub at https://github.com/modelcontextprotocol/typescript-sdk. + +## License + +This project is licensed under the MIT License—see the [LICENSE](LICENSE) file for details. diff --git a/front_end/third_party/mcp-sdk/package/dist/cli.d.ts b/front_end/third_party/mcp-sdk/package/dist/cli.d.ts new file mode 100644 index 0000000000..d9ae1944cf --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/cli.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=cli.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/cli.d.ts.map b/front_end/third_party/mcp-sdk/package/dist/cli.d.ts.map new file mode 100644 index 0000000000..f022439b15 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/cli.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/cli.js b/front_end/third_party/mcp-sdk/package/dist/cli.js new file mode 100644 index 0000000000..638a4d4b1d --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/cli.js @@ -0,0 +1,129 @@ +import EventSource from "eventsource"; +import WebSocket from "ws"; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +global.EventSource = EventSource; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +global.WebSocket = WebSocket; +import express from "express"; +import { Client } from "./client/index.js"; +import { SSEClientTransport } from "./client/sse.js"; +import { StdioClientTransport } from "./client/stdio.js"; +import { WebSocketClientTransport } from "./client/websocket.js"; +import { Server } from "./server/index.js"; +import { SSEServerTransport } from "./server/sse.js"; +import { StdioServerTransport } from "./server/stdio.js"; +import { ListResourcesResultSchema } from "./types.js"; +async function runClient(url_or_command, args) { + const client = new Client({ + name: "mcp-typescript test client", + version: "0.1.0", + }, { + capabilities: { + sampling: {}, + }, + }); + let clientTransport; + let url = undefined; + try { + url = new URL(url_or_command); + } + catch (_a) { + // Ignore + } + if ((url === null || url === void 0 ? void 0 : url.protocol) === "http:" || (url === null || url === void 0 ? void 0 : url.protocol) === "https:") { + clientTransport = new SSEClientTransport(new URL(url_or_command)); + } + else if ((url === null || url === void 0 ? void 0 : url.protocol) === "ws:" || (url === null || url === void 0 ? void 0 : url.protocol) === "wss:") { + clientTransport = new WebSocketClientTransport(new URL(url_or_command)); + } + else { + clientTransport = new StdioClientTransport({ + command: url_or_command, + args, + }); + } + console.log("Connected to server."); + await client.connect(clientTransport); + console.log("Initialized."); + await client.request({ method: "resources/list" }, ListResourcesResultSchema); + await client.close(); + console.log("Closed."); +} +async function runServer(port) { + if (port !== null) { + const app = express(); + let servers = []; + app.get("/sse", async (req, res) => { + console.log("Got new SSE connection"); + const transport = new SSEServerTransport("/message", res); + const server = new Server({ + name: "mcp-typescript test server", + version: "0.1.0", + }, { + capabilities: {}, + }); + servers.push(server); + server.onclose = () => { + console.log("SSE connection closed"); + servers = servers.filter((s) => s !== server); + }; + await server.connect(transport); + }); + app.post("/message", async (req, res) => { + console.log("Received message"); + const sessionId = req.query.sessionId; + const transport = servers + .map((s) => s.transport) + .find((t) => t.sessionId === sessionId); + if (!transport) { + res.status(404).send("Session not found"); + return; + } + await transport.handlePostMessage(req, res); + }); + app.listen(port, () => { + console.log(`Server running on http://localhost:${port}/sse`); + }); + } + else { + const server = new Server({ + name: "mcp-typescript test server", + version: "0.1.0", + }, { + capabilities: { + prompts: {}, + resources: {}, + tools: {}, + logging: {}, + }, + }); + const transport = new StdioServerTransport(); + await server.connect(transport); + console.log("Server running on stdio"); + } +} +const args = process.argv.slice(2); +const command = args[0]; +switch (command) { + case "client": + if (args.length < 2) { + console.error("Usage: client [args...]"); + process.exit(1); + } + runClient(args[1], args.slice(2)).catch((error) => { + console.error(error); + process.exit(1); + }); + break; + case "server": { + const port = args[1] ? parseInt(args[1]) : null; + runServer(port).catch((error) => { + console.error(error); + process.exit(1); + }); + break; + } + default: + console.error("Unrecognized command:", command); +} +//# sourceMappingURL=cli.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/cli.js.map b/front_end/third_party/mcp-sdk/package/dist/cli.js.map new file mode 100644 index 0000000000..3ce2d24c3c --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/cli.js.map @@ -0,0 +1 @@ +{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,aAAa,CAAC;AACtC,OAAO,SAAS,MAAM,IAAI,CAAC;AAE3B,8DAA8D;AAC7D,MAAc,CAAC,WAAW,GAAG,WAAW,CAAC;AAC1C,8DAA8D;AAC7D,MAAc,CAAC,SAAS,GAAG,SAAS,CAAC;AAEtC,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM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IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACnC,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AACxB,QAAQ,OAAO,EAAE,CAAC;IAChB,KAAK,QAAQ;QACX,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACpB,OAAO,CAAC,KAAK,CAAC,iDAAiD,CAAC,CAAC;YACjE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QAED,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YAChD,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;QAEH,MAAM;IAER,KAAK,QAAQ,CAAC,CAAC,CAAC;QACd,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAChD,SAAS,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YAC9B,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;QAEH,MAAM;IACR,CAAC;IAED;QACE,OAAO,CAAC,KAAK,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;AACpD,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/client/index.d.ts b/front_end/third_party/mcp-sdk/package/dist/client/index.d.ts new file mode 100644 index 0000000000..d0a4295db8 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/client/index.d.ts @@ -0,0 +1,773 @@ +import { Protocol, ProtocolOptions, RequestOptions } from "../shared/protocol.js"; +import { Transport } from "../shared/transport.js"; +import { CallToolRequest, CallToolResultSchema, ClientCapabilities, ClientNotification, ClientRequest, ClientResult, CompatibilityCallToolResultSchema, CompleteRequest, GetPromptRequest, Implementation, ListPromptsRequest, ListResourcesRequest, ListResourceTemplatesRequest, ListToolsRequest, LoggingLevel, Notification, ReadResourceRequest, Request, Result, ServerCapabilities, SubscribeRequest, UnsubscribeRequest } from "../types.js"; +export type ClientOptions = ProtocolOptions & { + /** + * Capabilities to advertise as being supported by this client. + */ + capabilities: ClientCapabilities; +}; +/** + * An MCP client on top of a pluggable transport. + * + * The client will automatically begin the initialization flow with the server when connect() is called. + * + * To use with custom types, extend the base Request/Notification/Result types and pass them as type parameters: + * + * ```typescript + * // Custom schemas + * const CustomRequestSchema = RequestSchema.extend({...}) + * const CustomNotificationSchema = NotificationSchema.extend({...}) + * const CustomResultSchema = ResultSchema.extend({...}) + * + * // Type aliases + * type CustomRequest = z.infer + * type CustomNotification = z.infer + * type CustomResult = z.infer + * + * // Create typed client + * const client = new Client({ + * name: "CustomClient", + * version: "1.0.0" + * }) + * ``` + */ +export declare class Client extends Protocol { + private _clientInfo; + private _serverCapabilities?; + private _serverVersion?; + private _capabilities; + /** + * Initializes this client with the given name and version information. + */ + constructor(_clientInfo: Implementation, options: ClientOptions); + protected assertCapability(capability: keyof ServerCapabilities, method: string): void; + connect(transport: Transport): Promise; + /** + * After initialization has completed, this will be populated with the server's reported capabilities. + */ + getServerCapabilities(): ServerCapabilities | undefined; + /** + * After initialization has completed, this will be populated with information about the server's name and version. + */ + getServerVersion(): Implementation | undefined; + protected assertCapabilityForMethod(method: RequestT["method"]): void; + protected assertNotificationCapability(method: NotificationT["method"]): void; + protected assertRequestHandlerCapability(method: string): void; + ping(options?: RequestOptions): Promise<{ + _meta?: import("zod").objectOutputType<{}, import("zod").ZodTypeAny, "passthrough"> | undefined; + }>; + complete(params: CompleteRequest["params"], options?: RequestOptions): Promise, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + completion: import("zod").ZodObject<{ + values: import("zod").ZodArray; + total: import("zod").ZodOptional; + hasMore: import("zod").ZodOptional; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + values: import("zod").ZodArray; + total: import("zod").ZodOptional; + hasMore: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + values: import("zod").ZodArray; + total: import("zod").ZodOptional; + hasMore: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">>; + }>, import("zod").ZodTypeAny, "passthrough">>; + setLoggingLevel(level: LoggingLevel, options?: RequestOptions): Promise<{ + _meta?: import("zod").objectOutputType<{}, import("zod").ZodTypeAny, "passthrough"> | undefined; + }>; + getPrompt(params: GetPromptRequest["params"], options?: RequestOptions): Promise, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + description: import("zod").ZodOptional; + messages: import("zod").ZodArray; + content: import("zod").ZodUnion<[import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, import("zod").ZodTypeAny, "passthrough">>]>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + role: import("zod").ZodEnum<["user", "assistant"]>; + content: import("zod").ZodUnion<[import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, import("zod").ZodTypeAny, "passthrough">>]>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + role: import("zod").ZodEnum<["user", "assistant"]>; + content: import("zod").ZodUnion<[import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, import("zod").ZodTypeAny, "passthrough">>]>; + }, import("zod").ZodTypeAny, "passthrough">>, "many">; + }>, import("zod").ZodTypeAny, "passthrough">>; + listPrompts(params?: ListPromptsRequest["params"], options?: RequestOptions): Promise, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + nextCursor: import("zod").ZodOptional; + }>, { + prompts: import("zod").ZodArray; + arguments: import("zod").ZodOptional; + required: import("zod").ZodOptional; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + name: import("zod").ZodString; + description: import("zod").ZodOptional; + required: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + name: import("zod").ZodString; + description: import("zod").ZodOptional; + required: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">>, "many">>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + name: import("zod").ZodString; + description: import("zod").ZodOptional; + arguments: import("zod").ZodOptional; + required: import("zod").ZodOptional; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + name: import("zod").ZodString; + description: import("zod").ZodOptional; + required: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + name: import("zod").ZodString; + description: import("zod").ZodOptional; + required: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">>, "many">>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + name: import("zod").ZodString; + description: import("zod").ZodOptional; + arguments: import("zod").ZodOptional; + required: import("zod").ZodOptional; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + name: import("zod").ZodString; + description: import("zod").ZodOptional; + required: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + name: import("zod").ZodString; + description: import("zod").ZodOptional; + required: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">>, "many">>; + }, import("zod").ZodTypeAny, "passthrough">>, "many">; + }>, import("zod").ZodTypeAny, "passthrough">>; + listResources(params?: ListResourcesRequest["params"], options?: RequestOptions): Promise, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + nextCursor: import("zod").ZodOptional; + }>, { + resources: import("zod").ZodArray; + mimeType: import("zod").ZodOptional; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + uri: import("zod").ZodString; + name: import("zod").ZodString; + description: import("zod").ZodOptional; + mimeType: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + uri: import("zod").ZodString; + name: import("zod").ZodString; + description: import("zod").ZodOptional; + mimeType: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">>, "many">; + }>, import("zod").ZodTypeAny, "passthrough">>; + listResourceTemplates(params?: ListResourceTemplatesRequest["params"], options?: RequestOptions): Promise, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + nextCursor: import("zod").ZodOptional; + }>, { + resourceTemplates: import("zod").ZodArray; + mimeType: import("zod").ZodOptional; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + uriTemplate: import("zod").ZodString; + name: import("zod").ZodString; + description: import("zod").ZodOptional; + mimeType: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + uriTemplate: import("zod").ZodString; + name: import("zod").ZodString; + description: import("zod").ZodOptional; + mimeType: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">>, "many">; + }>, import("zod").ZodTypeAny, "passthrough">>; + readResource(params: ReadResourceRequest["params"], options?: RequestOptions): Promise, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + contents: import("zod").ZodArray; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>, "many">; + }>, import("zod").ZodTypeAny, "passthrough">>; + subscribeResource(params: SubscribeRequest["params"], options?: RequestOptions): Promise<{ + _meta?: import("zod").objectOutputType<{}, import("zod").ZodTypeAny, "passthrough"> | undefined; + }>; + unsubscribeResource(params: UnsubscribeRequest["params"], options?: RequestOptions): Promise<{ + _meta?: import("zod").objectOutputType<{}, import("zod").ZodTypeAny, "passthrough"> | undefined; + }>; + callTool(params: CallToolRequest["params"], resultSchema?: typeof CallToolResultSchema | typeof CompatibilityCallToolResultSchema, options?: RequestOptions): Promise, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + content: import("zod").ZodArray; + text: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, import("zod").ZodTypeAny, "passthrough">>]>, "many">; + isError: import("zod").ZodOptional>; + }>, import("zod").ZodTypeAny, "passthrough"> | import("zod").objectOutputType, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + toolResult: import("zod").ZodUnknown; + }>, import("zod").ZodTypeAny, "passthrough">>; + listTools(params?: ListToolsRequest["params"], options?: RequestOptions): Promise, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + nextCursor: import("zod").ZodOptional; + }>, { + tools: import("zod").ZodArray; + inputSchema: import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, import("zod").ZodTypeAny, "passthrough">>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + name: import("zod").ZodString; + description: import("zod").ZodOptional; + inputSchema: import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, import("zod").ZodTypeAny, "passthrough">>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + name: import("zod").ZodString; + description: import("zod").ZodOptional; + inputSchema: import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, import("zod").ZodTypeAny, "passthrough">>; + }, import("zod").ZodTypeAny, "passthrough">>, "many">; + }>, import("zod").ZodTypeAny, "passthrough">>; + sendRootsListChanged(): Promise; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/client/index.d.ts.map b/front_end/third_party/mcp-sdk/package/dist/client/index.d.ts.map new file mode 100644 index 0000000000..f347d6f4d6 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/client/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,eAAe,EACf,cAAc,EACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,YAAY,EACZ,iCAAiC,EACjC,eAAe,EAGf,gBAAgB,EAEhB,cAAc,EAGd,kBAAkB,EAElB,oBAAoB,EAEpB,4BAA4B,EAE5B,gBAAgB,EAEhB,YAAY,EACZ,YAAY,EACZ,mBAAmB,EAEnB,OAAO,EACP,MAAM,EACN,kBAAkB,EAClB,gBAAgB,EAEhB,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,aAAa,GAAG,eAAe,GAAG;IAC5C;;OAEG;IACH,YAAY,EAAE,kBAAkB,CAAC;CAClC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,qBAAa,MAAM,CACjB,QAAQ,SAAS,OAAO,GAAG,OAAO,EAClC,aAAa,SAAS,YAAY,GAAG,YAAY,EACjD,OAAO,SAAS,MAAM,GAAG,MAAM,CAC/B,SAAQ,QAAQ,CAChB,aAAa,GAAG,QAAQ,EACxB,kBAAkB,GAAG,aAAa,EAClC,YA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;;;;;;;;;;;;;;;;;;;;;IASpB,SAAS,CACb,MAAM,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,EACnC,OAAO,CAAC,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IASpB,oBAAoB;CAG3B"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/client/index.js b/front_end/third_party/mcp-sdk/package/dist/client/index.js new file mode 100644 index 0000000000..4622c2d3cc --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/client/index.js @@ -0,0 +1,206 @@ +import { Protocol, } from "../shared/protocol.js"; +import { CallToolResultSchema, CompleteResultSchema, EmptyResultSchema, GetPromptResultSchema, InitializeResultSchema, LATEST_PROTOCOL_VERSION, ListPromptsResultSchema, ListResourcesResultSchema, ListResourceTemplatesResultSchema, ListToolsResultSchema, ReadResourceResultSchema, SUPPORTED_PROTOCOL_VERSIONS, } from "../types.js"; +/** + * An MCP client on top of a pluggable transport. + * + * The client will automatically begin the initialization flow with the server when connect() is called. + * + * To use with custom types, extend the base Request/Notification/Result types and pass them as type parameters: + * + * ```typescript + * // Custom schemas + * const CustomRequestSchema = RequestSchema.extend({...}) + * const CustomNotificationSchema = NotificationSchema.extend({...}) + * const CustomResultSchema = ResultSchema.extend({...}) + * + * // Type aliases + * type CustomRequest = z.infer + * type CustomNotification = z.infer + * type CustomResult = z.infer + * + * // Create typed client + * const client = new Client({ + * name: "CustomClient", + * version: "1.0.0" + * }) + * ``` + */ +export class Client extends Protocol { + /** + * Initializes this client with the given name and version information. + */ + constructor(_clientInfo, options) { + super(options); + this._clientInfo = _clientInfo; + this._capabilities = options.capabilities; + } + assertCapability(capability, method) { + var _a; + if (!((_a = this._serverCapabilities) === null || _a === void 0 ? void 0 : _a[capability])) { + throw new Error(`Server does not support ${capability} (required for ${method})`); + } + } + async connect(transport) { + await super.connect(transport); + try { + const result = await this.request({ + method: "initialize", + params: { + protocolVersion: LATEST_PROTOCOL_VERSION, + capabilities: this._capabilities, + clientInfo: this._clientInfo, + }, + }, InitializeResultSchema); + if (result === undefined) { + throw new Error(`Server sent invalid initialize result: ${result}`); + } + if (!SUPPORTED_PROTOCOL_VERSIONS.includes(result.protocolVersion)) { + throw new Error(`Server's protocol version is not supported: ${result.protocolVersion}`); + } + this._serverCapabilities = result.capabilities; + this._serverVersion = result.serverInfo; + await this.notification({ + method: "notifications/initialized", + }); + } + catch (error) { + // Disconnect if initialization fails. + void this.close(); + throw error; + } + } + /** + * After initialization has completed, this will be populated with the server's reported capabilities. + */ + getServerCapabilities() { + return this._serverCapabilities; + } + /** + * After initialization has completed, this will be populated with information about the server's name and version. + */ + getServerVersion() { + return this._serverVersion; + } + assertCapabilityForMethod(method) { + var _a, _b, _c, _d, _e; + switch (method) { + case "logging/setLevel": + if (!((_a = this._serverCapabilities) === null || _a === void 0 ? void 0 : _a.logging)) { + throw new Error(`Server does not support logging (required for ${method})`); + } + break; + case "prompts/get": + case "prompts/list": + if (!((_b = this._serverCapabilities) === null || _b === void 0 ? void 0 : _b.prompts)) { + throw new Error(`Server does not support prompts (required for ${method})`); + } + break; + case "resources/list": + case "resources/templates/list": + case "resources/read": + case "resources/subscribe": + case "resources/unsubscribe": + if (!((_c = this._serverCapabilities) === null || _c === void 0 ? void 0 : _c.resources)) { + throw new Error(`Server does not support resources (required for ${method})`); + } + if (method === "resources/subscribe" && + !this._serverCapabilities.resources.subscribe) { + throw new Error(`Server does not support resource subscriptions (required for ${method})`); + } + break; + case "tools/call": + case "tools/list": + if (!((_d = this._serverCapabilities) === null || _d === void 0 ? void 0 : _d.tools)) { + throw new Error(`Server does not support tools (required for ${method})`); + } + break; + case "completion/complete": + if (!((_e = this._serverCapabilities) === null || _e === void 0 ? void 0 : _e.prompts)) { + throw new Error(`Server does not support prompts (required for ${method})`); + } + break; + case "initialize": + // No specific capability required for initialize + break; + case "ping": + // No specific capability required for ping + break; + } + } + assertNotificationCapability(method) { + var _a; + switch (method) { + case "notifications/roots/list_changed": + if (!((_a = this._capabilities.roots) === null || _a === void 0 ? void 0 : _a.listChanged)) { + throw new Error(`Client does not support roots list changed notifications (required for ${method})`); + } + break; + case "notifications/initialized": + // No specific capability required for initialized + break; + case "notifications/cancelled": + // Cancellation notifications are always allowed + break; + case "notifications/progress": + // Progress notifications are always allowed + break; + } + } + assertRequestHandlerCapability(method) { + switch (method) { + case "sampling/createMessage": + if (!this._capabilities.sampling) { + throw new Error(`Client does not support sampling capability (required for ${method})`); + } + break; + case "roots/list": + if (!this._capabilities.roots) { + throw new Error(`Client does not support roots capability (required for ${method})`); + } + break; + case "ping": + // No specific capability required for ping + break; + } + } + async ping(options) { + return this.request({ method: "ping" }, EmptyResultSchema, options); + } + async complete(params, options) { + return this.request({ method: "completion/complete", params }, CompleteResultSchema, options); + } + async setLoggingLevel(level, options) { + return this.request({ method: "logging/setLevel", params: { level } }, EmptyResultSchema, options); + } + async getPrompt(params, options) { + return this.request({ method: "prompts/get", params }, GetPromptResultSchema, options); + } + async listPrompts(params, options) { + return this.request({ method: "prompts/list", params }, ListPromptsResultSchema, options); + } + async listResources(params, options) { + return this.request({ method: "resources/list", params }, ListResourcesResultSchema, options); + } + async listResourceTemplates(params, options) { + return this.request({ method: "resources/templates/list", params }, ListResourceTemplatesResultSchema, options); + } + async readResource(params, options) { + return this.request({ method: "resources/read", params }, ReadResourceResultSchema, options); + } + async subscribeResource(params, options) { + return this.request({ method: "resources/subscribe", params }, EmptyResultSchema, options); + } + async unsubscribeResource(params, options) { + return this.request({ method: "resources/unsubscribe", params }, EmptyResultSchema, options); + } + async callTool(params, resultSchema = CallToolResultSchema, options) { + return this.request({ method: "tools/call", params }, resultSchema, options); + } + async listTools(params, options) { + return this.request({ method: "tools/list", params }, ListToolsResultSchema, options); + } + async sendRootsListChanged() { + return this.notification({ method: "notifications/roots/list_changed" }); + } +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/client/index.js.map b/front_end/third_party/mcp-sdk/package/dist/client/index.js.map new file mode 100644 index 0000000000..cedc261ccf --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/client/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,GAGT,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAEL,oBAAoB,EAOpB,oBAAoB,EACpB,iBAAiB,EAEjB,qBAAqB,EAErB,sBAAsB,EACtB,uBAAuB,EAEvB,uBAAuB,EAEvB,yBAAyB,EAEzB,iCAAiC,EAEjC,qBAAqB,EAIrB,wBAAwB,EAKxB,2BAA2B,GAE5B,MAAM,aAAa,CAAC;AASrB;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,OAAO,MAIX,SAAQ,QAIT;IAKC;;OAEG;IACH,YACU,WAA2B,EACnC,OAAsB;QAEtB,KAAK,CAAC,OAAO,CAAC,CAAC;QAHP,gBAAW,GAAX,WAAW,CAAgB;QAInC,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;IAC5C,CAAC;IAES,gBAAgB,CACxB,UAAoC,EACpC,MAAc;;QAEd,IAAI,CAAC,CAAA,MAAA,IAAI,CAAC,mBAAmB,0CAAG,UAAU,CAAC,CAAA,EAAE,CAAC;YAC5C,MAAM,IAAI,KAAK,CACb,2BAA2B,UAAU,kBAAkB,MAAM,GAAG,CACjE,CAAC;QACJ,CAAC;IACH,CAAC;IAEQ,KAAK,CAAC,OAAO,CAAC,SAAoB;QACzC,MAAM,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAE/B,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAC/B;gBACE,MAAM,EAAE,YAAY;gBACpB,MAAM,EAAE;oBACN,eAAe,EAAE,uBAAuB;oBACxC,YAAY,EAAE,IAAI,CAAC,aAAa;oBAChC,UAAU,EAAE,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C3C,iBAAiB,EACjB,OAAO,CACR,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,QAAQ,CACZ,MAAiC,EACjC,eAE+C,oBAAoB,EACnE,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CACjB,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,EAChC,YAAY,EACZ,OAAO,CACR,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,SAAS,CACb,MAAmC,EACnC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CACjB,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,EAChC,qBAAqB,EACrB,OAAO,CACR,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,oBAAoB;QACxB,OAAO,IAAI,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,kCAAkC,EAAE,CAAC,CAAC;IAC3E,CAAC;CACF"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/client/index.test.d.ts b/front_end/third_party/mcp-sdk/package/dist/client/index.test.d.ts new file mode 100644 index 0000000000..121d59b38b --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/client/index.test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=index.test.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/client/index.test.d.ts.map b/front_end/third_party/mcp-sdk/package/dist/client/index.test.d.ts.map new file mode 100644 index 0000000000..2b9c387f05 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/client/index.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../src/client/index.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/client/index.test.js b/front_end/third_party/mcp-sdk/package/dist/client/index.test.js new file mode 100644 index 0000000000..e67a09564d --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/client/index.test.js @@ -0,0 +1,393 @@ +/* eslint-disable @typescript-eslint/no-unused-vars */ +/* eslint-disable no-constant-binary-expression */ +/* eslint-disable @typescript-eslint/no-unused-expressions */ +import { Client } from "./index.js"; +import { z } from "zod"; +import { RequestSchema, NotificationSchema, ResultSchema, LATEST_PROTOCOL_VERSION, SUPPORTED_PROTOCOL_VERSIONS, InitializeRequestSchema, ListResourcesRequestSchema, ListToolsRequestSchema, CreateMessageRequestSchema, ListRootsRequestSchema, ErrorCode, } from "../types.js"; +import { Server } from "../server/index.js"; +import { InMemoryTransport } from "../inMemory.js"; +test("should initialize with matching protocol version", async () => { + const clientTransport = { + start: jest.fn().mockResolvedValue(undefined), + close: jest.fn().mockResolvedValue(undefined), + send: jest.fn().mockImplementation((message) => { + var _a; + if (message.method === "initialize") { + (_a = clientTransport.onmessage) === null || _a === void 0 ? void 0 : _a.call(clientTransport, { + jsonrpc: "2.0", + id: message.id, + result: { + protocolVersion: LATEST_PROTOCOL_VERSION, + capabilities: {}, + serverInfo: { + name: "test", + version: "1.0", + }, + }, + }); + } + return Promise.resolve(); + }), + }; + const client = new Client({ + name: "test client", + version: "1.0", + }, { + capabilities: { + sampling: {}, + }, + }); + await client.connect(clientTransport); + // Should have sent initialize with latest version + expect(clientTransport.send).toHaveBeenCalledWith(expect.objectContaining({ + method: "initialize", + params: expect.objectContaining({ + protocolVersion: LATEST_PROTOCOL_VERSION, + }), + })); +}); +test("should initialize with supported older protocol version", async () => { + const OLD_VERSION = SUPPORTED_PROTOCOL_VERSIONS[1]; + const clientTransport = { + start: jest.fn().mockResolvedValue(undefined), + close: jest.fn().mockResolvedValue(undefined), + send: jest.fn().mockImplementation((message) => { + var _a; + if (message.method === "initialize") { + (_a = clientTransport.onmessage) === null || _a === void 0 ? void 0 : _a.call(clientTransport, { + jsonrpc: "2.0", + id: message.id, + result: { + protocolVersion: OLD_VERSION, + capabilities: {}, + serverInfo: { + name: "test", + version: "1.0", + }, + }, + }); + } + return Promise.resolve(); + }), + }; + const client = new Client({ + name: "test client", + version: "1.0", + }, { + capabilities: { + sampling: {}, + }, + }); + await client.connect(clientTransport); + // Connection should succeed with the older version + expect(client.getServerVersion()).toEqual({ + name: "test", + version: "1.0", + }); +}); +test("should reject unsupported protocol version", async () => { + const clientTransport = { + start: jest.fn().mockResolvedValue(undefined), + close: jest.fn().mockResolvedValue(undefined), + send: jest.fn().mockImplementation((message) => { + var _a; + if (message.method === "initialize") { + (_a = clientTransport.onmessage) === null || _a === void 0 ? void 0 : _a.call(clientTransport, { + jsonrpc: "2.0", + id: message.id, + result: { + protocolVersion: "invalid-version", + capabilities: {}, + serverInfo: { + name: "test", + version: "1.0", + }, + }, + }); + } + return Promise.resolve(); + }), + }; + const client = new Client({ + name: "test client", + version: "1.0", + }, { + capabilities: { + sampling: {}, + }, + }); + await expect(client.connect(clientTransport)).rejects.toThrow("Server's protocol version is not supported: invalid-version"); + expect(clientTransport.close).toHaveBeenCalled(); +}); +test("should respect server capabilities", async () => { + const server = new Server({ + name: "test server", + version: "1.0", + }, { + capabilities: { + resources: {}, + tools: {}, + }, + }); + server.setRequestHandler(InitializeRequestSchema, (_request) => ({ + protocolVersion: LATEST_PROTOCOL_VERSION, + capabilities: { + resources: {}, + tools: {}, + }, + serverInfo: { + name: "test", + version: "1.0", + }, + })); + server.setRequestHandler(ListResourcesRequestSchema, () => ({ + resources: [], + })); + server.setRequestHandler(ListToolsRequestSchema, () => ({ + tools: [], + })); + const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair(); + const client = new Client({ + name: "test client", + version: "1.0", + }, { + capabilities: { + sampling: {}, + }, + enforceStrictCapabilities: true, + }); + await Promise.all([ + client.connect(clientTransport), + server.connect(serverTransport), + ]); + // Server supports resources and tools, but not prompts + expect(client.getServerCapabilities()).toEqual({ + resources: {}, + tools: {}, + }); + // These should work + await expect(client.listResources()).resolves.not.toThrow(); + await expect(client.listTools()).resolves.not.toThrow(); + // This should throw because prompts are not supported + await expect(client.listPrompts()).rejects.toThrow("Server does not support prompts"); +}); +test("should respect client notification capabilities", async () => { + const server = new Server({ + name: "test server", + version: "1.0", + }, { + capabilities: {}, + }); + const client = new Client({ + name: "test client", + version: "1.0", + }, { + capabilities: { + roots: { + listChanged: true, + }, + }, + }); + const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair(); + await Promise.all([ + client.connect(clientTransport), + server.connect(serverTransport), + ]); + // This should work because the client has the roots.listChanged capability + await expect(client.sendRootsListChanged()).resolves.not.toThrow(); + // Create a new client without the roots.listChanged capability + const clientWithoutCapability = new Client({ + name: "test client without capability", + version: "1.0", + }, { + capabilities: {}, + enforceStrictCapabilities: true, + }); + await clientWithoutCapability.connect(clientTransport); + // This should throw because the client doesn't have the roots.listChanged capability + await expect(clientWithoutCapability.sendRootsListChanged()).rejects.toThrow(/^Client does not support/); +}); +test("should respect server notification capabilities", async () => { + const server = new Server({ + name: "test server", + version: "1.0", + }, { + capabilities: { + logging: {}, + resources: { + listChanged: true, + }, + }, + }); + const client = new Client({ + name: "test client", + version: "1.0", + }, { + capabilities: {}, + }); + const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair(); + await Promise.all([ + client.connect(clientTransport), + server.connect(serverTransport), + ]); + // These should work because the server has the corresponding capabilities + await expect(server.sendLoggingMessage({ level: "info", data: "Test" })).resolves.not.toThrow(); + await expect(server.sendResourceListChanged()).resolves.not.toThrow(); + // This should throw because the server doesn't have the tools capability + await expect(server.sendToolListChanged()).rejects.toThrow("Server does not support notifying of tool list changes"); +}); +test("should only allow setRequestHandler for declared capabilities", () => { + const client = new Client({ + name: "test client", + version: "1.0", + }, { + capabilities: { + sampling: {}, + }, + }); + // This should work because sampling is a declared capability + expect(() => { + client.setRequestHandler(CreateMessageRequestSchema, () => ({ + model: "test-model", + role: "assistant", + content: { + type: "text", + text: "Test response", + }, + })); + }).not.toThrow(); + // This should throw because roots listing is not a declared capability + expect(() => { + client.setRequestHandler(ListRootsRequestSchema, () => ({})); + }).toThrow("Client does not support roots capability"); +}); +/* + Test that custom request/notification/result schemas can be used with the Client class. + */ +test("should typecheck", () => { + const GetWeatherRequestSchema = RequestSchema.extend({ + method: z.literal("weather/get"), + params: z.object({ + city: z.string(), + }), + }); + const GetForecastRequestSchema = RequestSchema.extend({ + method: z.literal("weather/forecast"), + params: z.object({ + city: z.string(), + days: z.number(), + }), + }); + const WeatherForecastNotificationSchema = NotificationSchema.extend({ + method: z.literal("weather/alert"), + params: z.object({ + severity: z.enum(["warning", "watch"]), + message: z.string(), + }), + }); + const WeatherRequestSchema = GetWeatherRequestSchema.or(GetForecastRequestSchema); + const WeatherNotificationSchema = WeatherForecastNotificationSchema; + const WeatherResultSchema = ResultSchema.extend({ + temperature: z.number(), + conditions: z.string(), + }); + // Create a typed Client for weather data + const weatherClient = new Client({ + name: "WeatherClient", + version: "1.0.0", + }, { + capabilities: { + sampling: {}, + }, + }); + // Typecheck that only valid weather requests/notifications/results are allowed + false && + weatherClient.request({ + method: "weather/get", + params: { + city: "Seattle", + }, + }, WeatherResultSchema); + false && + weatherClient.notification({ + method: "weather/alert", + params: { + severity: "warning", + message: "Storm approaching", + }, + }); +}); +test("should handle client cancelling a request", async () => { + const server = new Server({ + name: "test server", + version: "1.0", + }, { + capabilities: { + resources: {}, + }, + }); + // Set up server to delay responding to listResources + server.setRequestHandler(ListResourcesRequestSchema, async (request, extra) => { + await new Promise((resolve) => setTimeout(resolve, 1000)); + return { + resources: [], + }; + }); + const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair(); + const client = new Client({ + name: "test client", + version: "1.0", + }, { + capabilities: {}, + }); + await Promise.all([ + client.connect(clientTransport), + server.connect(serverTransport), + ]); + // Set up abort controller + const controller = new AbortController(); + // Issue request but cancel it immediately + const listResourcesPromise = client.listResources(undefined, { + signal: controller.signal, + }); + controller.abort("Cancelled by test"); + // Request should be rejected + await expect(listResourcesPromise).rejects.toBe("Cancelled by test"); +}); +test("should handle request timeout", async () => { + const server = new Server({ + name: "test server", + version: "1.0", + }, { + capabilities: { + resources: {}, + }, + }); + // Set up server with a delayed response + server.setRequestHandler(ListResourcesRequestSchema, async (_request, extra) => { + const timer = new Promise((resolve) => { + const timeout = setTimeout(resolve, 100); + extra.signal.addEventListener("abort", () => clearTimeout(timeout)); + }); + await timer; + return { + resources: [], + }; + }); + const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair(); + const client = new Client({ + name: "test client", + version: "1.0", + }, { + capabilities: {}, + }); + await Promise.all([ + client.connect(clientTransport), + server.connect(serverTransport), + ]); + // Request with 0 msec timeout should fail immediately + await expect(client.listResources(undefined, { timeout: 0 })).rejects.toMatchObject({ + code: ErrorCode.RequestTimeout, + }); +}); +//# sourceMappingURL=index.test.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/client/index.test.js.map b/front_end/third_party/mcp-sdk/package/dist/client/index.test.js.map new file mode 100644 index 0000000000..14b87ae118 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/client/index.test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../src/client/index.test.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,kDAAkD;AAClD,6DAA6D;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,YAAY,EACZ,uBAAuB,EACvB,2BAA2B,EAC3B,uBAAuB,EACvB,0BAA0B,EAC1B,sBAAsB,EACtB,0BAA0B,EAC1B,sBAAsB,EACtB,SAAS,GACV,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,IAAI,CAAC,kDAAkD,EAAE,KAAK,IAAI,EAAE;IAClE,MAAM,eAAe,GAAc;QACjC,KAAK,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,SAAS,CAA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AAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YACpC,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;YACzC,KAAK,CAAC,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;QACtE,CAAC,CAAC,CAAC;QAEH,MAAM,KAAK,CAAC;QACZ,OAAO;YACL,SAAS,EAAE,EAAE;SACd,CAAC;IACJ,CAAC,CACF,CAAC;IAEF,MAAM,CAAC,eAAe,EAAE,eAAe,CAAC,GACtC,iBAAiB,CAAC,gBAAgB,EAAE,CAAC;IAEvC,MAAM,MAAM,GAAG,IAAI,MAAM,CACvB;QACE,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE,KAAK;KACf,EACD;QACE,YAAY,EAAE,EAAE;KACjB,CACF,CAAC;IAEF,MAAM,OAAO,CAAC,GAAG,CAAC;QAChB,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC;QAC/B,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC;KAChC,CAAC,CAAC;IAEH,sDAAsD;IACtD,MAAM,MAAM,CACV,MAAM,CAAC,aAAa,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAChD,CAAC,OAAO,CAAC,aAAa,CAAC;QACtB,IAAI,EAAE,SAAS,CAAC,cAAc;KAC/B,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/client/sse.d.ts b/front_end/third_party/mcp-sdk/package/dist/client/sse.d.ts new file mode 100644 index 0000000000..a419b60171 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/client/sse.d.ts @@ -0,0 +1,22 @@ +import { Transport } from "../shared/transport.js"; +import { JSONRPCMessage } from "../types.js"; +/** + * Client transport for SSE: this will connect to a server using Server-Sent Events for receiving + * messages and make separate POST requests for sending messages. + * + * This uses the EventSource API in browsers. You can install the `eventsource` package for Node.js. + */ +export declare class SSEClientTransport implements Transport { + private _eventSource?; + private _endpoint?; + private _abortController?; + private _url; + onclose?: () => void; + onerror?: (error: Error) => void; + onmessage?: (message: JSONRPCMessage) => void; + constructor(url: URL); + start(): Promise; + close(): Promise; + send(message: JSONRPCMessage): Promise; +} +//# sourceMappingURL=sse.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/client/sse.d.ts.map b/front_end/third_party/mcp-sdk/package/dist/client/sse.d.ts.map new file mode 100644 index 0000000000..9f77c54f0a --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/client/sse.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"sse.d.ts","sourceRoot":"","sources":["../../src/client/sse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAwB,MAAM,aAAa,CAAC;AAEnE;;;;;GAKG;AACH,qBAAa,kBAAmB,YAAW,SAAS;IAClD,OAAO,CAAC,YAAY,CAAC,CAAc;IACnC,OAAO,CAAC,SAAS,CAAC,CAAM;IACxB,OAAO,CAAC,gBAAgB,CAAC,CAAkB;IAC3C,OAAO,CAAC,IAAI,CAAM;IAElB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;gBAElC,GAAG,EAAE,GAAG;IAIpB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAyDhB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAMtB,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CA0BnD"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/client/sse.js b/front_end/third_party/mcp-sdk/package/dist/client/sse.js new file mode 100644 index 0000000000..5dac069137 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/client/sse.js @@ -0,0 +1,91 @@ +import { JSONRPCMessageSchema } from "../types.js"; +/** + * Client transport for SSE: this will connect to a server using Server-Sent Events for receiving + * messages and make separate POST requests for sending messages. + * + * This uses the EventSource API in browsers. You can install the `eventsource` package for Node.js. + */ +export class SSEClientTransport { + constructor(url) { + this._url = url; + } + start() { + if (this._eventSource) { + throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically."); + } + return new Promise((resolve, reject) => { + this._eventSource = new EventSource(this._url.href); + this._abortController = new AbortController(); + this._eventSource.onerror = (event) => { + var _a; + const error = new Error(`SSE error: ${JSON.stringify(event)}`); + reject(error); + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + }; + this._eventSource.onopen = () => { + // The connection is open, but we need to wait for the endpoint to be received. + }; + this._eventSource.addEventListener("endpoint", (event) => { + var _a; + const messageEvent = event; + try { + this._endpoint = new URL(messageEvent.data, this._url); + if (this._endpoint.origin !== this._url.origin) { + throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`); + } + } + catch (error) { + reject(error); + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + void this.close(); + return; + } + resolve(); + }); + this._eventSource.onmessage = (event) => { + var _a, _b; + const messageEvent = event; + let message; + try { + message = JSONRPCMessageSchema.parse(JSON.parse(messageEvent.data)); + } + catch (error) { + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + return; + } + (_b = this.onmessage) === null || _b === void 0 ? void 0 : _b.call(this, message); + }; + }); + } + async close() { + var _a, _b, _c; + (_a = this._abortController) === null || _a === void 0 ? void 0 : _a.abort(); + (_b = this._eventSource) === null || _b === void 0 ? void 0 : _b.close(); + (_c = this.onclose) === null || _c === void 0 ? void 0 : _c.call(this); + } + async send(message) { + var _a, _b; + if (!this._endpoint) { + throw new Error("Not connected"); + } + try { + const response = await fetch(this._endpoint, { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(message), + signal: (_a = this._abortController) === null || _a === void 0 ? void 0 : _a.signal, + }); + if (!response.ok) { + const text = await response.text().catch(() => null); + throw new Error(`Error POSTing to endpoint (HTTP ${response.status}): ${text}`); + } + } + catch (error) { + (_b = this.onerror) === null || _b === void 0 ? void 0 : _b.call(this, error); + throw error; + } + } +} +//# sourceMappingURL=sse.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/client/sse.js.map b/front_end/third_party/mcp-sdk/package/dist/client/sse.js.map new file mode 100644 index 0000000000..706813a404 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/client/sse.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sse.js","sourceRoot":"","sources":["../../src/client/sse.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnE;;;;;GAKG;AACH,MAAM,OAAO,kBAAkB;IAU7B,YAAY,GAAQ;QAClB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;IAClB,CAAC;IAED,KAAK;QACH,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CACb,6GAA6G,CAC9G,CAAC;QACJ,CAAC;QAED,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,IAAI,CAAC,YAAY,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACpD,IAAI,CAAC,gBAAgB,GAAG,IAAI,eAAe,EAAE,CAAC;YAE9C,IAAI,CAAC,YAAY,CAAC,OAAO,GAAG,CAAC,KAAK,EAAE,EAAE;;gBACpC,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,cAAc,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;gBAC/D,MAAM,CAAC,KAAK,CAAC,CAAC;gBACd,MAAA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ED,MAAA,IAAI,CAAC,SAAS,qDAAG,OAAO,CAAC,CAAC;YAC5B,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,KAAK;;QACT,MAAA,IAAI,CAAC,gBAAgB,0CAAE,KAAK,EAAE,CAAC;QAC/B,MAAA,IAAI,CAAC,YAAY,0CAAE,KAAK,EAAE,CAAC;QAC3B,MAAA,IAAI,CAAC,OAAO,oDAAI,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,OAAuB;;QAChC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;QACnC,CAAC;QAED,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,SAAS,EAAE;gBAC3C,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE;oBACP,cAAc,EAAE,kBAAkB;iBACnC;gBACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;gBAC7B,MAAM,EAAE,MAAA,IAAI,CAAC,gBAAgB,0CAAE,MAAM;aACtC,CAAC,CAAC;YAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;gBACjB,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;gBACrD,MAAM,IAAI,KAAK,CACb,mCAAmC,QAAQ,CAAC,MAAM,MAAM,IAAI,EAAE,CAC/D,CAAC;YACJ,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAA,IAAI,CAAC,OAAO,qDAAG,KAAc,CAAC,CAAC;YAC/B,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/client/stdio.d.ts b/front_end/third_party/mcp-sdk/package/dist/client/stdio.d.ts new file mode 100644 index 0000000000..a33b7a5f09 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/client/stdio.d.ts @@ -0,0 +1,63 @@ +import { IOType } from "node:child_process"; +import { JSONRPCMessage } from "../types.js"; +import { Transport } from "../shared/transport.js"; +import { Stream } from "node:stream"; +export type StdioServerParameters = { + /** + * The executable to run to start the server. + */ + command: string; + /** + * Command line arguments to pass to the executable. + */ + args?: string[]; + /** + * The environment to use when spawning the process. + * + * If not specified, the result of getDefaultEnvironment() will be used. + */ + env?: Record; + /** + * How to handle stderr of the child process. This matches the semantics of Node's `child_process.spawn`. + * + * The default is "inherit", meaning messages to stderr will be printed to the parent process's stderr. + */ + stderr?: IOType | Stream | number; +}; +/** + * Environment variables to inherit by default, if an environment is not explicitly given. + */ +export declare const DEFAULT_INHERITED_ENV_VARS: string[]; +/** + * Returns a default environment object including only environment variables deemed safe to inherit. + */ +export declare function getDefaultEnvironment(): Record; +/** + * Client transport for stdio: this will connect to a server by spawning a process and communicating with it over stdin/stdout. + * + * This transport is only available in Node.js environments. + */ +export declare class StdioClientTransport implements Transport { + private _process?; + private _abortController; + private _readBuffer; + private _serverParams; + onclose?: () => void; + onerror?: (error: Error) => void; + onmessage?: (message: JSONRPCMessage) => void; + constructor(server: StdioServerParameters); + /** + * Starts the server process and prepares to communicate with it. + */ + start(): Promise; + /** + * The stderr stream of the child process, if `StdioServerParameters.stderr` was set to "pipe" or "overlapped". + * + * This is only available after the process has been started. + */ + get stderr(): Stream | null; + private processReadBuffer; + close(): Promise; + send(message: JSONRPCMessage): Promise; +} +//# sourceMappingURL=stdio.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/client/stdio.d.ts.map b/front_end/third_party/mcp-sdk/package/dist/client/stdio.d.ts.map new file mode 100644 index 0000000000..8ff96a51cc --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/client/stdio.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"stdio.d.ts","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I,OAAO,CAAC,IAAI,CAAC;IAM5B,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAc7C"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/client/stdio.js b/front_end/third_party/mcp-sdk/package/dist/client/stdio.js new file mode 100644 index 0000000000..332689ecd7 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/client/stdio.js @@ -0,0 +1,148 @@ +import { spawn } from "node:child_process"; +import process from "node:process"; +import { ReadBuffer, serializeMessage } from "../shared/stdio.js"; +/** + * Environment variables to inherit by default, if an environment is not explicitly given. + */ +export const DEFAULT_INHERITED_ENV_VARS = process.platform === "win32" + ? [ + "APPDATA", + "HOMEDRIVE", + "HOMEPATH", + "LOCALAPPDATA", + "PATH", + "PROCESSOR_ARCHITECTURE", + "SYSTEMDRIVE", + "SYSTEMROOT", + "TEMP", + "USERNAME", + "USERPROFILE", + ] + : /* list inspired by the default env inheritance of sudo */ + ["HOME", "LOGNAME", "PATH", "SHELL", "TERM", "USER"]; +/** + * Returns a default environment object including only environment variables deemed safe to inherit. + */ +export function getDefaultEnvironment() { + const env = {}; + for (const key of DEFAULT_INHERITED_ENV_VARS) { + const value = process.env[key]; + if (value === undefined) { + continue; + } + if (value.startsWith("()")) { + // Skip functions, which are a security risk. + continue; + } + env[key] = value; + } + return env; +} +/** + * Client transport for stdio: this will connect to a server by spawning a process and communicating with it over stdin/stdout. + * + * This transport is only available in Node.js environments. + */ +export class StdioClientTransport { + constructor(server) { + this._abortController = new AbortController(); + this._readBuffer = new ReadBuffer(); + this._serverParams = server; + } + /** + * Starts the server process and prepares to communicate with it. + */ + async start() { + if (this._process) { + throw new Error("StdioClientTransport already started! If using Client class, note that connect() calls start() automatically."); + } + return new Promise((resolve, reject) => { + var _a, _b, _c, _d, _e, _f; + this._process = spawn(this._serverParams.command, (_a = this._serverParams.args) !== null && _a !== void 0 ? _a : [], { + env: (_b = this._serverParams.env) !== null && _b !== void 0 ? _b : getDefaultEnvironment(), + stdio: ["pipe", "pipe", (_c = this._serverParams.stderr) !== null && _c !== void 0 ? _c : "inherit"], + shell: false, + signal: this._abortController.signal, + windowsHide: process.platform === "win32" && isElectron(), + }); + this._process.on("error", (error) => { + var _a, _b; + if (error.name === "AbortError") { + // Expected when close() is called. + (_a = this.onclose) === null || _a === void 0 ? void 0 : _a.call(this); + return; + } + reject(error); + (_b = this.onerror) === null || _b === void 0 ? void 0 : _b.call(this, error); + }); + this._process.on("spawn", () => { + resolve(); + }); + this._process.on("close", (_code) => { + var _a; + this._process = undefined; + (_a = this.onclose) === null || _a === void 0 ? void 0 : _a.call(this); + }); + (_d = this._process.stdin) === null || _d === void 0 ? void 0 : _d.on("error", (error) => { + var _a; + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + }); + (_e = this._process.stdout) === null || _e === void 0 ? void 0 : _e.on("data", (chunk) => { + this._readBuffer.append(chunk); + this.processReadBuffer(); + }); + (_f = this._process.stdout) === null || _f === void 0 ? void 0 : _f.on("error", (error) => { + var _a; + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + }); + }); + } + /** + * The stderr stream of the child process, if `StdioServerParameters.stderr` was set to "pipe" or "overlapped". + * + * This is only available after the process has been started. + */ + get stderr() { + var _a, _b; + return (_b = (_a = this._process) === null || _a === void 0 ? void 0 : _a.stderr) !== null && _b !== void 0 ? _b : null; + } + processReadBuffer() { + var _a, _b; + while (true) { + try { + const message = this._readBuffer.readMessage(); + if (message === null) { + break; + } + (_a = this.onmessage) === null || _a === void 0 ? void 0 : _a.call(this, message); + } + catch (error) { + (_b = this.onerror) === null || _b === void 0 ? void 0 : _b.call(this, error); + } + } + } + async close() { + this._abortController.abort(); + this._process = undefined; + this._readBuffer.clear(); + } + send(message) { + return new Promise((resolve) => { + var _a; + if (!((_a = this._process) === null || _a === void 0 ? void 0 : _a.stdin)) { + throw new Error("Not connected"); + } + const json = serializeMessage(message); + if (this._process.stdin.write(json)) { + resolve(); + } + else { + this._process.stdin.once("drain", resolve); + } + }); + } +} +function isElectron() { + return "type" in process; +} +//# sourceMappingURL=stdio.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/client/stdio.js.map b/front_end/third_party/mcp-sdk/package/dist/client/stdio.js.map new file mode 100644 index 0000000000..63b899076d --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/client/stdio.js.map @@ -0,0 +1 @@ +{"version":3,"file":"stdio.js","sourceRoot":"","sources":["../../src/client/stdio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AA+BlE;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GACrC,OAAO,CAAC,QAAQ,KAAK,OAAO;IAC1B,CAAC,CAAC;QACE,SAAS;QACT,WAAW;QACX,UAAU;QACV,cAAc;QACd,MAAM;QACN,wBAAwB;QACxB,aAAa;QACb,YAAY;QACZ,MAAM;QACN,UAAU;QACV,aAAa;KACd;IACH,CAAC,CAAC,0DAA0D;QAC1D,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAE3D;;GAEG;AACH,MAAM,UAAU,qBAAqB;IACnC,MAAM,GAAG,GAA2B,EAAE,CAAC;IAEvC,KAAK,MAAM,GAAG,IAAI,0BAA0B,EAAE,CAAC;QAC7C,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC/B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,SAAS;QACX,CAAC;QAED,IAAI,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YAC3B,6CAA6C;YAC7C,SAAS;QACX,CAAC;QAED,GAAG,CAAC,GAAG,CA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WAAW,EAAE,CAAC;gBAC/C,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;oBACrB,MAAM;gBACR,CAAC;gBAED,MAAA,IAAI,CAAC,SAAS,qDAAG,OAAO,CAAC,CAAC;YAC5B,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAA,IAAI,CAAC,OAAO,qDAAG,KAAc,CAAC,CAAC;YACjC,CAAC;QACH,CAAC;IACH,CAAC;IAED,KAAK,CAAC,KAAK;QACT,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,CAAC;QAC9B,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC;QAC1B,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;IAC3B,CAAC;IAED,IAAI,CAAC,OAAuB;QAC1B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;;YAC7B,IAAI,CAAC,CAAA,MAAA,IAAI,CAAC,QAAQ,0CAAE,KAAK,CAAA,EAAE,CAAC;gBAC1B,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;YACnC,CAAC;YAED,MAAM,IAAI,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;YACvC,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;gBACpC,OAAO,EAAE,CAAC;YACZ,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAC7C,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAED,SAAS,UAAU;IACjB,OAAO,MAAM,IAAI,OAAO,CAAC;AAC3B,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/client/stdio.test.d.ts b/front_end/third_party/mcp-sdk/package/dist/client/stdio.test.d.ts new file mode 100644 index 0000000000..08756f1fed --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/client/stdio.test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=stdio.test.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/client/stdio.test.d.ts.map b/front_end/third_party/mcp-sdk/package/dist/client/stdio.test.d.ts.map new file mode 100644 index 0000000000..57c12671a1 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/client/stdio.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"stdio.test.d.ts","sourceRoot":"","sources":["../../src/client/stdio.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/client/stdio.test.js b/front_end/third_party/mcp-sdk/package/dist/client/stdio.test.js new file mode 100644 index 0000000000..5ddf1c7d25 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/client/stdio.test.js @@ -0,0 +1,51 @@ +import { StdioClientTransport } from "./stdio.js"; +const serverParameters = { + command: "/usr/bin/tee", +}; +test("should start then close cleanly", async () => { + const client = new StdioClientTransport(serverParameters); + client.onerror = (error) => { + throw error; + }; + let didClose = false; + client.onclose = () => { + didClose = true; + }; + await client.start(); + expect(didClose).toBeFalsy(); + await client.close(); + expect(didClose).toBeTruthy(); +}); +test("should read messages", async () => { + const client = new StdioClientTransport(serverParameters); + client.onerror = (error) => { + throw error; + }; + const messages = [ + { + jsonrpc: "2.0", + id: 1, + method: "ping", + }, + { + jsonrpc: "2.0", + method: "notifications/initialized", + }, + ]; + const readMessages = []; + const finished = new Promise((resolve) => { + client.onmessage = (message) => { + readMessages.push(message); + if (JSON.stringify(message) === JSON.stringify(messages[1])) { + resolve(); + } + }; + }); + await client.start(); + await client.send(messages[0]); + await client.send(messages[1]); + await finished; + expect(readMessages).toEqual(messages); + await client.close(); +}); +//# sourceMappingURL=stdio.test.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/client/stdio.test.js.map b/front_end/third_party/mcp-sdk/package/dist/client/stdio.test.js.map new file mode 100644 index 0000000000..1af871c485 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/client/stdio.test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"stdio.test.js","sourceRoot":"","sources":["../../src/client/stdio.test.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAyB,MAAM,YAAY,CAAC;AAEzE,MAAM,gBAAgB,GAA0B;IAC9C,OAAO,EAAE,cAAc;CACxB,CAAC;AAEF,IAAI,CAAC,iCAAiC,EAAE,KAAK,IAAI,EAAE;IACjD,MAAM,MAAM,GAAG,IAAI,oBAAoB,CAAC,gBAAgB,CAAC,CAAC;IAC1D,MAAM,CAAC,OAAO,GAAG,CAAC,KAAK,EAAE,EAAE;QACzB,MAAM,KAAK,CAAC;IACd,CAAC,CAAC;IAEF,IAAI,QAAQ,GAAG,KAAK,CAAC;IACrB,MAAM,CAAC,OAAO,GAAG,GAAG,EAAE;QACpB,QAAQ,GAAG,IAAI,CAAC;IAClB,CAAC,CAAC;IAEF,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;IACrB,MAAM,CAAC,QAAQ,CAAC,CAAC,SAAS,EAAE,CAAC;IAC7B,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;IACrB,MAAM,CAAC,QAAQ,CAAC,CAAC,UAAU,EAAE,CAAC;AAChC,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;IACtC,MAAM,MAAM,GAAG,IAAI,oBAAoB,CAAC,gBAAgB,CAAC,CAAC;IAC1D,MAAM,CAAC,OAAO,GAAG,CAAC,KAAK,EAAE,EAAE;QACzB,MAAM,KAAK,CAAC;IACd,CAAC,CAAC;IAEF,MAAM,QAAQ,GAAqB;QACjC;YACE,OAAO,EAAE,KAAK;YACd,EAAE,EAAE,CAAC;YACL,MAAM,EAAE,MAAM;SACf;QACD;YACE,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,2BAA2B;SACpC;KACF,CAAC;IAEF,MAAM,YAAY,GAAqB,EAAE,CAAC;IAC1C,MAAM,QAAQ,GAAG,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;QAC7C,MAAM,CAAC,SAAS,GAAG,CAAC,OAAO,EAAE,EAAE;YAC7B,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAE3B,IAAI,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC5D,OAAO,EAAE,CAAC;YACZ,CAAC;QACH,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;IACrB,MAAM,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/B,MAAM,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/B,MAAM,QAAQ,CAAC;IACf,MAAM,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAEvC,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;AACvB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/client/websocket.d.ts b/front_end/third_party/mcp-sdk/package/dist/client/websocket.d.ts new file mode 100644 index 0000000000..53945e788c --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/client/websocket.d.ts @@ -0,0 +1,17 @@ +import { Transport } from "../shared/transport.js"; +import { JSONRPCMessage } from "../types.js"; +/** + * Client transport for WebSocket: this will connect to a server over the WebSocket protocol. + */ +export declare class WebSocketClientTransport implements Transport { + private _socket?; + private _url; + onclose?: () => void; + onerror?: (error: Error) => void; + onmessage?: (message: JSONRPCMessage) => void; + constructor(url: URL); + start(): Promise; + close(): Promise; + send(message: JSONRPCMessage): Promise; +} +//# sourceMappingURL=websocket.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/client/websocket.d.ts.map b/front_end/third_party/mcp-sdk/package/dist/client/websocket.d.ts.map new file mode 100644 index 0000000000..95d177c0f6 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/client/websocket.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"websocket.d.ts","sourceRoot":"","sources":["../../src/client/websocket.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAwB,MAAM,aAAa,CAAC;AAInE;;GAEG;AACH,qBAAa,wBAAyB,YAAW,SAAS;IACxD,OAAO,CAAC,OAAO,CAAC,CAAY;IAC5B,OAAO,CAAC,IAAI,CAAM;IAElB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;gBAElC,GAAG,EAAE,GAAG;IAIpB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAyChB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAI5B,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAW7C"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/client/websocket.js b/front_end/third_party/mcp-sdk/package/dist/client/websocket.js new file mode 100644 index 0000000000..a424f3b569 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/client/websocket.js @@ -0,0 +1,61 @@ +import { JSONRPCMessageSchema } from "../types.js"; +const SUBPROTOCOL = "mcp"; +/** + * Client transport for WebSocket: this will connect to a server over the WebSocket protocol. + */ +export class WebSocketClientTransport { + constructor(url) { + this._url = url; + } + start() { + if (this._socket) { + throw new Error("WebSocketClientTransport already started! If using Client class, note that connect() calls start() automatically."); + } + return new Promise((resolve, reject) => { + this._socket = new WebSocket(this._url, SUBPROTOCOL); + this._socket.onerror = (event) => { + var _a; + const error = "error" in event + ? event.error + : new Error(`WebSocket error: ${JSON.stringify(event)}`); + reject(error); + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + }; + this._socket.onopen = () => { + resolve(); + }; + this._socket.onclose = () => { + var _a; + (_a = this.onclose) === null || _a === void 0 ? void 0 : _a.call(this); + }; + this._socket.onmessage = (event) => { + var _a, _b; + let message; + try { + message = JSONRPCMessageSchema.parse(JSON.parse(event.data)); + } + catch (error) { + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + return; + } + (_b = this.onmessage) === null || _b === void 0 ? void 0 : _b.call(this, message); + }; + }); + } + async close() { + var _a; + (_a = this._socket) === null || _a === void 0 ? void 0 : _a.close(); + } + send(message) { + return new Promise((resolve, reject) => { + var _a; + if (!this._socket) { + reject(new Error("Not connected")); + return; + } + (_a = this._socket) === null || _a === void 0 ? void 0 : _a.send(JSON.stringify(message)); + resolve(); + }); + } +} +//# sourceMappingURL=websocket.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/client/websocket.js.map b/front_end/third_party/mcp-sdk/package/dist/client/websocket.js.map new file mode 100644 index 0000000000..8e62681460 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/client/websocket.js.map @@ -0,0 +1 @@ +{"version":3,"file":"websocket.js","sourceRoot":"","sources":["../../src/client/websocket.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnE,MAAM,WAAW,GAAG,KAAK,CAAC;AAE1B;;GAEG;AACH,MAAM,OAAO,wBAAwB;IAQnC,YAAY,GAAQ;QAClB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;IAClB,CAAC;IAED,KAAK;QACH,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CACb,mHAAmH,CACpH,CAAC;QACJ,CAAC;Q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C,OAAO,0CAAE,KAAK,EAAE,CAAC;IACxB,CAAC;IAED,IAAI,CAAC,OAAuB;QAC1B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;;YACrC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;gBAClB,MAAM,CAAC,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC;gBACnC,OAAO;YACT,CAAC;YAED,MAAA,IAAI,CAAC,OAAO,0CAAE,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;YAC5C,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC,CAAC;IACL,CAAC;CACF"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/inMemory.d.ts b/front_end/third_party/mcp-sdk/package/dist/inMemory.d.ts new file mode 100644 index 0000000000..326150354e --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/inMemory.d.ts @@ -0,0 +1,20 @@ +import { Transport } from "./shared/transport.js"; +import { JSONRPCMessage } from "./types.js"; +/** + * In-memory transport for creating clients and servers that talk to each other within the same process. + */ +export declare class InMemoryTransport implements Transport { + private _otherTransport?; + private _messageQueue; + onclose?: () => void; + onerror?: (error: Error) => void; + onmessage?: (message: JSONRPCMessage) => void; + /** + * Creates a pair of linked in-memory transports that can communicate with each other. One should be passed to a Client and one to a Server. + */ + static createLinkedPair(): [InMemoryTransport, InMemoryTransport]; + start(): Promise; + close(): Promise; + send(message: JSONRPCMessage): Promise; +} +//# sourceMappingURL=inMemory.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/inMemory.d.ts.map b/front_end/third_party/mcp-sdk/package/dist/inMemory.d.ts.map new file mode 100644 index 0000000000..1d11ae50ee --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/inMemory.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inMemory.d.ts","sourceRoot":"","sources":["../src/inMemory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C;;GAEG;AACH,qBAAa,iBAAkB,YAAW,SAAS;IACjD,OAAO,CAAC,eAAe,CAAC,CAAoB;IAC5C,OAAO,CAAC,aAAa,CAAwB;IAE7C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;IAE9C;;OAEG;IACH,MAAM,CAAC,gBAAgB,IAAI,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAQ3D,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAUtB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAOtB,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAWnD"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/inMemory.js b/front_end/third_party/mcp-sdk/package/dist/inMemory.js new file mode 100644 index 0000000000..c4689a2d37 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/inMemory.js @@ -0,0 +1,47 @@ +/** + * In-memory transport for creating clients and servers that talk to each other within the same process. + */ +export class InMemoryTransport { + constructor() { + this._messageQueue = []; + } + /** + * Creates a pair of linked in-memory transports that can communicate with each other. One should be passed to a Client and one to a Server. + */ + static createLinkedPair() { + const clientTransport = new InMemoryTransport(); + const serverTransport = new InMemoryTransport(); + clientTransport._otherTransport = serverTransport; + serverTransport._otherTransport = clientTransport; + return [clientTransport, serverTransport]; + } + async start() { + var _a; + // Process any messages that were queued before start was called + while (this._messageQueue.length > 0) { + const message = this._messageQueue.shift(); + if (message) { + (_a = this.onmessage) === null || _a === void 0 ? void 0 : _a.call(this, message); + } + } + } + async close() { + var _a; + const other = this._otherTransport; + this._otherTransport = undefined; + await (other === null || other === void 0 ? void 0 : other.close()); + (_a = this.onclose) === null || _a === void 0 ? void 0 : _a.call(this); + } + async send(message) { + if (!this._otherTransport) { + throw new Error("Not connected"); + } + if (this._otherTransport.onmessage) { + this._otherTransport.onmessage(message); + } + else { + this._otherTransport._messageQueue.push(message); + } + } +} +//# sourceMappingURL=inMemory.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/inMemory.js.map b/front_end/third_party/mcp-sdk/package/dist/inMemory.js.map new file mode 100644 index 0000000000..34738386c0 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/inMemory.js.map @@ -0,0 +1 @@ +{"version":3,"file":"inMemory.js","sourceRoot":"","sources":["../src/inMemory.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,OAAO,iBAAiB;IAA9B;QAEU,kBAAa,GAAqB,EAAE,CAAC;IA6C/C,CAAC;IAvCC;;OAEG;IACH,MAAM,CAAC,gBAAgB;QACrB,MAAM,eAAe,GAAG,IAAI,iBAAiB,EAAE,CAAC;QAChD,MAAM,eAAe,GAAG,IAAI,iBAAiB,EAAE,CAAC;QAChD,eAAe,CAAC,eAAe,GAAG,eAAe,CAAC;QAClD,eAAe,CAAC,eAAe,GAAG,eAAe,CAAC;QAClD,OAAO,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,KAAK;;QACT,gEAAgE;QAChE,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACrC,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;YAC3C,IAAI,OAAO,EAAE,CAAC;gBACZ,MAAA,IAAI,CAAC,SAAS,qDAAG,OAAO,CAAC,CAAC;YAC5B,CAAC;QACH,CAAC;IACH,CAAC;IAED,KAAK,CAAC,KAAK;;QACT,MAAM,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC;QACnC,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC;QACjC,MAAM,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK,EAAE,CAAA,CAAC;QACrB,MAAA,IAAI,CAAC,OAAO,oDAAI,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,OAAuB;QAChC,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;QACnC,CAAC;QAED,IAAI,IAAI,CAAC,eAAe,CAAC,SAAS,EAAE,CAAC;YACnC,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QAC1C,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACnD,CAAC;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/inMemory.test.d.ts b/front_end/third_party/mcp-sdk/package/dist/inMemory.test.d.ts new file mode 100644 index 0000000000..a201a0e9a0 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/inMemory.test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=inMemory.test.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/inMemory.test.d.ts.map b/front_end/third_party/mcp-sdk/package/dist/inMemory.test.d.ts.map new file mode 100644 index 0000000000..c9bb4d7878 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/inMemory.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inMemory.test.d.ts","sourceRoot":"","sources":["../src/inMemory.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/inMemory.test.js b/front_end/third_party/mcp-sdk/package/dist/inMemory.test.js new file mode 100644 index 0000000000..7a5703ee8a --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/inMemory.test.js @@ -0,0 +1,74 @@ +import { InMemoryTransport } from "./inMemory.js"; +describe("InMemoryTransport", () => { + let clientTransport; + let serverTransport; + beforeEach(() => { + [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair(); + }); + test("should create linked pair", () => { + expect(clientTransport).toBeDefined(); + expect(serverTransport).toBeDefined(); + }); + test("should start without error", async () => { + await expect(clientTransport.start()).resolves.not.toThrow(); + await expect(serverTransport.start()).resolves.not.toThrow(); + }); + test("should send message from client to server", async () => { + const message = { + jsonrpc: "2.0", + method: "test", + id: 1, + }; + let receivedMessage; + serverTransport.onmessage = (msg) => { + receivedMessage = msg; + }; + await clientTransport.send(message); + expect(receivedMessage).toEqual(message); + }); + test("should send message from server to client", async () => { + const message = { + jsonrpc: "2.0", + method: "test", + id: 1, + }; + let receivedMessage; + clientTransport.onmessage = (msg) => { + receivedMessage = msg; + }; + await serverTransport.send(message); + expect(receivedMessage).toEqual(message); + }); + test("should handle close", async () => { + let clientClosed = false; + let serverClosed = false; + clientTransport.onclose = () => { + clientClosed = true; + }; + serverTransport.onclose = () => { + serverClosed = true; + }; + await clientTransport.close(); + expect(clientClosed).toBe(true); + expect(serverClosed).toBe(true); + }); + test("should throw error when sending after close", async () => { + await clientTransport.close(); + await expect(clientTransport.send({ jsonrpc: "2.0", method: "test", id: 1 })).rejects.toThrow("Not connected"); + }); + test("should queue messages sent before start", async () => { + const message = { + jsonrpc: "2.0", + method: "test", + id: 1, + }; + let receivedMessage; + serverTransport.onmessage = (msg) => { + receivedMessage = msg; + }; + await clientTransport.send(message); + await serverTransport.start(); + expect(receivedMessage).toEqual(message); + }); +}); +//# sourceMappingURL=inMemory.test.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/inMemory.test.js.map b/front_end/third_party/mcp-sdk/package/dist/inMemory.test.js.map new file mode 100644 index 0000000000..9f9f240e06 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/inMemory.test.js.map @@ -0,0 +1 @@ +{"version":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AAC,CAAC,CAAC;IAEH,IAAI,CAAC,yCAAyC,EAAE,KAAK,IAAI,EAAE;QACzD,MAAM,OAAO,GAAmB;YAC9B,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,MAAM;YACd,EAAE,EAAE,CAAC;SACN,CAAC;QAEF,IAAI,eAA2C,CAAC;QAChD,eAAe,CAAC,SAAS,GAAG,CAAC,GAAG,EAAE,EAAE;YAClC,eAAe,GAAG,GAAG,CAAC;QACxB,CAAC,CAAC;QAEF,MAAM,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpC,MAAM,eAAe,CAAC,KAAK,EAAE,CAAC;QAC9B,MAAM,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/server/index.d.ts b/front_end/third_party/mcp-sdk/package/dist/server/index.d.ts new file mode 100644 index 0000000000..2dbc605567 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/server/index.d.ts @@ -0,0 +1,112 @@ +import { Protocol, ProtocolOptions, RequestOptions } from "../shared/protocol.js"; +import { ClientCapabilities, CreateMessageRequest, Implementation, ListRootsRequest, LoggingMessageNotification, Notification, Request, ResourceUpdatedNotification, Result, ServerCapabilities, ServerNotification, ServerRequest, ServerResult } from "../types.js"; +export type ServerOptions = ProtocolOptions & { + /** + * Capabilities to advertise as being supported by this server. + */ + capabilities: ServerCapabilities; +}; +/** + * An MCP server on top of a pluggable transport. + * + * This server will automatically respond to the initialization flow as initiated from the client. + * + * To use with custom types, extend the base Request/Notification/Result types and pass them as type parameters: + * + * ```typescript + * // Custom schemas + * const CustomRequestSchema = RequestSchema.extend({...}) + * const CustomNotificationSchema = NotificationSchema.extend({...}) + * const CustomResultSchema = ResultSchema.extend({...}) + * + * // Type aliases + * type CustomRequest = z.infer + * type CustomNotification = z.infer + * type CustomResult = z.infer + * + * // Create typed server + * const server = new Server({ + * name: "CustomServer", + * version: "1.0.0" + * }) + * ``` + */ +export declare class Server extends Protocol { + private _serverInfo; + private _clientCapabilities?; + private _clientVersion?; + private _capabilities; + /** + * Callback for when initialization has fully completed (i.e., the client has sent an `initialized` notification). + */ + oninitialized?: () => void; + /** + * Initializes this server with the given name and version information. + */ + constructor(_serverInfo: Implementation, options: ServerOptions); + protected assertCapabilityForMethod(method: RequestT["method"]): void; + protected assertNotificationCapability(method: (ServerNotification | NotificationT)["method"]): void; + protected assertRequestHandlerCapability(method: string): void; + private _oninitialize; + /** + * After initialization has completed, this will be populated with the client's reported capabilities. + */ + getClientCapabilities(): ClientCapabilities | undefined; + /** + * After initialization has completed, this will be populated with information about the client's name and version. + */ + getClientVersion(): Implementation | undefined; + private getCapabilities; + ping(): Promise<{ + _meta?: import("zod").objectOutputType<{}, import("zod").ZodTypeAny, "passthrough"> | undefined; + }>; + createMessage(params: CreateMessageRequest["params"], options?: RequestOptions): Promise, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + model: import("zod").ZodString; + stopReason: import("zod").ZodOptional, import("zod").ZodString]>>; + role: import("zod").ZodEnum<["user", "assistant"]>; + content: import("zod").ZodDiscriminatedUnion<"type", [import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>]>; + }>, import("zod").ZodTypeAny, "passthrough">>; + listRoots(params?: ListRootsRequest["params"], options?: RequestOptions): Promise, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + roots: import("zod").ZodArray; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + uri: import("zod").ZodString; + name: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + uri: import("zod").ZodString; + name: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">>, "many">; + }>, import("zod").ZodTypeAny, "passthrough">>; + sendLoggingMessage(params: LoggingMessageNotification["params"]): Promise; + sendResourceUpdated(params: ResourceUpdatedNotification["params"]): Promise; + sendResourceListChanged(): Promise; + sendToolListChanged(): Promise; + sendPromptListChanged(): Promise; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/server/index.d.ts.map b/front_end/third_party/mcp-sdk/package/dist/server/index.d.ts.map new file mode 100644 index 0000000000..fc58897994 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/server/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,eAAe,EACf,cAAc,EACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EAGpB,cAAc,EAMd,gBAAgB,EAEhB,0BAA0B,EAC1B,YAAY,EACZ,OAAO,EACP,2BAA2B,EAC3B,MAAM,EACN,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,YAAY,EAEb,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,aAAa,GAAG,eAAe,GAAG;IAC5C;;OAEG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kB,CAAC,MAAM,EAAE,0BAA0B,CAAC,QAAQ,CAAC;IAI/D,mBAAmB,CAAC,MAAM,EAAE,2BAA2B,CAAC,QAAQ,CAAC;IAOjE,uBAAuB;IAMvB,mBAAmB;IAInB,qBAAqB;CAG5B"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/server/index.js b/front_end/third_party/mcp-sdk/package/dist/server/index.js new file mode 100644 index 0000000000..84e79b4519 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/server/index.js @@ -0,0 +1,182 @@ +import { Protocol, } from "../shared/protocol.js"; +import { CreateMessageResultSchema, EmptyResultSchema, InitializedNotificationSchema, InitializeRequestSchema, LATEST_PROTOCOL_VERSION, ListRootsResultSchema, SUPPORTED_PROTOCOL_VERSIONS, } from "../types.js"; +/** + * An MCP server on top of a pluggable transport. + * + * This server will automatically respond to the initialization flow as initiated from the client. + * + * To use with custom types, extend the base Request/Notification/Result types and pass them as type parameters: + * + * ```typescript + * // Custom schemas + * const CustomRequestSchema = RequestSchema.extend({...}) + * const CustomNotificationSchema = NotificationSchema.extend({...}) + * const CustomResultSchema = ResultSchema.extend({...}) + * + * // Type aliases + * type CustomRequest = z.infer + * type CustomNotification = z.infer + * type CustomResult = z.infer + * + * // Create typed server + * const server = new Server({ + * name: "CustomServer", + * version: "1.0.0" + * }) + * ``` + */ +export class Server extends Protocol { + /** + * Initializes this server with the given name and version information. + */ + constructor(_serverInfo, options) { + super(options); + this._serverInfo = _serverInfo; + this._capabilities = options.capabilities; + this.setRequestHandler(InitializeRequestSchema, (request) => this._oninitialize(request)); + this.setNotificationHandler(InitializedNotificationSchema, () => { var _a; return (_a = this.oninitialized) === null || _a === void 0 ? void 0 : _a.call(this); }); + } + assertCapabilityForMethod(method) { + var _a, _b; + switch (method) { + case "sampling/createMessage": + if (!((_a = this._clientCapabilities) === null || _a === void 0 ? void 0 : _a.sampling)) { + throw new Error(`Client does not support sampling (required for ${method})`); + } + break; + case "roots/list": + if (!((_b = this._clientCapabilities) === null || _b === void 0 ? void 0 : _b.roots)) { + throw new Error(`Client does not support listing roots (required for ${method})`); + } + break; + case "ping": + // No specific capability required for ping + break; + } + } + assertNotificationCapability(method) { + switch (method) { + case "notifications/message": + if (!this._capabilities.logging) { + throw new Error(`Server does not support logging (required for ${method})`); + } + break; + case "notifications/resources/updated": + case "notifications/resources/list_changed": + if (!this._capabilities.resources) { + throw new Error(`Server does not support notifying about resources (required for ${method})`); + } + break; + case "notifications/tools/list_changed": + if (!this._capabilities.tools) { + throw new Error(`Server does not support notifying of tool list changes (required for ${method})`); + } + break; + case "notifications/prompts/list_changed": + if (!this._capabilities.prompts) { + throw new Error(`Server does not support notifying of prompt list changes (required for ${method})`); + } + break; + case "notifications/cancelled": + // Cancellation notifications are always allowed + break; + case "notifications/progress": + // Progress notifications are always allowed + break; + } + } + assertRequestHandlerCapability(method) { + switch (method) { + case "sampling/createMessage": + if (!this._capabilities.sampling) { + throw new Error(`Server does not support sampling (required for ${method})`); + } + break; + case "logging/setLevel": + if (!this._capabilities.logging) { + throw new Error(`Server does not support logging (required for ${method})`); + } + break; + case "prompts/get": + case "prompts/list": + if (!this._capabilities.prompts) { + throw new Error(`Server does not support prompts (required for ${method})`); + } + break; + case "resources/list": + case "resources/templates/list": + case "resources/read": + if (!this._capabilities.resources) { + throw new Error(`Server does not support resources (required for ${method})`); + } + break; + case "tools/call": + case "tools/list": + if (!this._capabilities.tools) { + throw new Error(`Server does not support tools (required for ${method})`); + } + break; + case "ping": + case "initialize": + // No specific capability required for these methods + break; + } + } + async _oninitialize(request) { + const requestedVersion = request.params.protocolVersion; + this._clientCapabilities = request.params.capabilities; + this._clientVersion = request.params.clientInfo; + return { + protocolVersion: SUPPORTED_PROTOCOL_VERSIONS.includes(requestedVersion) + ? requestedVersion + : LATEST_PROTOCOL_VERSION, + capabilities: this.getCapabilities(), + serverInfo: this._serverInfo, + }; + } + /** + * After initialization has completed, this will be populated with the client's reported capabilities. + */ + getClientCapabilities() { + return this._clientCapabilities; + } + /** + * After initialization has completed, this will be populated with information about the client's name and version. + */ + getClientVersion() { + return this._clientVersion; + } + getCapabilities() { + return this._capabilities; + } + async ping() { + return this.request({ method: "ping" }, EmptyResultSchema); + } + async createMessage(params, options) { + return this.request({ method: "sampling/createMessage", params }, CreateMessageResultSchema, options); + } + async listRoots(params, options) { + return this.request({ method: "roots/list", params }, ListRootsResultSchema, options); + } + async sendLoggingMessage(params) { + return this.notification({ method: "notifications/message", params }); + } + async sendResourceUpdated(params) { + return this.notification({ + method: "notifications/resources/updated", + params, + }); + } + async sendResourceListChanged() { + return this.notification({ + method: "notifications/resources/list_changed", + }); + } + async sendToolListChanged() { + return this.notification({ method: "notifications/tools/list_changed" }); + } + async sendPromptListChanged() { + return this.notification({ method: "notifications/prompts/list_changed" }); + } +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/server/index.js.map b/front_end/third_party/mcp-sdk/package/dist/server/index.js.map new file mode 100644 index 0000000000..adfcb8c1ee --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/server/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,GAGT,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAGL,yBAAyB,EACzB,iBAAiB,EAEjB,6BAA6B,EAE7B,uBAAuB,EAEvB,uBAAuB,EAEvB,qBAAqB,EAUrB,2BAA2B,GAC5B,MAAM,aAAa,CAAC;AASrB;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,OAAO,MAIX,SAAQ,QAIT;IAUC;;OAEG;IACH,YACU,WAA2B,EACnC,OAAsB;QAEtB,KAAK,CAAC,OAAO,CAAC,CAAC;QAHP,gBAAW,GAAX,WAAW,CAAgB;QAInC,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;QAE1C,IAAI,CAAC,iBAA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AO,CACR,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,SAAS,CACb,MAAmC,EACnC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CACjB,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,EAChC,qBAAqB,EACrB,OAAO,CACR,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,MAA4C;QACnE,OAAO,IAAI,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,uBAAuB,EAAE,MAAM,EAAE,CAAC,CAAC;IACxE,CAAC;IAED,KAAK,CAAC,mBAAmB,CAAC,MAA6C;QACrE,OAAO,IAAI,CAAC,YAAY,CAAC;YACvB,MAAM,EAAE,iCAAiC;YACzC,MAAM;SACP,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,uBAAuB;QAC3B,OAAO,IAAI,CAAC,YAAY,CAAC;YACvB,MAAM,EAAE,sCAAsC;SAC/C,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,mBAAmB;QACvB,OAAO,IAAI,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,kCAAkC,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED,KAAK,CAAC,qBAAqB;QACzB,OAAO,IAAI,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,oCAAoC,EAAE,CAAC,CAAC;IAC7E,CAAC;CACF"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/server/index.test.d.ts b/front_end/third_party/mcp-sdk/package/dist/server/index.test.d.ts new file mode 100644 index 0000000000..121d59b38b --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/server/index.test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=index.test.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/server/index.test.d.ts.map b/front_end/third_party/mcp-sdk/package/dist/server/index.test.d.ts.map new file mode 100644 index 0000000000..2bf7a5d156 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/server/index.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../src/server/index.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/server/index.test.js b/front_end/third_party/mcp-sdk/package/dist/server/index.test.js new file mode 100644 index 0000000000..a0b2d05bd3 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/server/index.test.js @@ -0,0 +1,408 @@ +/* eslint-disable @typescript-eslint/no-unused-vars */ +/* eslint-disable no-constant-binary-expression */ +/* eslint-disable @typescript-eslint/no-unused-expressions */ +import { Server } from "./index.js"; +import { z } from "zod"; +import { RequestSchema, NotificationSchema, ResultSchema, LATEST_PROTOCOL_VERSION, SUPPORTED_PROTOCOL_VERSIONS, CreateMessageRequestSchema, ListPromptsRequestSchema, ListResourcesRequestSchema, ListToolsRequestSchema, SetLevelRequestSchema, ErrorCode, } from "../types.js"; +import { InMemoryTransport } from "../inMemory.js"; +import { Client } from "../client/index.js"; +test("should accept latest protocol version", async () => { + var _a; + let sendPromiseResolve; + const sendPromise = new Promise((resolve) => { + sendPromiseResolve = resolve; + }); + const serverTransport = { + start: jest.fn().mockResolvedValue(undefined), + close: jest.fn().mockResolvedValue(undefined), + send: jest.fn().mockImplementation((message) => { + if (message.id === 1 && message.result) { + expect(message.result).toEqual({ + protocolVersion: LATEST_PROTOCOL_VERSION, + capabilities: expect.any(Object), + serverInfo: { + name: "test server", + version: "1.0", + }, + }); + sendPromiseResolve(undefined); + } + return Promise.resolve(); + }), + }; + const server = new Server({ + name: "test server", + version: "1.0", + }, { + capabilities: { + prompts: {}, + resources: {}, + tools: {}, + logging: {}, + }, + }); + await server.connect(serverTransport); + // Simulate initialize request with latest version + (_a = serverTransport.onmessage) === null || _a === void 0 ? void 0 : _a.call(serverTransport, { + jsonrpc: "2.0", + id: 1, + method: "initialize", + params: { + protocolVersion: LATEST_PROTOCOL_VERSION, + capabilities: {}, + clientInfo: { + name: "test client", + version: "1.0", + }, + }, + }); + await expect(sendPromise).resolves.toBeUndefined(); +}); +test("should accept supported older protocol version", async () => { + var _a; + const OLD_VERSION = SUPPORTED_PROTOCOL_VERSIONS[1]; + let sendPromiseResolve; + const sendPromise = new Promise((resolve) => { + sendPromiseResolve = resolve; + }); + const serverTransport = { + start: jest.fn().mockResolvedValue(undefined), + close: jest.fn().mockResolvedValue(undefined), + send: jest.fn().mockImplementation((message) => { + if (message.id === 1 && message.result) { + expect(message.result).toEqual({ + protocolVersion: OLD_VERSION, + capabilities: expect.any(Object), + serverInfo: { + name: "test server", + version: "1.0", + }, + }); + sendPromiseResolve(undefined); + } + return Promise.resolve(); + }), + }; + const server = new Server({ + name: "test server", + version: "1.0", + }, { + capabilities: { + prompts: {}, + resources: {}, + tools: {}, + logging: {}, + }, + }); + await server.connect(serverTransport); + // Simulate initialize request with older version + (_a = serverTransport.onmessage) === null || _a === void 0 ? void 0 : _a.call(serverTransport, { + jsonrpc: "2.0", + id: 1, + method: "initialize", + params: { + protocolVersion: OLD_VERSION, + capabilities: {}, + clientInfo: { + name: "test client", + version: "1.0", + }, + }, + }); + await expect(sendPromise).resolves.toBeUndefined(); +}); +test("should handle unsupported protocol version", async () => { + var _a; + let sendPromiseResolve; + const sendPromise = new Promise((resolve) => { + sendPromiseResolve = resolve; + }); + const serverTransport = { + start: jest.fn().mockResolvedValue(undefined), + close: jest.fn().mockResolvedValue(undefined), + send: jest.fn().mockImplementation((message) => { + if (message.id === 1 && message.result) { + expect(message.result).toEqual({ + protocolVersion: LATEST_PROTOCOL_VERSION, + capabilities: expect.any(Object), + serverInfo: { + name: "test server", + version: "1.0", + }, + }); + sendPromiseResolve(undefined); + } + return Promise.resolve(); + }), + }; + const server = new Server({ + name: "test server", + version: "1.0", + }, { + capabilities: { + prompts: {}, + resources: {}, + tools: {}, + logging: {}, + }, + }); + await server.connect(serverTransport); + // Simulate initialize request with unsupported version + (_a = serverTransport.onmessage) === null || _a === void 0 ? void 0 : _a.call(serverTransport, { + jsonrpc: "2.0", + id: 1, + method: "initialize", + params: { + protocolVersion: "invalid-version", + capabilities: {}, + clientInfo: { + name: "test client", + version: "1.0", + }, + }, + }); + await expect(sendPromise).resolves.toBeUndefined(); +}); +test("should respect client capabilities", async () => { + const server = new Server({ + name: "test server", + version: "1.0", + }, { + capabilities: { + prompts: {}, + resources: {}, + tools: {}, + logging: {}, + }, + enforceStrictCapabilities: true, + }); + const client = new Client({ + name: "test client", + version: "1.0", + }, { + capabilities: { + sampling: {}, + }, + }); + // Implement request handler for sampling/createMessage + client.setRequestHandler(CreateMessageRequestSchema, async (request) => { + // Mock implementation of createMessage + return { + model: "test-model", + role: "assistant", + content: { + type: "text", + text: "This is a test response", + }, + }; + }); + const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair(); + await Promise.all([ + client.connect(clientTransport), + server.connect(serverTransport), + ]); + expect(server.getClientCapabilities()).toEqual({ sampling: {} }); + // This should work because sampling is supported by the client + await expect(server.createMessage({ + messages: [], + maxTokens: 10, + })).resolves.not.toThrow(); + // This should still throw because roots are not supported by the client + await expect(server.listRoots()).rejects.toThrow(/^Client does not support/); +}); +test("should respect server notification capabilities", async () => { + const server = new Server({ + name: "test server", + version: "1.0", + }, { + capabilities: { + logging: {}, + }, + enforceStrictCapabilities: true, + }); + const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair(); + await server.connect(serverTransport); + // This should work because logging is supported by the server + await expect(server.sendLoggingMessage({ + level: "info", + data: "Test log message", + })).resolves.not.toThrow(); + // This should throw because resource notificaitons are not supported by the server + await expect(server.sendResourceUpdated({ uri: "test://resource" })).rejects.toThrow(/^Server does not support/); +}); +test("should only allow setRequestHandler for declared capabilities", () => { + const server = new Server({ + name: "test server", + version: "1.0", + }, { + capabilities: { + prompts: {}, + resources: {}, + }, + }); + // These should work because the capabilities are declared + expect(() => { + server.setRequestHandler(ListPromptsRequestSchema, () => ({ prompts: [] })); + }).not.toThrow(); + expect(() => { + server.setRequestHandler(ListResourcesRequestSchema, () => ({ + resources: [], + })); + }).not.toThrow(); + // These should throw because the capabilities are not declared + expect(() => { + server.setRequestHandler(ListToolsRequestSchema, () => ({ tools: [] })); + }).toThrow(/^Server does not support tools/); + expect(() => { + server.setRequestHandler(SetLevelRequestSchema, () => ({})); + }).toThrow(/^Server does not support logging/); +}); +/* + Test that custom request/notification/result schemas can be used with the Server class. + */ +test("should typecheck", () => { + const GetWeatherRequestSchema = RequestSchema.extend({ + method: z.literal("weather/get"), + params: z.object({ + city: z.string(), + }), + }); + const GetForecastRequestSchema = RequestSchema.extend({ + method: z.literal("weather/forecast"), + params: z.object({ + city: z.string(), + days: z.number(), + }), + }); + const WeatherForecastNotificationSchema = NotificationSchema.extend({ + method: z.literal("weather/alert"), + params: z.object({ + severity: z.enum(["warning", "watch"]), + message: z.string(), + }), + }); + const WeatherRequestSchema = GetWeatherRequestSchema.or(GetForecastRequestSchema); + const WeatherNotificationSchema = WeatherForecastNotificationSchema; + const WeatherResultSchema = ResultSchema.extend({ + temperature: z.number(), + conditions: z.string(), + }); + // Create a typed Server for weather data + const weatherServer = new Server({ + name: "WeatherServer", + version: "1.0.0", + }, { + capabilities: { + prompts: {}, + resources: {}, + tools: {}, + logging: {}, + }, + }); + // Typecheck that only valid weather requests/notifications/results are allowed + weatherServer.setRequestHandler(GetWeatherRequestSchema, (request) => { + return { + temperature: 72, + conditions: "sunny", + }; + }); + weatherServer.setNotificationHandler(WeatherForecastNotificationSchema, (notification) => { + console.log(`Weather alert: ${notification.params.message}`); + }); +}); +test("should handle server cancelling a request", async () => { + const server = new Server({ + name: "test server", + version: "1.0", + }, { + capabilities: { + sampling: {}, + }, + }); + const client = new Client({ + name: "test client", + version: "1.0", + }, { + capabilities: { + sampling: {}, + }, + }); + // Set up client to delay responding to createMessage + client.setRequestHandler(CreateMessageRequestSchema, async (_request, extra) => { + await new Promise((resolve) => setTimeout(resolve, 1000)); + return { + model: "test", + role: "assistant", + content: { + type: "text", + text: "Test response", + }, + }; + }); + const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair(); + await Promise.all([ + client.connect(clientTransport), + server.connect(serverTransport), + ]); + // Set up abort controller + const controller = new AbortController(); + // Issue request but cancel it immediately + const createMessagePromise = server.createMessage({ + messages: [], + maxTokens: 10, + }, { + signal: controller.signal, + }); + controller.abort("Cancelled by test"); + // Request should be rejected + await expect(createMessagePromise).rejects.toBe("Cancelled by test"); +}); +test("should handle request timeout", async () => { + const server = new Server({ + name: "test server", + version: "1.0", + }, { + capabilities: { + sampling: {}, + }, + }); + // Set up client that delays responses + const client = new Client({ + name: "test client", + version: "1.0", + }, { + capabilities: { + sampling: {}, + }, + }); + client.setRequestHandler(CreateMessageRequestSchema, async (_request, extra) => { + await new Promise((resolve, reject) => { + const timeout = setTimeout(resolve, 100); + extra.signal.addEventListener("abort", () => { + clearTimeout(timeout); + reject(extra.signal.reason); + }); + }); + return { + model: "test", + role: "assistant", + content: { + type: "text", + text: "Test response", + }, + }; + }); + const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair(); + await Promise.all([ + client.connect(clientTransport), + server.connect(serverTransport), + ]); + // Request with 0 msec timeout should fail immediately + await expect(server.createMessage({ + messages: [], + maxTokens: 10, + }, { timeout: 0 })).rejects.toMatchObject({ + code: ErrorCode.RequestTimeout, + }); +}); +//# sourceMappingURL=index.test.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/server/index.test.js.map b/front_end/third_party/mcp-sdk/package/dist/server/index.test.js.map new file mode 100644 index 0000000000..5810586c2d --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/server/index.test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../src/server/index.test.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,kDAAkD;AAClD,6DAA6D;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC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gBACP,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,eAAe;aACtB;SACF,CAAC;IACJ,CAAC,CACF,CAAC;IAEF,MAAM,CAAC,eAAe,EAAE,eAAe,CAAC,GACtC,iBAAiB,CAAC,gBAAgB,EAAE,CAAC;IAEvC,MAAM,OAAO,CAAC,GAAG,CAAC;QAChB,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC;QAC/B,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC;KAChC,CAAC,CAAC;IAEH,sDAAsD;IACtD,MAAM,MAAM,CACV,MAAM,CAAC,aAAa,CAClB;QACE,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,EAAE;KACd,EACD,EAAE,OAAO,EAAE,CAAC,EAAE,CACf,CACF,CAAC,OAAO,CAAC,aAAa,CAAC;QACtB,IAAI,EAAE,SAAS,CAAC,cAAc;KAC/B,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/server/sse.d.ts b/front_end/third_party/mcp-sdk/package/dist/server/sse.d.ts new file mode 100644 index 0000000000..0b178f1a6a --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/server/sse.d.ts @@ -0,0 +1,46 @@ +import { IncomingMessage, ServerResponse } from "node:http"; +import { Transport } from "../shared/transport.js"; +import { JSONRPCMessage } from "../types.js"; +/** + * Server transport for SSE: this will send messages over an SSE connection and receive messages from HTTP POST requests. + * + * This transport is only available in Node.js environments. + */ +export declare class SSEServerTransport implements Transport { + private _endpoint; + private res; + private _sseResponse?; + private _sessionId; + onclose?: () => void; + onerror?: (error: Error) => void; + onmessage?: (message: JSONRPCMessage) => void; + /** + * Creates a new SSE server transport, which will direct the client to POST messages to the relative or absolute URL identified by `_endpoint`. + */ + constructor(_endpoint: string, res: ServerResponse); + /** + * Handles the initial SSE connection request. + * + * This should be called when a GET request is made to establish the SSE stream. + */ + start(): Promise; + /** + * Handles incoming POST messages. + * + * This should be called when a POST request is made to send a message to the server. + */ + handlePostMessage(req: IncomingMessage, res: ServerResponse, parsedBody?: unknown): Promise; + /** + * Handle a client message, regardless of how it arrived. This can be used to inform the server of messages that arrive via a means different than HTTP POST. + */ + handleMessage(message: unknown): Promise; + close(): Promise; + send(message: JSONRPCMessage): Promise; + /** + * Returns the session ID for this transport. + * + * This can be used to route incoming POST requests. + */ + get sessionId(): string; +} +//# sourceMappingURL=sse.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/server/sse.d.ts.map b/front_end/third_party/mcp-sdk/package/dist/server/sse.d.ts.map new file mode 100644 index 0000000000..d64e193f4d --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/server/sse.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"sse.d.ts","sourceRoot":"","sources":["../../src/server/sse.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAwB,MAAM,aAAa,CAAC;AAMnE;;;;GAIG;AACH,qBAAa,kBAAmB,YAAW,SAAS;IAYhD,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,GAAG;IAZb,OAAO,CAAC,YAAY,CAAC,CAAiB;IACtC,OAAO,CAAC,UAAU,CAAS;IAE3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;IAE9C;;OAEG;gBAEO,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,cAAc;IAK7B;;;;OAIG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAyB5B;;;;OAIG;IACG,iBAAiB,CACrB,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,UAAU,CAAC,EAAE,OAAO,GACnB,OAAO,CAAC,IAAI,CAAC;IAkChB;;OAEG;IACG,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAY9C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAMtB,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAUlD;;;;OAIG;IACH,IAAI,SAAS,IAAI,MAAM,CAEtB;CACF"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/server/sse.js b/front_end/third_party/mcp-sdk/package/dist/server/sse.js new file mode 100644 index 0000000000..efdf79a668 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/server/sse.js @@ -0,0 +1,116 @@ +import { randomUUID } from "node:crypto"; +import { JSONRPCMessageSchema } from "../types.js"; +import getRawBody from "raw-body"; +import contentType from "content-type"; +const MAXIMUM_MESSAGE_SIZE = "4mb"; +/** + * Server transport for SSE: this will send messages over an SSE connection and receive messages from HTTP POST requests. + * + * This transport is only available in Node.js environments. + */ +export class SSEServerTransport { + /** + * Creates a new SSE server transport, which will direct the client to POST messages to the relative or absolute URL identified by `_endpoint`. + */ + constructor(_endpoint, res) { + this._endpoint = _endpoint; + this.res = res; + this._sessionId = randomUUID(); + } + /** + * Handles the initial SSE connection request. + * + * This should be called when a GET request is made to establish the SSE stream. + */ + async start() { + if (this._sseResponse) { + throw new Error("SSEServerTransport already started! If using Server class, note that connect() calls start() automatically."); + } + this.res.writeHead(200, { + "Content-Type": "text/event-stream", + "Cache-Control": "no-cache", + Connection: "keep-alive", + }); + // Send the endpoint event + this.res.write(`event: endpoint\ndata: ${encodeURI(this._endpoint)}?sessionId=${this._sessionId}\n\n`); + this._sseResponse = this.res; + this.res.on("close", () => { + var _a; + this._sseResponse = undefined; + (_a = this.onclose) === null || _a === void 0 ? void 0 : _a.call(this); + }); + } + /** + * Handles incoming POST messages. + * + * This should be called when a POST request is made to send a message to the server. + */ + async handlePostMessage(req, res, parsedBody) { + var _a, _b, _c; + if (!this._sseResponse) { + const message = "SSE connection not established"; + res.writeHead(500).end(message); + throw new Error(message); + } + let body; + try { + const ct = contentType.parse((_a = req.headers["content-type"]) !== null && _a !== void 0 ? _a : ""); + if (ct.type !== "application/json") { + throw new Error(`Unsupported content-type: ${ct}`); + } + body = parsedBody !== null && parsedBody !== void 0 ? parsedBody : await getRawBody(req, { + limit: MAXIMUM_MESSAGE_SIZE, + encoding: (_b = ct.parameters.charset) !== null && _b !== void 0 ? _b : "utf-8", + }); + } + catch (error) { + res.writeHead(400).end(String(error)); + (_c = this.onerror) === null || _c === void 0 ? void 0 : _c.call(this, error); + return; + } + try { + await this.handleMessage(typeof body === 'string' ? JSON.parse(body) : body); + } + catch (_d) { + res.writeHead(400).end(`Invalid message: ${body}`); + return; + } + res.writeHead(202).end("Accepted"); + } + /** + * Handle a client message, regardless of how it arrived. This can be used to inform the server of messages that arrive via a means different than HTTP POST. + */ + async handleMessage(message) { + var _a, _b; + let parsedMessage; + try { + parsedMessage = JSONRPCMessageSchema.parse(message); + } + catch (error) { + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + throw error; + } + (_b = this.onmessage) === null || _b === void 0 ? void 0 : _b.call(this, parsedMessage); + } + async close() { + var _a, _b; + (_a = this._sseResponse) === null || _a === void 0 ? void 0 : _a.end(); + this._sseResponse = undefined; + (_b = this.onclose) === null || _b === void 0 ? void 0 : _b.call(this); + } + async send(message) { + if (!this._sseResponse) { + throw new Error("Not connected"); + } + this._sseResponse.write(`event: message\ndata: ${JSON.stringify(message)}\n\n`); + } + /** + * Returns the session ID for this transport. + * + * This can be used to route incoming POST requests. + */ + get sessionId() { + return this._sessionId; + } +} +//# sourceMappingURL=sse.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/server/sse.js.map b/front_end/third_party/mcp-sdk/package/dist/server/sse.js.map new file mode 100644 index 0000000000..e611e5da7a --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/server/sse.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sse.js","sourceRoot":"","sources":["../../src/server/sse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,OAAO,EAAkB,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,UAAU,MAAM,UAAU,CAAC;AAClC,OAAO,WAAW,MAAM,cAAc,CAAC;AAEvC,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAEnC;;;;GAIG;AACH,MAAM,OAAO,kBAAkB;IAQ7B;;OAEG;IACH,YACU,SAAiB,EACjB,GAAmB;QADnB,cAAS,GAAT,SAAS,CAAQ;QACjB,QAAG,GAAH,GAAG,CAAgB;QAE3B,IAAI,CAAC,UAAU,GAAG,UAAU,EAAE,CAAC;IACjC,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,KAAK;QACT,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CACb,6GAA6G,CAC9G,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE;YACtB,cAAc,EAAE,mBAAmB;YACnC,eAAe,EAAE,UAAU;YAC3B,UAAU,EAAE,YAAY;SACzB,CAAC,CAAC;QAEH,0BAA0B;QAC1B,IAAI,CAAC,GAAG,CAAC,KAAK,CACZ,0BAA0B,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,cAAc,IAAI,CAAC,UAAU,MAAM,CACvF,CAAC;QAEF,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC;QAC7B,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;;YACxB,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC;YAC9B,MAAA,IAAI,CAAC,OAAO,oDAAI,CAAC;QACnB,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;OA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AAG,CAAC,CAAC,GAAG,CAAC,oBAAoB,IAAI,EAAE,CAAC,CAAC;YACnD,OAAO;QACT,CAAC;QAED,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACrC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,aAAa,CAAC,OAAgB;;QAClC,IAAI,aAA6B,CAAC;QAClC,IAAI,CAAC;YACH,aAAa,GAAG,oBAAoB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACtD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAA,IAAI,CAAC,OAAO,qDAAG,KAAc,CAAC,CAAC;YAC/B,MAAM,KAAK,CAAC;QACd,CAAC;QAED,MAAA,IAAI,CAAC,SAAS,qDAAG,aAAa,CAAC,CAAC;IAClC,CAAC;IAED,KAAK,CAAC,KAAK;;QACT,MAAA,IAAI,CAAC,YAAY,0CAAE,GAAG,EAAE,CAAC;QACzB,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC;QAC9B,MAAA,IAAI,CAAC,OAAO,oDAAI,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,OAAuB;QAChC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YACvB,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;QACnC,CAAC;QAED,IAAI,CAAC,YAAY,CAAC,KAAK,CACrB,yBAAyB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CACvD,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;CACF"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/server/stdio.d.ts b/front_end/third_party/mcp-sdk/package/dist/server/stdio.d.ts new file mode 100644 index 0000000000..92ab191948 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/server/stdio.d.ts @@ -0,0 +1,28 @@ +import { Readable, Writable } from "node:stream"; +import { JSONRPCMessage } from "../types.js"; +import { Transport } from "../shared/transport.js"; +/** + * Server transport for stdio: this communicates with a MCP client by reading from the current process' stdin and writing to stdout. + * + * This transport is only available in Node.js environments. + */ +export declare class StdioServerTransport implements Transport { + private _stdin; + private _stdout; + private _readBuffer; + private _started; + constructor(_stdin?: Readable, _stdout?: Writable); + onclose?: () => void; + onerror?: (error: Error) => void; + onmessage?: (message: JSONRPCMessage) => void; + _ondata: (chunk: Buffer) => void; + _onerror: (error: Error) => void; + /** + * Starts listening for messages on stdin. + */ + start(): Promise; + private processReadBuffer; + close(): Promise; + send(message: JSONRPCMessage): Promise; +} +//# sourceMappingURL=stdio.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/server/stdio.d.ts.map b/front_end/third_party/mcp-sdk/package/dist/server/stdio.d.ts.map new file mode 100644 index 0000000000..674ba6adc8 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/server/stdio.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"stdio.d.ts","sourceRoot":"","sources":["../../src/server/stdio.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD;;;;GAIG;AACH,qBAAa,oBAAqB,YAAW,SAAS;IAKlD,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,OAAO;IALjB,OAAO,CAAC,WAAW,CAAgC;IACnD,OAAO,CAAC,QAAQ,CAAS;gBAGf,MAAM,GAAE,QAAwB,EAChC,OAAO,GAAE,QAAyB;IAG5C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;IAG9C,OAAO,UAAW,MAAM,UAGtB;IACF,QAAQ,UAAW,KAAK,UAEtB;IAEF;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAY5B,OAAO,CAAC,iBAAiB;IAenB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAO5B,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAU7C"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/server/stdio.js b/front_end/third_party/mcp-sdk/package/dist/server/stdio.js new file mode 100644 index 0000000000..608e28b9be --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/server/stdio.js @@ -0,0 +1,69 @@ +import process from "node:process"; +import { ReadBuffer, serializeMessage } from "../shared/stdio.js"; +/** + * Server transport for stdio: this communicates with a MCP client by reading from the current process' stdin and writing to stdout. + * + * This transport is only available in Node.js environments. + */ +export class StdioServerTransport { + constructor(_stdin = process.stdin, _stdout = process.stdout) { + this._stdin = _stdin; + this._stdout = _stdout; + this._readBuffer = new ReadBuffer(); + this._started = false; + // Arrow functions to bind `this` properly, while maintaining function identity. + this._ondata = (chunk) => { + this._readBuffer.append(chunk); + this.processReadBuffer(); + }; + this._onerror = (error) => { + var _a; + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + }; + } + /** + * Starts listening for messages on stdin. + */ + async start() { + if (this._started) { + throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically."); + } + this._started = true; + this._stdin.on("data", this._ondata); + this._stdin.on("error", this._onerror); + } + processReadBuffer() { + var _a, _b; + while (true) { + try { + const message = this._readBuffer.readMessage(); + if (message === null) { + break; + } + (_a = this.onmessage) === null || _a === void 0 ? void 0 : _a.call(this, message); + } + catch (error) { + (_b = this.onerror) === null || _b === void 0 ? void 0 : _b.call(this, error); + } + } + } + async close() { + var _a; + this._stdin.off("data", this._ondata); + this._stdin.off("error", this._onerror); + this._readBuffer.clear(); + (_a = this.onclose) === null || _a === void 0 ? void 0 : _a.call(this); + } + send(message) { + return new Promise((resolve) => { + const json = serializeMessage(message); + if (this._stdout.write(json)) { + resolve(); + } + else { + this._stdout.once("drain", resolve); + } + }); + } +} +//# sourceMappingURL=stdio.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/server/stdio.js.map b/front_end/third_party/mcp-sdk/package/dist/server/stdio.js.map new file mode 100644 index 0000000000..8851537d00 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/server/stdio.js.map @@ -0,0 +1 @@ +{"version":3,"file":"stdio.js","sourceRoot":"","sources":["../../src/server/stdio.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,cAAc,CAAC;AAEnC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAIlE;;;;GAIG;AACH,MAAM,OAAO,oBAAoB;IAI/B,YACU,SAAmB,OAAO,CAAC,KAAK,EAChC,UAAoB,OAAO,CAAC,MAAM;QADlC,WAAM,GAAN,MAAM,CAA0B;QAChC,YAAO,GAAP,OAAO,CAA2B;QALpC,gBAAW,GAAe,IAAI,UAAU,EAAE,CAAC;QAC3C,aAAQ,GAAG,KAAK,CAAC;QAWzB,gFAAgF;QAChF,YAAO,GAAG,CAAC,KAAa,EAAE,EAAE;YAC1B,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC/B,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAC3B,CAAC,CAAC;QACF,aAAQ,GAAG,CAAC,KAAY,EAAE,EAAE;;YAC1B,MAAA,IAAI,CAAC,OAAO,qDAAG,KAAK,CAAC,CAAC;QACxB,CAAC,CAAC;IAbC,CAAC;IAeJ;;OAEG;IACH,KAAK,CAAC,KAAK;QACT,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,MAAM,IAAI,KAAK,CACb,+GAA+G,CAChH,CAAC;QAC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OAAO,CAAC,CAAC;YACtC,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/server/stdio.test.d.ts b/front_end/third_party/mcp-sdk/package/dist/server/stdio.test.d.ts new file mode 100644 index 0000000000..08756f1fed --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/server/stdio.test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=stdio.test.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/server/stdio.test.d.ts.map b/front_end/third_party/mcp-sdk/package/dist/server/stdio.test.d.ts.map new file mode 100644 index 0000000000..00b43946b0 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/server/stdio.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"stdio.test.d.ts","sourceRoot":"","sources":["../../src/server/stdio.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/server/stdio.test.js b/front_end/third_party/mcp-sdk/package/dist/server/stdio.test.js new file mode 100644 index 0000000000..a7183a4b21 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/server/stdio.test.js @@ -0,0 +1,87 @@ +import { Readable, Writable } from "node:stream"; +import { ReadBuffer, serializeMessage } from "../shared/stdio.js"; +import { StdioServerTransport } from "./stdio.js"; +let input; +let outputBuffer; +let output; +beforeEach(() => { + input = new Readable({ + // We'll use input.push() instead. + read: () => { }, + }); + outputBuffer = new ReadBuffer(); + output = new Writable({ + write(chunk, encoding, callback) { + outputBuffer.append(chunk); + callback(); + }, + }); +}); +test("should start then close cleanly", async () => { + const server = new StdioServerTransport(input, output); + server.onerror = (error) => { + throw error; + }; + let didClose = false; + server.onclose = () => { + didClose = true; + }; + await server.start(); + expect(didClose).toBeFalsy(); + await server.close(); + expect(didClose).toBeTruthy(); +}); +test("should not read until started", async () => { + const server = new StdioServerTransport(input, output); + server.onerror = (error) => { + throw error; + }; + let didRead = false; + const readMessage = new Promise((resolve) => { + server.onmessage = (message) => { + didRead = true; + resolve(message); + }; + }); + const message = { + jsonrpc: "2.0", + id: 1, + method: "ping", + }; + input.push(serializeMessage(message)); + expect(didRead).toBeFalsy(); + await server.start(); + expect(await readMessage).toEqual(message); +}); +test("should read multiple messages", async () => { + const server = new StdioServerTransport(input, output); + server.onerror = (error) => { + throw error; + }; + const messages = [ + { + jsonrpc: "2.0", + id: 1, + method: "ping", + }, + { + jsonrpc: "2.0", + method: "notifications/initialized", + }, + ]; + const readMessages = []; + const finished = new Promise((resolve) => { + server.onmessage = (message) => { + readMessages.push(message); + if (JSON.stringify(message) === JSON.stringify(messages[1])) { + resolve(); + } + }; + }); + input.push(serializeMessage(messages[0])); + input.push(serializeMessage(messages[1])); + await server.start(); + await finished; + expect(readMessages).toEqual(messages); +}); +//# sourceMappingURL=stdio.test.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/server/stdio.test.js.map b/front_end/third_party/mcp-sdk/package/dist/server/stdio.test.js.map new file mode 100644 index 0000000000..db814ecc88 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/server/stdio.test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"stdio.test.js","sourceRoot":"","sources":["../../src/server/stdio.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAElE,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAElD,IAAI,KAAe,CAAC;AACpB,IAAI,YAAwB,CAAC;AAC7B,IAAI,MAAgB,CAAC;AAErB,UAAU,CAAC,GAAG,EAAE;IACd,KAAK,GAAG,IAAI,QAAQ,CAAC;QACnB,kCAAkC;QAClC,IAAI,EAAE,GAAG,EAAE,GAAE,CAAC;KACf,CAAC,CAAC;IAEH,YAAY,GAAG,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AAC,CAAC;IAEH,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1C,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAE1C,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;IACrB,MAAM,QAAQ,CAAC;IACf,MAAM,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AACzC,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/shared/protocol.d.ts b/front_end/third_party/mcp-sdk/package/dist/shared/protocol.d.ts new file mode 100644 index 0000000000..247c382c7b --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/shared/protocol.d.ts @@ -0,0 +1,157 @@ +import { ZodLiteral, ZodObject, ZodType, z } from "../../../zod/index.js"; +import { Notification, Progress, Request, Result } from "../types.js"; +import { Transport } from "./transport.js"; +/** + * Callback for progress notifications. + */ +export type ProgressCallback = (progress: Progress) => void; +/** + * Additional initialization options. + */ +export type ProtocolOptions = { + /** + * Whether to restrict emitted requests to only those that the remote side has indicated that they can handle, through their advertised capabilities. + * + * Note that this DOES NOT affect checking of _local_ side capabilities, as it is considered a logic error to mis-specify those. + * + * Currently this defaults to false, for backwards compatibility with SDK versions that did not advertise capabilities correctly. In future, this will default to true. + */ + enforceStrictCapabilities?: boolean; +}; +/** + * The default request timeout, in miliseconds. + */ +export declare const DEFAULT_REQUEST_TIMEOUT_MSEC = 60000; +/** + * Options that can be given per request. + */ +export type RequestOptions = { + /** + * If set, requests progress notifications from the remote end (if supported). When progress notifications are received, this callback will be invoked. + */ + onprogress?: ProgressCallback; + /** + * Can be used to cancel an in-flight request. This will cause an AbortError to be raised from request(). + */ + signal?: AbortSignal; + /** + * A timeout (in milliseconds) for this request. If exceeded, an McpError with code `RequestTimeout` will be raised from request(). + * + * If not specified, `DEFAULT_REQUEST_TIMEOUT_MSEC` will be used as the timeout. + */ + timeout?: number; +}; +/** + * Extra data given to request handlers. + */ +export type RequestHandlerExtra = { + /** + * An abort signal used to communicate if the request was cancelled from the sender's side. + */ + signal: AbortSignal; +}; +/** + * Implements MCP protocol framing on top of a pluggable transport, including + * features like request/response linking, notifications, and progress. + */ +export declare abstract class Protocol { + private _options?; + private _transport?; + private _requestMessageId; + private _requestHandlers; + private _requestHandlerAbortControllers; + private _notificationHandlers; + private _responseHandlers; + private _progressHandlers; + /** + * Callback for when the connection is closed for any reason. + * + * This is invoked when close() is called as well. + */ + onclose?: () => void; + /** + * Callback for when an error occurs. + * + * Note that errors are not necessarily fatal; they are used for reporting any kind of exceptional condition out of band. + */ + onerror?: (error: Error) => void; + /** + * A handler to invoke for any request types that do not have their own handler installed. + */ + fallbackRequestHandler?: (request: Request) => Promise; + /** + * A handler to invoke for any notification types that do not have their own handler installed. + */ + fallbackNotificationHandler?: (notification: Notification) => Promise; + constructor(_options?: ProtocolOptions | undefined); + /** + * Attaches to the given transport, starts it, and starts listening for messages. + * + * The Protocol object assumes ownership of the Transport, replacing any callbacks that have already been set, and expects that it is the only user of the Transport instance going forward. + */ + connect(transport: Transport): Promise; + private _onclose; + private _onerror; + private _onnotification; + private _onrequest; + private _onprogress; + private _onresponse; + get transport(): Transport | undefined; + /** + * Closes the connection. + */ + close(): Promise; + /** + * A method to check if a capability is supported by the remote side, for the given method to be called. + * + * This should be implemented by subclasses. + */ + protected abstract assertCapabilityForMethod(method: SendRequestT["method"]): void; + /** + * A method to check if a notification is supported by the local side, for the given method to be sent. + * + * This should be implemented by subclasses. + */ + protected abstract assertNotificationCapability(method: SendNotificationT["method"]): void; + /** + * A method to check if a request handler is supported by the local side, for the given method to be handled. + * + * This should be implemented by subclasses. + */ + protected abstract assertRequestHandlerCapability(method: string): void; + /** + * Sends a request and wait for a response. + * + * Do not use this method to emit notifications! Use notification() instead. + */ + request>(request: SendRequestT, resultSchema: T, options?: RequestOptions): Promise>; + /** + * Emits a notification, which is a one-way message that does not expect a response. + */ + notification(notification: SendNotificationT): Promise; + /** + * Registers a handler to invoke when this protocol object receives a request with the given method. + * + * Note that this will replace any previous request handler for the same method. + */ + setRequestHandler; + }>>(requestSchema: T, handler: (request: z.infer, extra: RequestHandlerExtra) => SendResultT | Promise): void; + /** + * Removes the request handler for the given method. + */ + removeRequestHandler(method: string): void; + /** + * Registers a handler to invoke when this protocol object receives a notification with the given method. + * + * Note that this will replace any previous notification handler for the same method. + */ + setNotificationHandler; + }>>(notificationSchema: T, handler: (notification: z.infer) => void | Promise): void; + /** + * Removes the notification handler for the given method. + */ + removeNotificationHandler(method: string): void; +} +//# sourceMappingURL=protocol.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/shared/protocol.d.ts.map b/front_end/third_party/mcp-sdk/package/dist/shared/protocol.d.ts.map new file mode 100644 index 0000000000..09790f204d --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/shared/protocol.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/shared/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxD,OAAO,EAQL,YAAY,EAEZ,QAAQ,EAGR,OAAO,EAEP,MAAM,EACP,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;AAE5D;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;;;OAMG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,4BAA4B,QAAQ,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,cAAc,GAA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AE,CAAC,EACrB,OAAO,EAAE,CAAC,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAC1D,IAAI;IAQP;;OAEG;IACH,yBAAyB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;CAGhD"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/shared/protocol.js b/front_end/third_party/mcp-sdk/package/dist/shared/protocol.js new file mode 100644 index 0000000000..1621792ea6 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/shared/protocol.js @@ -0,0 +1,297 @@ +import { CancelledNotificationSchema, ErrorCode, McpError, PingRequestSchema, ProgressNotificationSchema, } from "../types.js"; +/** + * The default request timeout, in miliseconds. + */ +export const DEFAULT_REQUEST_TIMEOUT_MSEC = 60000; +/** + * Implements MCP protocol framing on top of a pluggable transport, including + * features like request/response linking, notifications, and progress. + */ +export class Protocol { + constructor(_options) { + this._options = _options; + this._requestMessageId = 0; + this._requestHandlers = new Map(); + this._requestHandlerAbortControllers = new Map(); + this._notificationHandlers = new Map(); + this._responseHandlers = new Map(); + this._progressHandlers = new Map(); + this.setNotificationHandler(CancelledNotificationSchema, (notification) => { + const controller = this._requestHandlerAbortControllers.get(notification.params.requestId); + controller === null || controller === void 0 ? void 0 : controller.abort(notification.params.reason); + }); + this.setNotificationHandler(ProgressNotificationSchema, (notification) => { + this._onprogress(notification); + }); + this.setRequestHandler(PingRequestSchema, + // Automatic pong by default. + (_request) => ({})); + } + /** + * Attaches to the given transport, starts it, and starts listening for messages. + * + * The Protocol object assumes ownership of the Transport, replacing any callbacks that have already been set, and expects that it is the only user of the Transport instance going forward. + */ + async connect(transport) { + this._transport = transport; + this._transport.onclose = () => { + this._onclose(); + }; + this._transport.onerror = (error) => { + this._onerror(error); + }; + this._transport.onmessage = (message) => { + if (!("method" in message)) { + this._onresponse(message); + } + else if ("id" in message) { + this._onrequest(message); + } + else { + this._onnotification(message); + } + }; + await this._transport.start(); + } + _onclose() { + var _a; + const responseHandlers = this._responseHandlers; + this._responseHandlers = new Map(); + this._progressHandlers.clear(); + this._transport = undefined; + (_a = this.onclose) === null || _a === void 0 ? void 0 : _a.call(this); + const error = new McpError(ErrorCode.ConnectionClosed, "Connection closed"); + for (const handler of responseHandlers.values()) { + handler(error); + } + } + _onerror(error) { + var _a; + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + } + _onnotification(notification) { + var _a; + const handler = (_a = this._notificationHandlers.get(notification.method)) !== null && _a !== void 0 ? _a : this.fallbackNotificationHandler; + // Ignore notifications not being subscribed to. + if (handler === undefined) { + return; + } + // Starting with Promise.resolve() puts any synchronous errors into the monad as well. + Promise.resolve() + .then(() => handler(notification)) + .catch((error) => this._onerror(new Error(`Uncaught error in notification handler: ${error}`))); + } + _onrequest(request) { + var _a, _b; + const handler = (_a = this._requestHandlers.get(request.method)) !== null && _a !== void 0 ? _a : this.fallbackRequestHandler; + if (handler === undefined) { + (_b = this._transport) === null || _b === void 0 ? void 0 : _b.send({ + jsonrpc: "2.0", + id: request.id, + error: { + code: ErrorCode.MethodNotFound, + message: "Method not found", + }, + }).catch((error) => this._onerror(new Error(`Failed to send an error response: ${error}`))); + return; + } + const abortController = new AbortController(); + this._requestHandlerAbortControllers.set(request.id, abortController); + // Starting with Promise.resolve() puts any synchronous errors into the monad as well. + Promise.resolve() + .then(() => handler(request, { signal: abortController.signal })) + .then((result) => { + var _a; + if (abortController.signal.aborted) { + return; + } + return (_a = this._transport) === null || _a === void 0 ? void 0 : _a.send({ + result, + jsonrpc: "2.0", + id: request.id, + }); + }, (error) => { + var _a, _b; + if (abortController.signal.aborted) { + return; + } + return (_a = this._transport) === null || _a === void 0 ? void 0 : _a.send({ + jsonrpc: "2.0", + id: request.id, + error: { + code: Number.isSafeInteger(error["code"]) + ? error["code"] + : ErrorCode.InternalError, + message: (_b = error.message) !== null && _b !== void 0 ? _b : "Internal error", + }, + }); + }) + .catch((error) => this._onerror(new Error(`Failed to send response: ${error}`))) + .finally(() => { + this._requestHandlerAbortControllers.delete(request.id); + }); + } + _onprogress(notification) { + const { progressToken, ...params } = notification.params; + const handler = this._progressHandlers.get(Number(progressToken)); + if (handler === undefined) { + this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(notification)}`)); + return; + } + handler(params); + } + _onresponse(response) { + const messageId = response.id; + const handler = this._responseHandlers.get(Number(messageId)); + if (handler === undefined) { + this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(response)}`)); + return; + } + this._responseHandlers.delete(Number(messageId)); + this._progressHandlers.delete(Number(messageId)); + if ("result" in response) { + handler(response); + } + else { + const error = new McpError(response.error.code, response.error.message, response.error.data); + handler(error); + } + } + get transport() { + return this._transport; + } + /** + * Closes the connection. + */ + async close() { + var _a; + await ((_a = this._transport) === null || _a === void 0 ? void 0 : _a.close()); + } + /** + * Sends a request and wait for a response. + * + * Do not use this method to emit notifications! Use notification() instead. + */ + request(request, resultSchema, options) { + return new Promise((resolve, reject) => { + var _a, _b, _c, _d; + if (!this._transport) { + reject(new Error("Not connected")); + return; + } + if (((_a = this._options) === null || _a === void 0 ? void 0 : _a.enforceStrictCapabilities) === true) { + this.assertCapabilityForMethod(request.method); + } + (_b = options === null || options === void 0 ? void 0 : options.signal) === null || _b === void 0 ? void 0 : _b.throwIfAborted(); + const messageId = this._requestMessageId++; + const jsonrpcRequest = { + ...request, + jsonrpc: "2.0", + id: messageId, + }; + if (options === null || options === void 0 ? void 0 : options.onprogress) { + this._progressHandlers.set(messageId, options.onprogress); + jsonrpcRequest.params = { + ...request.params, + _meta: { progressToken: messageId }, + }; + } + let timeoutId = undefined; + this._responseHandlers.set(messageId, (response) => { + var _a; + if (timeoutId !== undefined) { + clearTimeout(timeoutId); + } + if ((_a = options === null || options === void 0 ? void 0 : options.signal) === null || _a === void 0 ? void 0 : _a.aborted) { + return; + } + if (response instanceof Error) { + return reject(response); + } + try { + const result = resultSchema.parse(response.result); + resolve(result); + } + catch (error) { + reject(error); + } + }); + const cancel = (reason) => { + var _a; + this._responseHandlers.delete(messageId); + this._progressHandlers.delete(messageId); + (_a = this._transport) === null || _a === void 0 ? void 0 : _a.send({ + jsonrpc: "2.0", + method: "notifications/cancelled", + params: { + requestId: messageId, + reason: String(reason), + }, + }).catch((error) => this._onerror(new Error(`Failed to send cancellation: ${error}`))); + reject(reason); + }; + (_c = options === null || options === void 0 ? void 0 : options.signal) === null || _c === void 0 ? void 0 : _c.addEventListener("abort", () => { + var _a; + if (timeoutId !== undefined) { + clearTimeout(timeoutId); + } + cancel((_a = options === null || options === void 0 ? void 0 : options.signal) === null || _a === void 0 ? void 0 : _a.reason); + }); + const timeout = (_d = options === null || options === void 0 ? void 0 : options.timeout) !== null && _d !== void 0 ? _d : DEFAULT_REQUEST_TIMEOUT_MSEC; + timeoutId = setTimeout(() => cancel(new McpError(ErrorCode.RequestTimeout, "Request timed out", { + timeout, + })), timeout); + this._transport.send(jsonrpcRequest).catch((error) => { + if (timeoutId !== undefined) { + clearTimeout(timeoutId); + } + reject(error); + }); + }); + } + /** + * Emits a notification, which is a one-way message that does not expect a response. + */ + async notification(notification) { + if (!this._transport) { + throw new Error("Not connected"); + } + this.assertNotificationCapability(notification.method); + const jsonrpcNotification = { + ...notification, + jsonrpc: "2.0", + }; + await this._transport.send(jsonrpcNotification); + } + /** + * Registers a handler to invoke when this protocol object receives a request with the given method. + * + * Note that this will replace any previous request handler for the same method. + */ + setRequestHandler(requestSchema, handler) { + const method = requestSchema.shape.method.value; + this.assertRequestHandlerCapability(method); + this._requestHandlers.set(method, (request, extra) => Promise.resolve(handler(requestSchema.parse(request), extra))); + } + /** + * Removes the request handler for the given method. + */ + removeRequestHandler(method) { + this._requestHandlers.delete(method); + } + /** + * Registers a handler to invoke when this protocol object receives a notification with the given method. + * + * Note that this will replace any previous notification handler for the same method. + */ + setNotificationHandler(notificationSchema, handler) { + this._notificationHandlers.set(notificationSchema.shape.method.value, (notification) => Promise.resolve(handler(notificationSchema.parse(notification)))); + } + /** + * Removes the notification handler for the given method. + */ + removeNotificationHandler(method) { + this._notificationHandlers.delete(method); + } +} +//# sourceMappingURL=protocol.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/shared/protocol.js.map b/front_end/third_party/mcp-sdk/package/dist/shared/protocol.js.map new file mode 100644 index 0000000000..ae2eaa1589 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/shared/protocol.js.map @@ -0,0 +1 @@ +{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/shared/protocol.ts"],"names":[],"mappings":"AACA,OAAO,EACL,2BAA2B,EAC3B,SAAS,EAKT,QAAQ,EAER,iBAAiB,EAGjB,0BAA0B,GAI3B,MAAM,aAAa,CAAC;AAsBrB;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,KAAK,CAAC;AAkClD;;;GAGG;AACH,MAAM,OAAgB,QAAQ;IAkD5B,YAAoB,QAA0B;QAA1B,aAAQ,GAAR,QAAQ,CAAkB;QA5CtC,sBAAiB,GAAG,CAAC,CAAC;QACtB,qBAAgB,GAMpB,IAAI,GAAG,EAAE,CAAC;QACN,oCAA+B,GACrC,IAAI,GAAG,EAAE,CAAC;QACJ,0BAAqB,GAGzB,IAAI,GAAG,EAAE,CAAC;QACN,sBAAiB,GAGrB,IAAI,GAAG,EAAE,CAAC;QACN,sBAAiB,GAAkC,IAAI,GAAG,EAAE,CAAC;QA2BnE,IAAI,CAAC,sBAAsB,CAAC,2BAA2B,EAAE,CAAC,YAAY,EAAE,EAAE;YACxE,MAAM,UAAU,GAAG,IAAI,CAAC,+BAA+B,CAAC,GAAG,CACzD,YAAY,CAAC,MAAM,CAAC,SAAS,CAC9B,CAAC;YACF,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,sBAAsB,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/mcp-sdk/package/dist/shared/stdio.d.ts b/front_end/third_party/mcp-sdk/package/dist/shared/stdio.d.ts new file mode 100644 index 0000000000..c997594734 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/shared/stdio.d.ts @@ -0,0 +1,13 @@ +import { JSONRPCMessage } from "../types.js"; +/** + * Buffers a continuous stdio stream into discrete JSON-RPC messages. + */ +export declare class ReadBuffer { + private _buffer?; + append(chunk: Buffer): void; + readMessage(): JSONRPCMessage | null; + clear(): void; +} +export declare function deserializeMessage(line: string): JSONRPCMessage; +export declare function serializeMessage(message: JSONRPCMessage): string; +//# sourceMappingURL=stdio.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/shared/stdio.d.ts.map b/front_end/third_party/mcp-sdk/package/dist/shared/stdio.d.ts.map new file mode 100644 index 0000000000..c7da7764b7 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/shared/stdio.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"stdio.d.ts","sourceRoot":"","sources":["../../src/shared/stdio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,aAAa,CAAC;AAEnE;;GAEG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,OAAO,CAAC,CAAS;IAEzB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAI3B,WAAW,IAAI,cAAc,GAAG,IAAI;IAepC,KAAK,IAAI,IAAI;CAGd;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAE/D;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,CAEhE"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/shared/stdio.js b/front_end/third_party/mcp-sdk/package/dist/shared/stdio.js new file mode 100644 index 0000000000..d0dde05886 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/shared/stdio.js @@ -0,0 +1,31 @@ +import { JSONRPCMessageSchema } from "../types.js"; +/** + * Buffers a continuous stdio stream into discrete JSON-RPC messages. + */ +export class ReadBuffer { + append(chunk) { + this._buffer = this._buffer ? Buffer.concat([this._buffer, chunk]) : chunk; + } + readMessage() { + if (!this._buffer) { + return null; + } + const index = this._buffer.indexOf("\n"); + if (index === -1) { + return null; + } + const line = this._buffer.toString("utf8", 0, index); + this._buffer = this._buffer.subarray(index + 1); + return deserializeMessage(line); + } + clear() { + this._buffer = undefined; + } +} +export function deserializeMessage(line) { + return JSONRPCMessageSchema.parse(JSON.parse(line)); +} +export function serializeMessage(message) { + return JSON.stringify(message) + "\n"; +} +//# sourceMappingURL=stdio.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/shared/stdio.js.map b/front_end/third_party/mcp-sdk/package/dist/shared/stdio.js.map new file mode 100644 index 0000000000..77ca55aa54 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/shared/stdio.js.map @@ -0,0 +1 @@ +{"version":3,"file":"stdio.js","sourceRoot":"","sources":["../../src/shared/stdio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnE;;GAEG;AACH,MAAM,OAAO,UAAU;IAGrB,MAAM,CAAC,KAAa;QAClB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAC7E,CAAC;IAED,WAAW;QACT,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YAClB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;YACjB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;QACrD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QAChD,OAAO,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;IAED,KAAK;QACH,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC;IAC3B,CAAC;CACF;AAED,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,OAAO,oBAAoB,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;AACtD,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,OAAuB;IACtD,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;AACxC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/shared/stdio.test.d.ts b/front_end/third_party/mcp-sdk/package/dist/shared/stdio.test.d.ts new file mode 100644 index 0000000000..08756f1fed --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/shared/stdio.test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=stdio.test.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/shared/stdio.test.d.ts.map b/front_end/third_party/mcp-sdk/package/dist/shared/stdio.test.d.ts.map new file mode 100644 index 0000000000..74d313b133 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/shared/stdio.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"stdio.test.d.ts","sourceRoot":"","sources":["../../src/shared/stdio.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/shared/stdio.test.js b/front_end/third_party/mcp-sdk/package/dist/shared/stdio.test.js new file mode 100644 index 0000000000..35b669b48e --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/shared/stdio.test.js @@ -0,0 +1,27 @@ +import { ReadBuffer } from "./stdio.js"; +const testMessage = { + jsonrpc: "2.0", + method: "foobar", +}; +test("should have no messages after initialization", () => { + const readBuffer = new ReadBuffer(); + expect(readBuffer.readMessage()).toBeNull(); +}); +test("should only yield a message after a newline", () => { + const readBuffer = new ReadBuffer(); + readBuffer.append(Buffer.from(JSON.stringify(testMessage))); + expect(readBuffer.readMessage()).toBeNull(); + readBuffer.append(Buffer.from("\n")); + expect(readBuffer.readMessage()).toEqual(testMessage); + expect(readBuffer.readMessage()).toBeNull(); +}); +test("should be reusable after clearing", () => { + const readBuffer = new ReadBuffer(); + readBuffer.append(Buffer.from("foobar")); + readBuffer.clear(); + expect(readBuffer.readMessage()).toBeNull(); + readBuffer.append(Buffer.from(JSON.stringify(testMessage))); + readBuffer.append(Buffer.from("\n")); + expect(readBuffer.readMessage()).toEqual(testMessage); +}); +//# sourceMappingURL=stdio.test.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/shared/stdio.test.js.map b/front_end/third_party/mcp-sdk/package/dist/shared/stdio.test.js.map new file mode 100644 index 0000000000..283f9943a5 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/shared/stdio.test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"stdio.test.js","sourceRoot":"","sources":["../../src/shared/stdio.test.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,WAAW,GAAmB;IAClC,OAAO,EAAE,KAAK;IACd,MAAM,EAAE,QAAQ;CACjB,CAAC;AAEF,IAAI,CAAC,8CAA8C,EAAE,GAAG,EAAE;IACxD,MAAM,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC;IACpC,MAAM,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;AAC9C,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,6CAA6C,EAAE,GAAG,EAAE;IACvD,MAAM,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC;IAEpC,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAC5D,MAAM,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;IAE5C,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACrC,MAAM,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IACtD,MAAM,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;AAC9C,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,mCAAmC,EAAE,GAAG,EAAE;IAC7C,MAAM,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC;IAEpC,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;IACzC,UAAU,CAAC,KAAK,EAAE,CAAC;IACnB,MAAM,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;IAE5C,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAC5D,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACrC,MAAM,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;AACxD,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/shared/transport.d.ts b/front_end/third_party/mcp-sdk/package/dist/shared/transport.d.ts new file mode 100644 index 0000000000..faae12820b --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/shared/transport.d.ts @@ -0,0 +1,39 @@ +import { JSONRPCMessage } from "../types.js"; +/** + * Describes the minimal contract for a MCP transport that a client or server can communicate over. + */ +export interface Transport { + /** + * Starts processing messages on the transport, including any connection steps that might need to be taken. + * + * This method should only be called after callbacks are installed, or else messages may be lost. + * + * NOTE: This method should not be called explicitly when using Client, Server, or Protocol classes, as they will implicitly call start(). + */ + start(): Promise; + /** + * Sends a JSON-RPC message (request or response). + */ + send(message: JSONRPCMessage): Promise; + /** + * Closes the connection. + */ + close(): Promise; + /** + * Callback for when the connection is closed for any reason. + * + * This should be invoked when close() is called as well. + */ + onclose?: () => void; + /** + * Callback for when an error occurs. + * + * Note that errors are not necessarily fatal; they are used for reporting any kind of exceptional condition out of band. + */ + onerror?: (error: Error) => void; + /** + * Callback for when a message (request or response) is received over the connection. + */ + onmessage?: (message: JSONRPCMessage) => void; +} +//# sourceMappingURL=transport.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/shared/transport.d.ts.map b/front_end/third_party/mcp-sdk/package/dist/shared/transport.d.ts.map new file mode 100644 index 0000000000..8db9ddf6d1 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/shared/transport.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/shared/transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;;;;;OAMG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB;;OAEG;IACH,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7C;;OAEG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAEjC;;OAEG;IACH,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;CAC/C"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/shared/transport.js b/front_end/third_party/mcp-sdk/package/dist/shared/transport.js new file mode 100644 index 0000000000..00d3520ba0 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/shared/transport.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=transport.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/shared/transport.js.map b/front_end/third_party/mcp-sdk/package/dist/shared/transport.js.map new file mode 100644 index 0000000000..75cff09644 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/shared/transport.js.map @@ -0,0 +1 @@ +{"version":3,"file":"transport.js","sourceRoot":"","sources":["../../src/shared/transport.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/types.d.ts b/front_end/third_party/mcp-sdk/package/dist/types.d.ts new file mode 100644 index 0000000000..395fcba4ce --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/types.d.ts @@ -0,0 +1,26425 @@ +import { z } from "zod"; +export declare const LATEST_PROTOCOL_VERSION = "2024-11-05"; +export declare const SUPPORTED_PROTOCOL_VERSIONS: string[]; +export declare const JSONRPC_VERSION = "2.0"; +/** + * A progress token, used to associate progress notifications with the original request. + */ +export declare const ProgressTokenSchema: z.ZodUnion<[z.ZodString, z.ZodNumber]>; +/** + * An opaque token used to represent a cursor for pagination. + */ +export declare const CursorSchema: z.ZodString; +export declare const RequestSchema: z.ZodObject<{ + method: z.ZodString; + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, "strip", z.ZodTypeAny, { + method: string; + params?: z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: string; + params?: z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +export declare const NotificationSchema: z.ZodObject<{ + method: z.ZodString; + params: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, "strip", z.ZodTypeAny, { + method: string; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: string; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +export declare const ResultSchema: z.ZodObject<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, z.ZodTypeAny, "passthrough">>; +/** + * A uniquely identifying ID for a request in JSON-RPC. + */ +export declare const RequestIdSchema: z.ZodUnion<[z.ZodString, z.ZodNumber]>; +/** + * A request that expects a response. + */ +export declare const JSONRPCRequestSchema: z.ZodObject; + id: z.ZodUnion<[z.ZodString, z.ZodNumber]>; +}, { + method: z.ZodString; + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}>, "strict", z.ZodTypeAny, { + method: string; + jsonrpc: "2.0"; + id: string | number; + params?: z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: string; + jsonrpc: "2.0"; + id: string | number; + params?: z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * A notification which does not expect a response. + */ +export declare const JSONRPCNotificationSchema: z.ZodObject; +}, { + method: z.ZodString; + params: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}>, "strict", z.ZodTypeAny, { + method: string; + jsonrpc: "2.0"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: string; + jsonrpc: "2.0"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * A successful (non-error) response to a request. + */ +export declare const JSONRPCResponseSchema: z.ZodObject<{ + jsonrpc: z.ZodLiteral<"2.0">; + id: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + result: z.ZodObject<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; +}, "strict", z.ZodTypeAny, { + jsonrpc: "2.0"; + id: string | number; + result: { + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; +}, { + jsonrpc: "2.0"; + id: string | number; + result: { + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; +}>; +/** + * An incomplete set of error codes that may appear in JSON-RPC responses. + */ +export declare enum ErrorCode { + ConnectionClosed = -1, + RequestTimeout = -2, + ParseError = -32700, + InvalidRequest = -32600, + MethodNotFound = -32601, + InvalidParams = -32602, + InternalError = -32603 +} +/** + * A response to a request that indicates an error occurred. + */ +export declare const JSONRPCErrorSchema: z.ZodObject<{ + jsonrpc: z.ZodLiteral<"2.0">; + id: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + error: z.ZodObject<{ + /** + * The error type that occurred. + */ + code: z.ZodNumber; + /** + * A short description of the error. The message SHOULD be limited to a concise single sentence. + */ + message: z.ZodString; + /** + * Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.). + */ + data: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + code: number; + message: string; + data?: unknown; + }, { + code: number; + message: string; + data?: unknown; + }>; +}, "strict", z.ZodTypeAny, { + jsonrpc: "2.0"; + id: string | number; + error: { + code: number; + message: string; + data?: unknown; + }; +}, { + jsonrpc: "2.0"; + id: string | number; + error: { + code: number; + message: string; + data?: unknown; + }; +}>; +export declare const JSONRPCMessageSchema: z.ZodUnion<[z.ZodObject; + id: z.ZodUnion<[z.ZodString, z.ZodNumber]>; +}, { + method: z.ZodString; + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}>, "strict", z.ZodTypeAny, { + method: string; + jsonrpc: "2.0"; + id: string | number; + params?: z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: string; + jsonrpc: "2.0"; + id: string | number; + params?: z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject; +}, { + method: z.ZodString; + params: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}>, "strict", z.ZodTypeAny, { + method: string; + jsonrpc: "2.0"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: string; + jsonrpc: "2.0"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject<{ + jsonrpc: z.ZodLiteral<"2.0">; + id: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + result: z.ZodObject<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; +}, "strict", z.ZodTypeAny, { + jsonrpc: "2.0"; + id: string | number; + result: { + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; +}, { + jsonrpc: "2.0"; + id: string | number; + result: { + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; +}>, z.ZodObject<{ + jsonrpc: z.ZodLiteral<"2.0">; + id: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + error: z.ZodObject<{ + /** + * The error type that occurred. + */ + code: z.ZodNumber; + /** + * A short description of the error. The message SHOULD be limited to a concise single sentence. + */ + message: z.ZodString; + /** + * Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.). + */ + data: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + code: number; + message: string; + data?: unknown; + }, { + code: number; + message: string; + data?: unknown; + }>; +}, "strict", z.ZodTypeAny, { + jsonrpc: "2.0"; + id: string | number; + error: { + code: number; + message: string; + data?: unknown; + }; +}, { + jsonrpc: "2.0"; + id: string | number; + error: { + code: number; + message: string; + data?: unknown; + }; +}>]>; +/** + * A response that indicates success but carries no data. + */ +export declare const EmptyResultSchema: z.ZodObject<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, "strict", z.ZodTypeAny, { + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; +}, { + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * This notification can be sent by either side to indicate that it is cancelling a previously-issued request. + * + * The request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished. + * + * This notification indicates that the result will be unused, so any associated processing SHOULD cease. + * + * A client MUST NOT attempt to cancel its `initialize` request. + */ +export declare const CancelledNotificationSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/cancelled">; + params: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The ID of the request to cancel. + * + * This MUST correspond to the ID of a request previously issued in the same direction. + */ + requestId: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + /** + * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. + */ + reason: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The ID of the request to cancel. + * + * This MUST correspond to the ID of a request previously issued in the same direction. + */ + requestId: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + /** + * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. + */ + reason: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The ID of the request to cancel. + * + * This MUST correspond to the ID of a request previously issued in the same direction. + */ + requestId: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + /** + * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. + */ + reason: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + requestId: string | number; + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + reason?: string | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/cancelled"; +}, { + params: { + requestId: string | number; + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + reason?: string | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/cancelled"; +}>; +/** + * Describes the name and version of an MCP implementation. + */ +export declare const ImplementationSchema: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; +}, z.ZodTypeAny, "passthrough">>; +/** + * Capabilities a client may support. Known capabilities are defined here, in this schema, but this is not a closed set: any client can define its own, additional capabilities. + */ +export declare const ClientCapabilitiesSchema: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; +}, z.ZodTypeAny, "passthrough">>; +/** + * This request is sent from the client to the server when it first connects, asking it to begin initialization. + */ +export declare const InitializeRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"initialize">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + clientInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + clientInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + clientInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + protocolVersion: string; + capabilities: { + experimental?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + sampling?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + roots?: z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + clientInfo: { + name: string; + version: string; + } & { + [k: string]: unknown; + }; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "initialize"; +}, { + params: { + protocolVersion: string; + capabilities: { + experimental?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + sampling?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + roots?: z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + clientInfo: { + name: string; + version: string; + } & { + [k: string]: unknown; + }; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "initialize"; +}>; +/** + * Capabilities that a server may support. Known capabilities are defined here, in this schema, but this is not a closed set: any server can define its own, additional capabilities. + */ +export declare const ServerCapabilitiesSchema: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; +}, z.ZodTypeAny, "passthrough">>; +/** + * After receiving an initialize request from the client, the server sends this response. + */ +export declare const InitializeResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + serverInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + serverInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + serverInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; +}>, z.ZodTypeAny, "passthrough">>; +/** + * This notification is sent from the client to the server after initialization has finished. + */ +export declare const InitializedNotificationSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/initialized">; +}>, "strip", z.ZodTypeAny, { + method: "notifications/initialized"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "notifications/initialized"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * A ping, issued by either the server or the client, to check that the other party is still alive. The receiver must promptly respond, or else may be disconnected. + */ +export declare const PingRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"ping">; +}>, "strip", z.ZodTypeAny, { + method: "ping"; + params?: z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "ping"; + params?: z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +export declare const ProgressSchema: z.ZodObject<{ + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">>; +/** + * An out-of-band notification used to inform the receiver of a progress update for a long-running request. + */ +export declare const ProgressNotificationSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/progress">; + params: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + }>, { + /** + * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. + */ + progressToken: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + }>, { + /** + * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. + */ + progressToken: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + }>, { + /** + * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. + */ + progressToken: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + progressToken: string | number; + progress: number; + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + total?: number | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/progress"; +}, { + params: { + progressToken: string | number; + progress: number; + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + total?: number | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/progress"; +}>; +export declare const PaginatedRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>>; +}>, "strip", z.ZodTypeAny, { + method: string; + params?: z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: string; + params?: z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}>; +export declare const PaginatedResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, z.ZodTypeAny, "passthrough">>; +/** + * The contents of a specific resource or sub-resource. + */ +export declare const ResourceContentsSchema: z.ZodObject<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">>; +export declare const TextResourceContentsSchema: z.ZodObject; +}, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType; +}, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType; +}, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; +}>, z.ZodTypeAny, "passthrough">>; +export declare const BlobResourceContentsSchema: z.ZodObject; +}, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType; +}, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType; +}, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; +}>, z.ZodTypeAny, "passthrough">>; +/** + * A known resource that the server is capable of reading. + */ +export declare const ResourceSchema: z.ZodObject<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">>; +/** + * A template description for resources available on the server. + */ +export declare const ResourceTemplateSchema: z.ZodObject<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">>; +/** + * Sent from the client to request a list of resources the server has. + */ +export declare const ListResourcesRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>>; +}>, { + method: z.ZodLiteral<"resources/list">; +}>, "strip", z.ZodTypeAny, { + method: "resources/list"; + params?: z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "resources/list"; + params?: z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * The server's response to a resources/list request from the client. + */ +export declare const ListResourcesResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resources: z.ZodArray; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resources: z.ZodArray; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resources: z.ZodArray; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>; +/** + * Sent from the client to request a list of resource templates the server has. + */ +export declare const ListResourceTemplatesRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>>; +}>, { + method: z.ZodLiteral<"resources/templates/list">; +}>, "strip", z.ZodTypeAny, { + method: "resources/templates/list"; + params?: z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "resources/templates/list"; + params?: z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * The server's response to a resources/templates/list request from the client. + */ +export declare const ListResourceTemplatesResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resourceTemplates: z.ZodArray; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resourceTemplates: z.ZodArray; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resourceTemplates: z.ZodArray; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>; +/** + * Sent from the client to the server, to read a specific resource URI. + */ +export declare const ReadResourceRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"resources/read">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + uri: string; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/read"; +}, { + params: { + uri: string; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/read"; +}>; +/** + * The server's response to a resources/read request from the client. + */ +export declare const ReadResourceResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + contents: z.ZodArray; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + contents: z.ZodArray; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + contents: z.ZodArray; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>, "many">; +}>, z.ZodTypeAny, "passthrough">>; +/** + * An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This may be issued by servers without any previous subscription from the client. + */ +export declare const ResourceListChangedNotificationSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/resources/list_changed">; +}>, "strip", z.ZodTypeAny, { + method: "notifications/resources/list_changed"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "notifications/resources/list_changed"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * Sent from the client to request resources/updated notifications from the server whenever a particular resource changes. + */ +export declare const SubscribeRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"resources/subscribe">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + uri: string; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/subscribe"; +}, { + params: { + uri: string; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/subscribe"; +}>; +/** + * Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request. + */ +export declare const UnsubscribeRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"resources/unsubscribe">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to unsubscribe from. + */ + uri: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to unsubscribe from. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to unsubscribe from. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + uri: string; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/unsubscribe"; +}, { + params: { + uri: string; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/unsubscribe"; +}>; +/** + * A notification from the server to the client, informing it that a resource has changed and may need to be read again. This should only be sent if the client previously sent a resources/subscribe request. + */ +export declare const ResourceUpdatedNotificationSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/resources/updated">; + params: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to. + */ + uri: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + uri: string; + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/resources/updated"; +}, { + params: { + uri: string; + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/resources/updated"; +}>; +/** + * Describes an argument that a prompt can accept. + */ +export declare const PromptArgumentSchema: z.ZodObject<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">>; +/** + * A prompt or prompt template that the server offers. + */ +export declare const PromptSchema: z.ZodObject<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; +}, z.ZodTypeAny, "passthrough">>; +/** + * Sent from the client to request a list of prompts and prompt templates the server has. + */ +export declare const ListPromptsRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>>; +}>, { + method: z.ZodLiteral<"prompts/list">; +}>, "strip", z.ZodTypeAny, { + method: "prompts/list"; + params?: z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "prompts/list"; + params?: z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * The server's response to a prompts/list request from the client. + */ +export declare const ListPromptsResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + prompts: z.ZodArray; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + prompts: z.ZodArray; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + prompts: z.ZodArray; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>; +/** + * Used by the client to get a prompt provided by the server. + */ +export declare const GetPromptRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"prompts/get">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * Arguments to use for templating the prompt. + */ + arguments: z.ZodOptional>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * Arguments to use for templating the prompt. + */ + arguments: z.ZodOptional>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * Arguments to use for templating the prompt. + */ + arguments: z.ZodOptional>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + name: string; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + arguments?: Record | undefined; + } & { + [k: string]: unknown; + }; + method: "prompts/get"; +}, { + params: { + name: string; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + arguments?: Record | undefined; + } & { + [k: string]: unknown; + }; + method: "prompts/get"; +}>; +/** + * Text provided to or from an LLM. + */ +export declare const TextContentSchema: z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; +}, z.ZodTypeAny, "passthrough">>; +/** + * An image provided to or from an LLM. + */ +export declare const ImageContentSchema: z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; +}, z.ZodTypeAny, "passthrough">>; +/** + * The contents of a resource, embedded into a prompt or tool call result. + */ +export declare const EmbeddedResourceSchema: z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; +}, z.ZodTypeAny, "passthrough">>; +/** + * Describes a message returned as part of a prompt. + */ +export declare const PromptMessageSchema: z.ZodObject<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; +}, z.ZodTypeAny, "passthrough">>; +/** + * The server's response to a prompts/get request from the client. + */ +export declare const GetPromptResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An optional description for the prompt. + */ + description: z.ZodOptional; + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An optional description for the prompt. + */ + description: z.ZodOptional; + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An optional description for the prompt. + */ + description: z.ZodOptional; + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>; +/** + * An optional notification from the server to the client, informing it that the list of prompts it offers has changed. This may be issued by servers without any previous subscription from the client. + */ +export declare const PromptListChangedNotificationSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/prompts/list_changed">; +}>, "strip", z.ZodTypeAny, { + method: "notifications/prompts/list_changed"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "notifications/prompts/list_changed"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * Definition for a tool the client can call. + */ +export declare const ToolSchema: z.ZodObject<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; +}, z.ZodTypeAny, "passthrough">>; +/** + * Sent from the client to request a list of tools the server has. + */ +export declare const ListToolsRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>>; +}>, { + method: z.ZodLiteral<"tools/list">; +}>, "strip", z.ZodTypeAny, { + method: "tools/list"; + params?: z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "tools/list"; + params?: z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * The server's response to a tools/list request from the client. + */ +export declare const ListToolsResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + tools: z.ZodArray; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + tools: z.ZodArray; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + tools: z.ZodArray; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>; +/** + * The server's response to a tool call. + */ +export declare const CallToolResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + content: z.ZodArray; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>, "many">; + isError: z.ZodOptional>; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + content: z.ZodArray; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>, "many">; + isError: z.ZodOptional>; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + content: z.ZodArray; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>, "many">; + isError: z.ZodOptional>; +}>, z.ZodTypeAny, "passthrough">>; +/** + * CallToolResultSchema extended with backwards compatibility to protocol version 2024-10-07. + */ +export declare const CompatibilityCallToolResultSchema: z.ZodUnion<[z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + content: z.ZodArray; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>, "many">; + isError: z.ZodOptional>; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + content: z.ZodArray; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>, "many">; + isError: z.ZodOptional>; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + content: z.ZodArray; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>, "many">; + isError: z.ZodOptional>; +}>, z.ZodTypeAny, "passthrough">>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + toolResult: z.ZodUnknown; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + toolResult: z.ZodUnknown; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + toolResult: z.ZodUnknown; +}>, z.ZodTypeAny, "passthrough">>]>; +/** + * Used by the client to invoke a tool provided by the server. + */ +export declare const CallToolRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"tools/call">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + name: z.ZodString; + arguments: z.ZodOptional>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + name: z.ZodString; + arguments: z.ZodOptional>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + name: z.ZodString; + arguments: z.ZodOptional>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + name: string; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + arguments?: Record | undefined; + } & { + [k: string]: unknown; + }; + method: "tools/call"; +}, { + params: { + name: string; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + arguments?: Record | undefined; + } & { + [k: string]: unknown; + }; + method: "tools/call"; +}>; +/** + * An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client. + */ +export declare const ToolListChangedNotificationSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/tools/list_changed">; +}>, "strip", z.ZodTypeAny, { + method: "notifications/tools/list_changed"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "notifications/tools/list_changed"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * The severity of a log message. + */ +export declare const LoggingLevelSchema: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; +/** + * A request from the client to the server, to enable or adjust logging. + */ +export declare const SetLevelRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"logging/setLevel">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + level: "error" | "debug" | "info" | "notice" | "warning" | "critical" | "alert" | "emergency"; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "logging/setLevel"; +}, { + params: { + level: "error" | "debug" | "info" | "notice" | "warning" | "critical" | "alert" | "emergency"; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "logging/setLevel"; +}>; +/** + * Notification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically. + */ +export declare const LoggingMessageNotificationSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/message">; + params: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The severity of this log message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + /** + * An optional name of the logger issuing this message. + */ + logger: z.ZodOptional; + /** + * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here. + */ + data: z.ZodUnknown; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The severity of this log message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + /** + * An optional name of the logger issuing this message. + */ + logger: z.ZodOptional; + /** + * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here. + */ + data: z.ZodUnknown; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The severity of this log message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + /** + * An optional name of the logger issuing this message. + */ + logger: z.ZodOptional; + /** + * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here. + */ + data: z.ZodUnknown; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + level: "error" | "debug" | "info" | "notice" | "warning" | "critical" | "alert" | "emergency"; + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + data?: unknown; + logger?: string | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/message"; +}, { + params: { + level: "error" | "debug" | "info" | "notice" | "warning" | "critical" | "alert" | "emergency"; + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + data?: unknown; + logger?: string | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/message"; +}>; +/** + * Hints to use for model selection. + */ +export declare const ModelHintSchema: z.ZodObject<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">>; +/** + * The server's preferences for model selection, requested of the client during sampling. + */ +export declare const ModelPreferencesSchema: z.ZodObject<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">>; +/** + * Describes a message issued to or received from an LLM API. + */ +export declare const SamplingMessageSchema: z.ZodObject<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; +}, z.ZodTypeAny, "passthrough">>; +/** + * A request from the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it. + */ +export declare const CreateMessageRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"sampling/createMessage">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; + /** + * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt. + */ + systemPrompt: z.ZodOptional; + /** + * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request. + */ + includeContext: z.ZodOptional>; + temperature: z.ZodOptional; + /** + * The maximum number of tokens to sample, as requested by the server. The client MAY choose to sample fewer tokens than requested. + */ + maxTokens: z.ZodNumber; + stopSequences: z.ZodOptional>; + /** + * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific. + */ + metadata: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * The server's preferences for which model to select. + */ + modelPreferences: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; + /** + * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt. + */ + systemPrompt: z.ZodOptional; + /** + * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request. + */ + includeContext: z.ZodOptional>; + temperature: z.ZodOptional; + /** + * The maximum number of tokens to sample, as requested by the server. The client MAY choose to sample fewer tokens than requested. + */ + maxTokens: z.ZodNumber; + stopSequences: z.ZodOptional>; + /** + * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific. + */ + metadata: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * The server's preferences for which model to select. + */ + modelPreferences: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; + /** + * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt. + */ + systemPrompt: z.ZodOptional; + /** + * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request. + */ + includeContext: z.ZodOptional>; + temperature: z.ZodOptional; + /** + * The maximum number of tokens to sample, as requested by the server. The client MAY choose to sample fewer tokens than requested. + */ + maxTokens: z.ZodNumber; + stopSequences: z.ZodOptional>; + /** + * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific. + */ + metadata: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * The server's preferences for which model to select. + */ + modelPreferences: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + messages: z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">[]; + maxTokens: number; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + systemPrompt?: string | undefined; + includeContext?: "none" | "thisServer" | "allServers" | undefined; + temperature?: number | undefined; + stopSequences?: string[] | undefined; + metadata?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + modelPreferences?: z.objectOutputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "sampling/createMessage"; +}, { + params: { + messages: z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">[]; + maxTokens: number; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + systemPrompt?: string | undefined; + includeContext?: "none" | "thisServer" | "allServers" | undefined; + temperature?: number | undefined; + stopSequences?: string[] | undefined; + metadata?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + modelPreferences?: z.objectInputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "sampling/createMessage"; +}>; +/** + * The client's response to a sampling/create_message request from the server. The client should inform the user before returning the sampled message, to allow them to inspect the response (human in the loop) and decide whether to allow the server to see it. + */ +export declare const CreateMessageResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The name of the model that generated the message. + */ + model: z.ZodString; + /** + * The reason why sampling stopped. + */ + stopReason: z.ZodOptional, z.ZodString]>>; + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The name of the model that generated the message. + */ + model: z.ZodString; + /** + * The reason why sampling stopped. + */ + stopReason: z.ZodOptional, z.ZodString]>>; + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The name of the model that generated the message. + */ + model: z.ZodString; + /** + * The reason why sampling stopped. + */ + stopReason: z.ZodOptional, z.ZodString]>>; + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; +}>, z.ZodTypeAny, "passthrough">>; +/** + * A reference to a resource or resource template definition. + */ +export declare const ResourceReferenceSchema: z.ZodObject<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; +}, z.ZodTypeAny, "passthrough">>; +/** + * Identifies a prompt. + */ +export declare const PromptReferenceSchema: z.ZodObject<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; +}, z.ZodTypeAny, "passthrough">>; +/** + * A request from the client to the server, to ask for completion options. + */ +export declare const CompleteRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"completion/complete">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + ref: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + /** + * The argument's information + */ + argument: z.ZodObject<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + ref: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + /** + * The argument's information + */ + argument: z.ZodObject<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + ref: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + /** + * The argument's information + */ + argument: z.ZodObject<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + ref: z.objectOutputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">; + argument: { + value: string; + name: string; + } & { + [k: string]: unknown; + }; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "completion/complete"; +}, { + params: { + ref: z.objectInputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough"> | z.objectInputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">; + argument: { + value: string; + name: string; + } & { + [k: string]: unknown; + }; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "completion/complete"; +}>; +/** + * The server's response to a completion/complete request + */ +export declare const CompleteResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + completion: z.ZodObject<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + completion: z.ZodObject<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + completion: z.ZodObject<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>; +}>, z.ZodTypeAny, "passthrough">>; +/** + * Represents a root directory or file that the server can operate on. + */ +export declare const RootSchema: z.ZodObject<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">>; +/** + * Sent from the server to request a list of root URIs from the client. + */ +export declare const ListRootsRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"roots/list">; +}>, "strip", z.ZodTypeAny, { + method: "roots/list"; + params?: z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "roots/list"; + params?: z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * The client's response to a roots/list request from the server. + */ +export declare const ListRootsResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + roots: z.ZodArray; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + roots: z.ZodArray; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + roots: z.ZodArray; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>; +/** + * A notification from the client to the server, informing it that the list of roots has changed. + */ +export declare const RootsListChangedNotificationSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/roots/list_changed">; +}>, "strip", z.ZodTypeAny, { + method: "notifications/roots/list_changed"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "notifications/roots/list_changed"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +export declare const ClientRequestSchema: z.ZodUnion<[z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"ping">; +}>, "strip", z.ZodTypeAny, { + method: "ping"; + params?: z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "ping"; + params?: z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"initialize">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + clientInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + clientInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + clientInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + protocolVersion: string; + capabilities: { + experimental?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + sampling?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + roots?: z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + clientInfo: { + name: string; + version: string; + } & { + [k: string]: unknown; + }; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "initialize"; +}, { + params: { + protocolVersion: string; + capabilities: { + experimental?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + sampling?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + roots?: z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + clientInfo: { + name: string; + version: string; + } & { + [k: string]: unknown; + }; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "initialize"; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"completion/complete">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + ref: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + /** + * The argument's information + */ + argument: z.ZodObject<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + ref: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + /** + * The argument's information + */ + argument: z.ZodObject<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + ref: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + /** + * The argument's information + */ + argument: z.ZodObject<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + ref: z.objectOutputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">; + argument: { + value: string; + name: string; + } & { + [k: string]: unknown; + }; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "completion/complete"; +}, { + params: { + ref: z.objectInputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough"> | z.objectInputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">; + argument: { + value: string; + name: string; + } & { + [k: string]: unknown; + }; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "completion/complete"; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"logging/setLevel">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + level: "error" | "debug" | "info" | "notice" | "warning" | "critical" | "alert" | "emergency"; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "logging/setLevel"; +}, { + params: { + level: "error" | "debug" | "info" | "notice" | "warning" | "critical" | "alert" | "emergency"; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "logging/setLevel"; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"prompts/get">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * Arguments to use for templating the prompt. + */ + arguments: z.ZodOptional>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * Arguments to use for templating the prompt. + */ + arguments: z.ZodOptional>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * Arguments to use for templating the prompt. + */ + arguments: z.ZodOptional>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + name: string; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + arguments?: Record | undefined; + } & { + [k: string]: unknown; + }; + method: "prompts/get"; +}, { + params: { + name: string; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + arguments?: Record | undefined; + } & { + [k: string]: unknown; + }; + method: "prompts/get"; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>>; +}>, { + method: z.ZodLiteral<"prompts/list">; +}>, "strip", z.ZodTypeAny, { + method: "prompts/list"; + params?: z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "prompts/list"; + params?: z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>>; +}>, { + method: z.ZodLiteral<"resources/list">; +}>, "strip", z.ZodTypeAny, { + method: "resources/list"; + params?: z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "resources/list"; + params?: z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>>; +}>, { + method: z.ZodLiteral<"resources/templates/list">; +}>, "strip", z.ZodTypeAny, { + method: "resources/templates/list"; + params?: z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "resources/templates/list"; + params?: z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"resources/read">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + uri: string; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/read"; +}, { + params: { + uri: string; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/read"; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"resources/subscribe">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + uri: string; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/subscribe"; +}, { + params: { + uri: string; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/subscribe"; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"resources/unsubscribe">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to unsubscribe from. + */ + uri: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to unsubscribe from. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to unsubscribe from. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + uri: string; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/unsubscribe"; +}, { + params: { + uri: string; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/unsubscribe"; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"tools/call">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + name: z.ZodString; + arguments: z.ZodOptional>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + name: z.ZodString; + arguments: z.ZodOptional>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + name: z.ZodString; + arguments: z.ZodOptional>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + name: string; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + arguments?: Record | undefined; + } & { + [k: string]: unknown; + }; + method: "tools/call"; +}, { + params: { + name: string; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + arguments?: Record | undefined; + } & { + [k: string]: unknown; + }; + method: "tools/call"; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>>; +}>, { + method: z.ZodLiteral<"tools/list">; +}>, "strip", z.ZodTypeAny, { + method: "tools/list"; + params?: z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "tools/list"; + params?: z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}>]>; +export declare const ClientNotificationSchema: z.ZodUnion<[z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/cancelled">; + params: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The ID of the request to cancel. + * + * This MUST correspond to the ID of a request previously issued in the same direction. + */ + requestId: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + /** + * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. + */ + reason: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The ID of the request to cancel. + * + * This MUST correspond to the ID of a request previously issued in the same direction. + */ + requestId: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + /** + * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. + */ + reason: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The ID of the request to cancel. + * + * This MUST correspond to the ID of a request previously issued in the same direction. + */ + requestId: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + /** + * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. + */ + reason: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + requestId: string | number; + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + reason?: string | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/cancelled"; +}, { + params: { + requestId: string | number; + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + reason?: string | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/cancelled"; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/progress">; + params: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + }>, { + /** + * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. + */ + progressToken: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + }>, { + /** + * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. + */ + progressToken: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + }>, { + /** + * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. + */ + progressToken: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + progressToken: string | number; + progress: number; + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + total?: number | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/progress"; +}, { + params: { + progressToken: string | number; + progress: number; + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + total?: number | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/progress"; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/initialized">; +}>, "strip", z.ZodTypeAny, { + method: "notifications/initialized"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "notifications/initialized"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/roots/list_changed">; +}>, "strip", z.ZodTypeAny, { + method: "notifications/roots/list_changed"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "notifications/roots/list_changed"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>]>; +export declare const ClientResultSchema: z.ZodUnion<[z.ZodObject<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, "strict", z.ZodTypeAny, { + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; +}, { + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The name of the model that generated the message. + */ + model: z.ZodString; + /** + * The reason why sampling stopped. + */ + stopReason: z.ZodOptional, z.ZodString]>>; + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The name of the model that generated the message. + */ + model: z.ZodString; + /** + * The reason why sampling stopped. + */ + stopReason: z.ZodOptional, z.ZodString]>>; + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The name of the model that generated the message. + */ + model: z.ZodString; + /** + * The reason why sampling stopped. + */ + stopReason: z.ZodOptional, z.ZodString]>>; + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; +}>, z.ZodTypeAny, "passthrough">>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + roots: z.ZodArray; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + roots: z.ZodArray; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + roots: z.ZodArray; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>]>; +export declare const ServerRequestSchema: z.ZodUnion<[z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"ping">; +}>, "strip", z.ZodTypeAny, { + method: "ping"; + params?: z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "ping"; + params?: z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"sampling/createMessage">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; + /** + * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt. + */ + systemPrompt: z.ZodOptional; + /** + * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request. + */ + includeContext: z.ZodOptional>; + temperature: z.ZodOptional; + /** + * The maximum number of tokens to sample, as requested by the server. The client MAY choose to sample fewer tokens than requested. + */ + maxTokens: z.ZodNumber; + stopSequences: z.ZodOptional>; + /** + * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific. + */ + metadata: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * The server's preferences for which model to select. + */ + modelPreferences: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; + /** + * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt. + */ + systemPrompt: z.ZodOptional; + /** + * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request. + */ + includeContext: z.ZodOptional>; + temperature: z.ZodOptional; + /** + * The maximum number of tokens to sample, as requested by the server. The client MAY choose to sample fewer tokens than requested. + */ + maxTokens: z.ZodNumber; + stopSequences: z.ZodOptional>; + /** + * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific. + */ + metadata: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * The server's preferences for which model to select. + */ + modelPreferences: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; + /** + * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt. + */ + systemPrompt: z.ZodOptional; + /** + * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request. + */ + includeContext: z.ZodOptional>; + temperature: z.ZodOptional; + /** + * The maximum number of tokens to sample, as requested by the server. The client MAY choose to sample fewer tokens than requested. + */ + maxTokens: z.ZodNumber; + stopSequences: z.ZodOptional>; + /** + * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific. + */ + metadata: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * The server's preferences for which model to select. + */ + modelPreferences: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + messages: z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">[]; + maxTokens: number; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + systemPrompt?: string | undefined; + includeContext?: "none" | "thisServer" | "allServers" | undefined; + temperature?: number | undefined; + stopSequences?: string[] | undefined; + metadata?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + modelPreferences?: z.objectOutputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "sampling/createMessage"; +}, { + params: { + messages: z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">[]; + maxTokens: number; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + systemPrompt?: string | undefined; + includeContext?: "none" | "thisServer" | "allServers" | undefined; + temperature?: number | undefined; + stopSequences?: string[] | undefined; + metadata?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + modelPreferences?: z.objectInputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "sampling/createMessage"; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"roots/list">; +}>, "strip", z.ZodTypeAny, { + method: "roots/list"; + params?: z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "roots/list"; + params?: z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>]>; +export declare const ServerNotificationSchema: z.ZodUnion<[z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/cancelled">; + params: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The ID of the request to cancel. + * + * This MUST correspond to the ID of a request previously issued in the same direction. + */ + requestId: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + /** + * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. + */ + reason: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The ID of the request to cancel. + * + * This MUST correspond to the ID of a request previously issued in the same direction. + */ + requestId: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + /** + * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. + */ + reason: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The ID of the request to cancel. + * + * This MUST correspond to the ID of a request previously issued in the same direction. + */ + requestId: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + /** + * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. + */ + reason: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + requestId: string | number; + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + reason?: string | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/cancelled"; +}, { + params: { + requestId: string | number; + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + reason?: string | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/cancelled"; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/progress">; + params: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + }>, { + /** + * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. + */ + progressToken: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + }>, { + /** + * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. + */ + progressToken: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + }>, { + /** + * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. + */ + progressToken: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + progressToken: string | number; + progress: number; + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + total?: number | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/progress"; +}, { + params: { + progressToken: string | number; + progress: number; + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + total?: number | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/progress"; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/message">; + params: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The severity of this log message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + /** + * An optional name of the logger issuing this message. + */ + logger: z.ZodOptional; + /** + * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here. + */ + data: z.ZodUnknown; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The severity of this log message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + /** + * An optional name of the logger issuing this message. + */ + logger: z.ZodOptional; + /** + * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here. + */ + data: z.ZodUnknown; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The severity of this log message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + /** + * An optional name of the logger issuing this message. + */ + logger: z.ZodOptional; + /** + * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here. + */ + data: z.ZodUnknown; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + level: "error" | "debug" | "info" | "notice" | "warning" | "critical" | "alert" | "emergency"; + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + data?: unknown; + logger?: string | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/message"; +}, { + params: { + level: "error" | "debug" | "info" | "notice" | "warning" | "critical" | "alert" | "emergency"; + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + data?: unknown; + logger?: string | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/message"; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/resources/updated">; + params: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to. + */ + uri: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + uri: string; + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/resources/updated"; +}, { + params: { + uri: string; + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/resources/updated"; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/resources/list_changed">; +}>, "strip", z.ZodTypeAny, { + method: "notifications/resources/list_changed"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "notifications/resources/list_changed"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/tools/list_changed">; +}>, "strip", z.ZodTypeAny, { + method: "notifications/tools/list_changed"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "notifications/tools/list_changed"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/prompts/list_changed">; +}>, "strip", z.ZodTypeAny, { + method: "notifications/prompts/list_changed"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "notifications/prompts/list_changed"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>]>; +export declare const ServerResultSchema: z.ZodUnion<[z.ZodObject<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, "strict", z.ZodTypeAny, { + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; +}, { + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + serverInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + serverInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + serverInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; +}>, z.ZodTypeAny, "passthrough">>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + completion: z.ZodObject<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + completion: z.ZodObject<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + completion: z.ZodObject<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>; +}>, z.ZodTypeAny, "passthrough">>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An optional description for the prompt. + */ + description: z.ZodOptional; + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An optional description for the prompt. + */ + description: z.ZodOptional; + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An optional description for the prompt. + */ + description: z.ZodOptional; + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + prompts: z.ZodArray; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + prompts: z.ZodArray; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + prompts: z.ZodArray; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resources: z.ZodArray; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resources: z.ZodArray; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resources: z.ZodArray; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resourceTemplates: z.ZodArray; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resourceTemplates: z.ZodArray; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resourceTemplates: z.ZodArray; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + contents: z.ZodArray; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + contents: z.ZodArray; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + contents: z.ZodArray; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>, "many">; +}>, z.ZodTypeAny, "passthrough">>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + content: z.ZodArray; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>, "many">; + isError: z.ZodOptional>; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + content: z.ZodArray; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>, "many">; + isError: z.ZodOptional>; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + content: z.ZodArray; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>, "many">; + isError: z.ZodOptional>; +}>, z.ZodTypeAny, "passthrough">>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + tools: z.ZodArray; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + tools: z.ZodArray; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + tools: z.ZodArray; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>]>; +export declare class McpError extends Error { + readonly code: number; + readonly data?: unknown; + constructor(code: number, message: string, data?: unknown); +} +export type ProgressToken = z.infer; +export type Cursor = z.infer; +export type Request = z.infer; +export type Notification = z.infer; +export type Result = z.infer; +export type RequestId = z.infer; +export type JSONRPCRequest = z.infer; +export type JSONRPCNotification = z.infer; +export type JSONRPCResponse = z.infer; +export type JSONRPCError = z.infer; +export type JSONRPCMessage = z.infer; +export type EmptyResult = z.infer; +export type CancelledNotification = z.infer; +export type Implementation = z.infer; +export type ClientCapabilities = z.infer; +export type InitializeRequest = z.infer; +export type ServerCapabilities = z.infer; +export type InitializeResult = z.infer; +export type InitializedNotification = z.infer; +export type PingRequest = z.infer; +export type Progress = z.infer; +export type ProgressNotification = z.infer; +export type PaginatedRequest = z.infer; +export type PaginatedResult = z.infer; +export type ResourceContents = z.infer; +export type TextResourceContents = z.infer; +export type BlobResourceContents = z.infer; +export type Resource = z.infer; +export type ResourceTemplate = z.infer; +export type ListResourcesRequest = z.infer; +export type ListResourcesResult = z.infer; +export type ListResourceTemplatesRequest = z.infer; +export type ListResourceTemplatesResult = z.infer; +export type ReadResourceRequest = z.infer; +export type ReadResourceResult = z.infer; +export type ResourceListChangedNotification = z.infer; +export type SubscribeRequest = z.infer; +export type UnsubscribeRequest = z.infer; +export type ResourceUpdatedNotification = z.infer; +export type PromptArgument = z.infer; +export type Prompt = z.infer; +export type ListPromptsRequest = z.infer; +export type ListPromptsResult = z.infer; +export type GetPromptRequest = z.infer; +export type TextContent = z.infer; +export type ImageContent = z.infer; +export type EmbeddedResource = z.infer; +export type PromptMessage = z.infer; +export type GetPromptResult = z.infer; +export type PromptListChangedNotification = z.infer; +export type Tool = z.infer; +export type ListToolsRequest = z.infer; +export type ListToolsResult = z.infer; +export type CallToolResult = z.infer; +export type CompatibilityCallToolResult = z.infer; +export type CallToolRequest = z.infer; +export type ToolListChangedNotification = z.infer; +export type LoggingLevel = z.infer; +export type SetLevelRequest = z.infer; +export type LoggingMessageNotification = z.infer; +export type SamplingMessage = z.infer; +export type CreateMessageRequest = z.infer; +export type CreateMessageResult = z.infer; +export type ResourceReference = z.infer; +export type PromptReference = z.infer; +export type CompleteRequest = z.infer; +export type CompleteResult = z.infer; +export type Root = z.infer; +export type ListRootsRequest = z.infer; +export type ListRootsResult = z.infer; +export type RootsListChangedNotification = z.infer; +export type ClientRequest = z.infer; +export type ClientNotification = z.infer; +export type ClientResult = z.infer; +export type ServerRequest = z.infer; +export type ServerNotification = z.infer; +export type ServerResult = z.infer; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/types.d.ts.map b/front_end/third_party/mcp-sdk/package/dist/types.d.ts.map new file mode 100644 index 0000000000..524fc53c8c --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,uBAAuB,eAAe,CAAC;AACpD,eAAO,MAAM,2BAA2B,UAGvC,CAAC;AAGF,eAAO,MAAM,eAAe,QAAQ,CAAC;AAErC;;GAEG;AACH,eAAO,MAAM,mBAAmB,wCAA0C,CAAC;AAE3E;;GAEG;AACH,eAAO,MAAM,YAAY,aAAa,CAAC;AAiBvC,eAAO,MAAM,aAAa;;;;YAVhB;;eAEG;;;YAFH;;eAEG;;;YAFH;;eAEG;;;;;YAFH;;eAEG;;;YAFH;;eAEG;;;YAFH;;eAEG;;;;;YAFH;;eAEG;;;YAFH;;eAEG;;;YAFH;;eAEG;;;;;;;;YAFH;;eAEG;;;YAFH;;eAEG;;;YAFH;;eAEG;;;;;;;;YAFH;;eAEG;;;YAFH;;eAEG;;;YAFH;;eAEG;;;;EAWX,CAAC;AAWH,eAAO,MAAM,kBAAkB;;;QAP3B;;WAEG;;;QAFH;;WAEG;;;QAFH;;WAEG;;;;;;QAFH;;WAEG;;;;;;QAFH;;WAEG;;;EAQL,CAAC;AAEH,eAAO,MAAM,YAAY;IAErB;;OA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,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAG9D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/types.js b/front_end/third_party/mcp-sdk/package/dist/types.js new file mode 100644 index 0000000000..36b2ce93fa --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/types.js @@ -0,0 +1,997 @@ +import { z } from "../../zod/lib/index.mjs"; +export const LATEST_PROTOCOL_VERSION = "2024-11-05"; +export const SUPPORTED_PROTOCOL_VERSIONS = [ + LATEST_PROTOCOL_VERSION, + "2024-10-07", +]; +/* JSON-RPC types */ +export const JSONRPC_VERSION = "2.0"; +/** + * A progress token, used to associate progress notifications with the original request. + */ +export const ProgressTokenSchema = z.union([z.string(), z.number().int()]); +/** + * An opaque token used to represent a cursor for pagination. + */ +export const CursorSchema = z.string(); +const BaseRequestParamsSchema = z + .object({ + _meta: z.optional(z + .object({ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.optional(ProgressTokenSchema), + }) + .passthrough()), +}) + .passthrough(); +export const RequestSchema = z.object({ + method: z.string(), + params: z.optional(BaseRequestParamsSchema), +}); +const BaseNotificationParamsSchema = z + .object({ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.optional(z.object({}).passthrough()), +}) + .passthrough(); +export const NotificationSchema = z.object({ + method: z.string(), + params: z.optional(BaseNotificationParamsSchema), +}); +export const ResultSchema = z + .object({ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.optional(z.object({}).passthrough()), +}) + .passthrough(); +/** + * A uniquely identifying ID for a request in JSON-RPC. + */ +export const RequestIdSchema = z.union([z.string(), z.number().int()]); +/** + * A request that expects a response. + */ +export const JSONRPCRequestSchema = z + .object({ + jsonrpc: z.literal(JSONRPC_VERSION), + id: RequestIdSchema, +}) + .merge(RequestSchema) + .strict(); +/** + * A notification which does not expect a response. + */ +export const JSONRPCNotificationSchema = z + .object({ + jsonrpc: z.literal(JSONRPC_VERSION), +}) + .merge(NotificationSchema) + .strict(); +/** + * A successful (non-error) response to a request. + */ +export const JSONRPCResponseSchema = z + .object({ + jsonrpc: z.literal(JSONRPC_VERSION), + id: RequestIdSchema, + result: ResultSchema, +}) + .strict(); +/** + * An incomplete set of error codes that may appear in JSON-RPC responses. + */ +export var ErrorCode; +(function (ErrorCode) { + // SDK error codes + ErrorCode[ErrorCode["ConnectionClosed"] = -1] = "ConnectionClosed"; + ErrorCode[ErrorCode["RequestTimeout"] = -2] = "RequestTimeout"; + // Standard JSON-RPC error codes + ErrorCode[ErrorCode["ParseError"] = -32700] = "ParseError"; + ErrorCode[ErrorCode["InvalidRequest"] = -32600] = "InvalidRequest"; + ErrorCode[ErrorCode["MethodNotFound"] = -32601] = "MethodNotFound"; + ErrorCode[ErrorCode["InvalidParams"] = -32602] = "InvalidParams"; + ErrorCode[ErrorCode["InternalError"] = -32603] = "InternalError"; +})(ErrorCode || (ErrorCode = {})); +/** + * A response to a request that indicates an error occurred. + */ +export const JSONRPCErrorSchema = z + .object({ + jsonrpc: z.literal(JSONRPC_VERSION), + id: RequestIdSchema, + error: z.object({ + /** + * The error type that occurred. + */ + code: z.number().int(), + /** + * A short description of the error. The message SHOULD be limited to a concise single sentence. + */ + message: z.string(), + /** + * Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.). + */ + data: z.optional(z.unknown()), + }), +}) + .strict(); +export const JSONRPCMessageSchema = z.union([ + JSONRPCRequestSchema, + JSONRPCNotificationSchema, + JSONRPCResponseSchema, + JSONRPCErrorSchema, +]); +/* Empty result */ +/** + * A response that indicates success but carries no data. + */ +export const EmptyResultSchema = ResultSchema.strict(); +/* Cancellation */ +/** + * This notification can be sent by either side to indicate that it is cancelling a previously-issued request. + * + * The request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished. + * + * This notification indicates that the result will be unused, so any associated processing SHOULD cease. + * + * A client MUST NOT attempt to cancel its `initialize` request. + */ +export const CancelledNotificationSchema = NotificationSchema.extend({ + method: z.literal("notifications/cancelled"), + params: BaseNotificationParamsSchema.extend({ + /** + * The ID of the request to cancel. + * + * This MUST correspond to the ID of a request previously issued in the same direction. + */ + requestId: RequestIdSchema, + /** + * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. + */ + reason: z.string().optional(), + }), +}); +/* Initialization */ +/** + * Describes the name and version of an MCP implementation. + */ +export const ImplementationSchema = z + .object({ + name: z.string(), + version: z.string(), +}) + .passthrough(); +/** + * Capabilities a client may support. Known capabilities are defined here, in this schema, but this is not a closed set: any client can define its own, additional capabilities. + */ +export const ClientCapabilitiesSchema = z + .object({ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.optional(z.object({}).passthrough()), + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.optional(z.object({}).passthrough()), + /** + * Present if the client supports listing roots. + */ + roots: z.optional(z + .object({ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.optional(z.boolean()), + }) + .passthrough()), +}) + .passthrough(); +/** + * This request is sent from the client to the server when it first connects, asking it to begin initialization. + */ +export const InitializeRequestSchema = RequestSchema.extend({ + method: z.literal("initialize"), + params: BaseRequestParamsSchema.extend({ + /** + * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well. + */ + protocolVersion: z.string(), + capabilities: ClientCapabilitiesSchema, + clientInfo: ImplementationSchema, + }), +}); +/** + * Capabilities that a server may support. Known capabilities are defined here, in this schema, but this is not a closed set: any server can define its own, additional capabilities. + */ +export const ServerCapabilitiesSchema = z + .object({ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.optional(z.object({}).passthrough()), + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.optional(z.object({}).passthrough()), + /** + * Present if the server offers any prompt templates. + */ + prompts: z.optional(z + .object({ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.optional(z.boolean()), + }) + .passthrough()), + /** + * Present if the server offers any resources to read. + */ + resources: z.optional(z + .object({ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.optional(z.boolean()), + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.optional(z.boolean()), + }) + .passthrough()), + /** + * Present if the server offers any tools to call. + */ + tools: z.optional(z + .object({ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.optional(z.boolean()), + }) + .passthrough()), +}) + .passthrough(); +/** + * After receiving an initialize request from the client, the server sends this response. + */ +export const InitializeResultSchema = ResultSchema.extend({ + /** + * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect. + */ + protocolVersion: z.string(), + capabilities: ServerCapabilitiesSchema, + serverInfo: ImplementationSchema, +}); +/** + * This notification is sent from the client to the server after initialization has finished. + */ +export const InitializedNotificationSchema = NotificationSchema.extend({ + method: z.literal("notifications/initialized"), +}); +/* Ping */ +/** + * A ping, issued by either the server or the client, to check that the other party is still alive. The receiver must promptly respond, or else may be disconnected. + */ +export const PingRequestSchema = RequestSchema.extend({ + method: z.literal("ping"), +}); +/* Progress notifications */ +export const ProgressSchema = z + .object({ + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.number(), + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.optional(z.number()), +}) + .passthrough(); +/** + * An out-of-band notification used to inform the receiver of a progress update for a long-running request. + */ +export const ProgressNotificationSchema = NotificationSchema.extend({ + method: z.literal("notifications/progress"), + params: BaseNotificationParamsSchema.merge(ProgressSchema).extend({ + /** + * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. + */ + progressToken: ProgressTokenSchema, + }), +}); +/* Pagination */ +export const PaginatedRequestSchema = RequestSchema.extend({ + params: BaseRequestParamsSchema.extend({ + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.optional(CursorSchema), + }).optional(), +}); +export const PaginatedResultSchema = ResultSchema.extend({ + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.optional(CursorSchema), +}); +/* Resources */ +/** + * The contents of a specific resource or sub-resource. + */ +export const ResourceContentsSchema = z + .object({ + /** + * The URI of this resource. + */ + uri: z.string(), + /** + * The MIME type of this resource, if known. + */ + mimeType: z.optional(z.string()), +}) + .passthrough(); +export const TextResourceContentsSchema = ResourceContentsSchema.extend({ + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.string(), +}); +export const BlobResourceContentsSchema = ResourceContentsSchema.extend({ + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.string().base64(), +}); +/** + * A known resource that the server is capable of reading. + */ +export const ResourceSchema = z + .object({ + /** + * The URI of this resource. + */ + uri: z.string(), + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.string(), + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.optional(z.string()), + /** + * The MIME type of this resource, if known. + */ + mimeType: z.optional(z.string()), +}) + .passthrough(); +/** + * A template description for resources available on the server. + */ +export const ResourceTemplateSchema = z + .object({ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.string(), + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.string(), + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.optional(z.string()), + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.optional(z.string()), +}) + .passthrough(); +/** + * Sent from the client to request a list of resources the server has. + */ +export const ListResourcesRequestSchema = PaginatedRequestSchema.extend({ + method: z.literal("resources/list"), +}); +/** + * The server's response to a resources/list request from the client. + */ +export const ListResourcesResultSchema = PaginatedResultSchema.extend({ + resources: z.array(ResourceSchema), +}); +/** + * Sent from the client to request a list of resource templates the server has. + */ +export const ListResourceTemplatesRequestSchema = PaginatedRequestSchema.extend({ + method: z.literal("resources/templates/list"), +}); +/** + * The server's response to a resources/templates/list request from the client. + */ +export const ListResourceTemplatesResultSchema = PaginatedResultSchema.extend({ + resourceTemplates: z.array(ResourceTemplateSchema), +}); +/** + * Sent from the client to the server, to read a specific resource URI. + */ +export const ReadResourceRequestSchema = RequestSchema.extend({ + method: z.literal("resources/read"), + params: BaseRequestParamsSchema.extend({ + /** + * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.string(), + }), +}); +/** + * The server's response to a resources/read request from the client. + */ +export const ReadResourceResultSchema = ResultSchema.extend({ + contents: z.array(z.union([TextResourceContentsSchema, BlobResourceContentsSchema])), +}); +/** + * An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This may be issued by servers without any previous subscription from the client. + */ +export const ResourceListChangedNotificationSchema = NotificationSchema.extend({ + method: z.literal("notifications/resources/list_changed"), +}); +/** + * Sent from the client to request resources/updated notifications from the server whenever a particular resource changes. + */ +export const SubscribeRequestSchema = RequestSchema.extend({ + method: z.literal("resources/subscribe"), + params: BaseRequestParamsSchema.extend({ + /** + * The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.string(), + }), +}); +/** + * Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request. + */ +export const UnsubscribeRequestSchema = RequestSchema.extend({ + method: z.literal("resources/unsubscribe"), + params: BaseRequestParamsSchema.extend({ + /** + * The URI of the resource to unsubscribe from. + */ + uri: z.string(), + }), +}); +/** + * A notification from the server to the client, informing it that a resource has changed and may need to be read again. This should only be sent if the client previously sent a resources/subscribe request. + */ +export const ResourceUpdatedNotificationSchema = NotificationSchema.extend({ + method: z.literal("notifications/resources/updated"), + params: BaseNotificationParamsSchema.extend({ + /** + * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to. + */ + uri: z.string(), + }), +}); +/* Prompts */ +/** + * Describes an argument that a prompt can accept. + */ +export const PromptArgumentSchema = z + .object({ + /** + * The name of the argument. + */ + name: z.string(), + /** + * A human-readable description of the argument. + */ + description: z.optional(z.string()), + /** + * Whether this argument must be provided. + */ + required: z.optional(z.boolean()), +}) + .passthrough(); +/** + * A prompt or prompt template that the server offers. + */ +export const PromptSchema = z + .object({ + /** + * The name of the prompt or prompt template. + */ + name: z.string(), + /** + * An optional description of what this prompt provides + */ + description: z.optional(z.string()), + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.optional(z.array(PromptArgumentSchema)), +}) + .passthrough(); +/** + * Sent from the client to request a list of prompts and prompt templates the server has. + */ +export const ListPromptsRequestSchema = PaginatedRequestSchema.extend({ + method: z.literal("prompts/list"), +}); +/** + * The server's response to a prompts/list request from the client. + */ +export const ListPromptsResultSchema = PaginatedResultSchema.extend({ + prompts: z.array(PromptSchema), +}); +/** + * Used by the client to get a prompt provided by the server. + */ +export const GetPromptRequestSchema = RequestSchema.extend({ + method: z.literal("prompts/get"), + params: BaseRequestParamsSchema.extend({ + /** + * The name of the prompt or prompt template. + */ + name: z.string(), + /** + * Arguments to use for templating the prompt. + */ + arguments: z.optional(z.record(z.string())), + }), +}); +/** + * Text provided to or from an LLM. + */ +export const TextContentSchema = z + .object({ + type: z.literal("text"), + /** + * The text content of the message. + */ + text: z.string(), +}) + .passthrough(); +/** + * An image provided to or from an LLM. + */ +export const ImageContentSchema = z + .object({ + type: z.literal("image"), + /** + * The base64-encoded image data. + */ + data: z.string().base64(), + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.string(), +}) + .passthrough(); +/** + * The contents of a resource, embedded into a prompt or tool call result. + */ +export const EmbeddedResourceSchema = z + .object({ + type: z.literal("resource"), + resource: z.union([TextResourceContentsSchema, BlobResourceContentsSchema]), +}) + .passthrough(); +/** + * Describes a message returned as part of a prompt. + */ +export const PromptMessageSchema = z + .object({ + role: z.enum(["user", "assistant"]), + content: z.union([ + TextContentSchema, + ImageContentSchema, + EmbeddedResourceSchema, + ]), +}) + .passthrough(); +/** + * The server's response to a prompts/get request from the client. + */ +export const GetPromptResultSchema = ResultSchema.extend({ + /** + * An optional description for the prompt. + */ + description: z.optional(z.string()), + messages: z.array(PromptMessageSchema), +}); +/** + * An optional notification from the server to the client, informing it that the list of prompts it offers has changed. This may be issued by servers without any previous subscription from the client. + */ +export const PromptListChangedNotificationSchema = NotificationSchema.extend({ + method: z.literal("notifications/prompts/list_changed"), +}); +/* Tools */ +/** + * Definition for a tool the client can call. + */ +export const ToolSchema = z + .object({ + /** + * The name of the tool. + */ + name: z.string(), + /** + * A human-readable description of the tool. + */ + description: z.optional(z.string()), + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z + .object({ + type: z.literal("object"), + properties: z.optional(z.object({}).passthrough()), + }) + .passthrough(), +}) + .passthrough(); +/** + * Sent from the client to request a list of tools the server has. + */ +export const ListToolsRequestSchema = PaginatedRequestSchema.extend({ + method: z.literal("tools/list"), +}); +/** + * The server's response to a tools/list request from the client. + */ +export const ListToolsResultSchema = PaginatedResultSchema.extend({ + tools: z.array(ToolSchema), +}); +/** + * The server's response to a tool call. + */ +export const CallToolResultSchema = ResultSchema.extend({ + content: z.array(z.union([TextContentSchema, ImageContentSchema, EmbeddedResourceSchema])), + isError: z.boolean().default(false).optional(), +}); +/** + * CallToolResultSchema extended with backwards compatibility to protocol version 2024-10-07. + */ +export const CompatibilityCallToolResultSchema = CallToolResultSchema.or(ResultSchema.extend({ + toolResult: z.unknown(), +})); +/** + * Used by the client to invoke a tool provided by the server. + */ +export const CallToolRequestSchema = RequestSchema.extend({ + method: z.literal("tools/call"), + params: BaseRequestParamsSchema.extend({ + name: z.string(), + arguments: z.optional(z.record(z.unknown())), + }), +}); +/** + * An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client. + */ +export const ToolListChangedNotificationSchema = NotificationSchema.extend({ + method: z.literal("notifications/tools/list_changed"), +}); +/* Logging */ +/** + * The severity of a log message. + */ +export const LoggingLevelSchema = z.enum([ + "debug", + "info", + "notice", + "warning", + "error", + "critical", + "alert", + "emergency", +]); +/** + * A request from the client to the server, to enable or adjust logging. + */ +export const SetLevelRequestSchema = RequestSchema.extend({ + method: z.literal("logging/setLevel"), + params: BaseRequestParamsSchema.extend({ + /** + * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message. + */ + level: LoggingLevelSchema, + }), +}); +/** + * Notification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically. + */ +export const LoggingMessageNotificationSchema = NotificationSchema.extend({ + method: z.literal("notifications/message"), + params: BaseNotificationParamsSchema.extend({ + /** + * The severity of this log message. + */ + level: LoggingLevelSchema, + /** + * An optional name of the logger issuing this message. + */ + logger: z.optional(z.string()), + /** + * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here. + */ + data: z.unknown(), + }), +}); +/* Sampling */ +/** + * Hints to use for model selection. + */ +export const ModelHintSchema = z + .object({ + /** + * A hint for a model name. + */ + name: z.string().optional(), +}) + .passthrough(); +/** + * The server's preferences for model selection, requested of the client during sampling. + */ +export const ModelPreferencesSchema = z + .object({ + /** + * Optional hints to use for model selection. + */ + hints: z.optional(z.array(ModelHintSchema)), + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.optional(z.number().min(0).max(1)), + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.optional(z.number().min(0).max(1)), + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.optional(z.number().min(0).max(1)), +}) + .passthrough(); +/** + * Describes a message issued to or received from an LLM API. + */ +export const SamplingMessageSchema = z + .object({ + role: z.enum(["user", "assistant"]), + content: z.union([TextContentSchema, ImageContentSchema]), +}) + .passthrough(); +/** + * A request from the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it. + */ +export const CreateMessageRequestSchema = RequestSchema.extend({ + method: z.literal("sampling/createMessage"), + params: BaseRequestParamsSchema.extend({ + messages: z.array(SamplingMessageSchema), + /** + * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt. + */ + systemPrompt: z.optional(z.string()), + /** + * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request. + */ + includeContext: z.optional(z.enum(["none", "thisServer", "allServers"])), + temperature: z.optional(z.number()), + /** + * The maximum number of tokens to sample, as requested by the server. The client MAY choose to sample fewer tokens than requested. + */ + maxTokens: z.number().int(), + stopSequences: z.optional(z.array(z.string())), + /** + * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific. + */ + metadata: z.optional(z.object({}).passthrough()), + /** + * The server's preferences for which model to select. + */ + modelPreferences: z.optional(ModelPreferencesSchema), + }), +}); +/** + * The client's response to a sampling/create_message request from the server. The client should inform the user before returning the sampled message, to allow them to inspect the response (human in the loop) and decide whether to allow the server to see it. + */ +export const CreateMessageResultSchema = ResultSchema.extend({ + /** + * The name of the model that generated the message. + */ + model: z.string(), + /** + * The reason why sampling stopped. + */ + stopReason: z.optional(z.enum(["endTurn", "stopSequence", "maxTokens"]).or(z.string())), + role: z.enum(["user", "assistant"]), + content: z.discriminatedUnion("type", [ + TextContentSchema, + ImageContentSchema, + ]), +}); +/* Autocomplete */ +/** + * A reference to a resource or resource template definition. + */ +export const ResourceReferenceSchema = z + .object({ + type: z.literal("ref/resource"), + /** + * The URI or URI template of the resource. + */ + uri: z.string(), +}) + .passthrough(); +/** + * Identifies a prompt. + */ +export const PromptReferenceSchema = z + .object({ + type: z.literal("ref/prompt"), + /** + * The name of the prompt or prompt template + */ + name: z.string(), +}) + .passthrough(); +/** + * A request from the client to the server, to ask for completion options. + */ +export const CompleteRequestSchema = RequestSchema.extend({ + method: z.literal("completion/complete"), + params: BaseRequestParamsSchema.extend({ + ref: z.union([PromptReferenceSchema, ResourceReferenceSchema]), + /** + * The argument's information + */ + argument: z + .object({ + /** + * The name of the argument + */ + name: z.string(), + /** + * The value of the argument to use for completion matching. + */ + value: z.string(), + }) + .passthrough(), + }), +}); +/** + * The server's response to a completion/complete request + */ +export const CompleteResultSchema = ResultSchema.extend({ + completion: z + .object({ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.array(z.string()).max(100), + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.optional(z.number().int()), + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.optional(z.boolean()), + }) + .passthrough(), +}); +/* Roots */ +/** + * Represents a root directory or file that the server can operate on. + */ +export const RootSchema = z + .object({ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.string().startsWith("file://"), + /** + * An optional name for the root. + */ + name: z.optional(z.string()), +}) + .passthrough(); +/** + * Sent from the server to request a list of root URIs from the client. + */ +export const ListRootsRequestSchema = RequestSchema.extend({ + method: z.literal("roots/list"), +}); +/** + * The client's response to a roots/list request from the server. + */ +export const ListRootsResultSchema = ResultSchema.extend({ + roots: z.array(RootSchema), +}); +/** + * A notification from the client to the server, informing it that the list of roots has changed. + */ +export const RootsListChangedNotificationSchema = NotificationSchema.extend({ + method: z.literal("notifications/roots/list_changed"), +}); +/* Client messages */ +export const ClientRequestSchema = z.union([ + PingRequestSchema, + InitializeRequestSchema, + CompleteRequestSchema, + SetLevelRequestSchema, + GetPromptRequestSchema, + ListPromptsRequestSchema, + ListResourcesRequestSchema, + ListResourceTemplatesRequestSchema, + ReadResourceRequestSchema, + SubscribeRequestSchema, + UnsubscribeRequestSchema, + CallToolRequestSchema, + ListToolsRequestSchema, +]); +export const ClientNotificationSchema = z.union([ + CancelledNotificationSchema, + ProgressNotificationSchema, + InitializedNotificationSchema, + RootsListChangedNotificationSchema, +]); +export const ClientResultSchema = z.union([ + EmptyResultSchema, + CreateMessageResultSchema, + ListRootsResultSchema, +]); +/* Server messages */ +export const ServerRequestSchema = z.union([ + PingRequestSchema, + CreateMessageRequestSchema, + ListRootsRequestSchema, +]); +export const ServerNotificationSchema = z.union([ + CancelledNotificationSchema, + ProgressNotificationSchema, + LoggingMessageNotificationSchema, + ResourceUpdatedNotificationSchema, + ResourceListChangedNotificationSchema, + ToolListChangedNotificationSchema, + PromptListChangedNotificationSchema, +]); +export const ServerResultSchema = z.union([ + EmptyResultSchema, + InitializeResultSchema, + CompleteResultSchema, + GetPromptResultSchema, + ListPromptsResultSchema, + ListResourcesResultSchema, + ListResourceTemplatesResultSchema, + ReadResourceResultSchema, + CallToolResultSchema, + ListToolsResultSchema, +]); +export class McpError extends Error { + constructor(code, message, data) { + super(`MCP error ${code}: ${message}`); + this.code = code; + this.data = data; + } +} +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/dist/types.js.map b/front_end/third_party/mcp-sdk/package/dist/types.js.map new file mode 100644 index 0000000000..913f55303e --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/dist/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,uBAAuB,GAAG,YAAY,CAAC;AAC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xC,iBAAiB;IACjB,yBAAyB;IACzB,qBAAqB;CACtB,CAAC,CAAC;AAEH,qBAAqB;AACrB,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC;IACzC,iBAAiB;IACjB,0BAA0B;IAC1B,sBAAsB;CACvB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC;IAC9C,2BAA2B;IAC3B,0BAA0B;IAC1B,gCAAgC;IAChC,iCAAiC;IACjC,qCAAqC;IACrC,iCAAiC;IACjC,mCAAmC;CACpC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC;IACxC,iBAAiB;IACjB,sBAAsB;IACtB,oBAAoB;IACpB,qBAAqB;IACrB,uBAAuB;IACvB,yBAAyB;IACzB,iCAAiC;IACjC,wBAAwB;IACxB,oBAAoB;IACpB,qBAAqB;CACtB,CAAC,CAAC;AAEH,MAAM,OAAO,QAAS,SAAQ,KAAK;IACjC,YACkB,IAAY,EAC5B,OAAe,EACC,IAAc;QAE9B,KAAK,CAAC,aAAa,IAAI,KAAK,OAAO,EAAE,CAAC,CAAC;QAJvB,SAAI,GAAJ,IAAI,CAAQ;QAEZ,SAAI,GAAJ,IAAI,CAAU;IAGhC,CAAC;CACF"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/package/package.json b/front_end/third_party/mcp-sdk/package/package.json new file mode 100644 index 0000000000..790b5e1d09 --- /dev/null +++ b/front_end/third_party/mcp-sdk/package/package.json @@ -0,0 +1,61 @@ +{ + "name": "@modelcontextprotocol/sdk", + "version": "1.0.4", + "description": "Model Context Protocol implementation for TypeScript", + "license": "MIT", + "author": "Anthropic, PBC (https://anthropic.com)", + "homepage": "https://modelcontextprotocol.io", + "bugs": "https://github.com/modelcontextprotocol/typescript-sdk/issues", + "type": "module", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "exports": { + "./*": "./dist/*" + }, + "typesVersions": { + "*": { + "*": [ + "./dist/*" + ] + } + }, + "files": [ + "dist" + ], + "scripts": { + "build": "tsc", + "prepack": "tsc", + "lint": "eslint src/", + "test": "jest", + "start": "npm run server", + "server": "tsx watch --clear-screen=false src/cli.ts server", + "client": "tsx src/cli.ts client" + }, + "dependencies": { + "content-type": "^1.0.5", + "raw-body": "^3.0.0", + "zod": "^3.23.8" + }, + "devDependencies": { + "@eslint/js": "^9.8.0", + "@types/content-type": "^1.1.8", + "@types/eslint__js": "^8.42.3", + "@types/eventsource": "^1.1.15", + "@types/express": "^4.17.21", + "@types/jest": "^29.5.12", + "@types/node": "^22.0.2", + "@types/ws": "^8.5.12", + "eslint": "^9.8.0", + "eventsource": "^2.0.2", + "express": "^4.19.2", + "jest": "^29.7.0", + "ts-jest": "^29.2.4", + "tsx": "^4.16.5", + "typescript": "^5.5.4", + "typescript-eslint": "^8.0.0", + "ws": "^8.18.0" + }, + "resolutions": { + "strip-ansi": "6.0.1" + } +} diff --git a/front_end/third_party/mcp-sdk/zod/LICENSE b/front_end/third_party/mcp-sdk/zod/LICENSE new file mode 100644 index 0000000000..2c93bb52b9 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Colin McDonnell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/front_end/third_party/mcp-sdk/zod/README.md b/front_end/third_party/mcp-sdk/zod/README.md new file mode 100644 index 0000000000..9c7ea1cf40 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/README.md @@ -0,0 +1,2876 @@ +

+ Zod logo +

Zod

+

+ ✨ https://zod.dev ✨ +
+ TypeScript-first schema validation with static type inference +

+

+
+

+Zod CI status +Created by Colin McDonnell +License +npm +stars +discord server +

+ +
+ Documentation +   •   + Discord +   •   + npm +   •   + deno +   •   + Issues +   •   + @colinhacks +   •   + tRPC +
+
+ +
+
+ +> Zod 3.23 is out! View the [release notes](https://github.com/colinhacks/zod/releases/tag/v3.23.0). + +> These docs have been translated into [Chinese](./README_ZH.md). + +## Table of contents + + + +- [Table of contents](#table-of-contents) +- [Introduction](#introduction) + - [Sponsors](#sponsors) + - [Gold](#gold) + - [Silver](#silver) + - [Bronze](#bronze) + - [Copper](#copper) + - [Ecosystem](#ecosystem) + - [Resources](#resources) + - [API libraries](#api-libraries) + - [Form integrations](#form-integrations) + - [Zod to X](#zod-to-x) + - [X to Zod](#x-to-zod) + - [Mocking](#mocking) + - [Powered by Zod](#powered-by-zod) + - [Utilities for Zod](#utilities-for-zod) +- [Installation](#installation) + - [Requirements](#requirements) + - [From `npm` (Node/Bun)](#from-npm-nodebun) + - [From `deno.land/x` (Deno)](#from-denolandx-deno) +- [Basic usage](#basic-usage) +- [Primitives](#primitives) +- [Coercion for primitives](#coercion-for-primitives) +- [Literals](#literals) +- [Strings](#strings) + - [Datetimes](#datetimes) + - [Dates](#dates) + - [Times](#times) + - [IP addresses](#ip-addresses) +- [Numbers](#numbers) +- [BigInts](#bigints) +- [NaNs](#nans) +- [Booleans](#booleans) +- [Dates](#dates) +- [Zod enums](#zod-enums) +- [Native enums](#native-enums) +- [Optionals](#optionals) +- [Nullables](#nullables) +- [Objects](#objects) + - [`.shape`](#shape) + - [`.keyof`](#keyof) + - [`.extend`](#extend) + - [`.merge`](#merge) + - [`.pick/.omit`](#pickomit) + - [`.partial`](#partial) + - [`.deepPartial`](#deeppartial) + - [`.required`](#required) + - [`.passthrough`](#passthrough) + - [`.strict`](#strict) + - [`.strip`](#strip) + - [`.catchall`](#catchall) +- [Arrays](#arrays) + - [`.element`](#element) + - [`.nonempty`](#nonempty) + - [`.min/.max/.length`](#minmaxlength) +- [Tuples](#tuples) +- [Unions](#unions) +- [Discriminated unions](#discriminated-unions) +- [Records](#records) + - [Record key type](#record-key-type) +- [Maps](#maps) +- [Sets](#sets) +- [Intersections](#intersections) +- [Recursive types](#recursive-types) + - [ZodType with ZodEffects](#zodtype-with-zodeffects) + - [JSON type](#json-type) + - [Cyclical objects](#cyclical-objects) +- [Promises](#promises) +- [Instanceof](#instanceof) +- [Functions](#functions) +- [Preprocess](#preprocess) +- [Custom schemas](#custom-schemas) +- [Schema methods](#schema-methods) + - [`.parse`](#parse) + - [`.parseAsync`](#parseasync) + - [`.safeParse`](#safeparse) + - [`.safeParseAsync`](#safeparseasync) + - [`.refine`](#refine) + - [Arguments](#arguments) + - [Customize error path](#customize-error-path) + - [Asynchronous refinements](#asynchronous-refinements) + - [Relationship to transforms](#relationship-to-transforms) + - [`.superRefine`](#superrefine) + - [Abort early](#abort-early) + - [Type refinements](#type-refinements) + - [`.transform`](#transform) + - [Chaining order](#chaining-order) + - [Validating during transform](#validating-during-transform) + - [Relationship to refinements](#relationship-to-refinements) + - [Async transforms](#async-transforms) + - [`.default`](#default) + - [`.describe`](#describe) + - [`.catch`](#catch) + - [`.optional`](#optional) + - [`.nullable`](#nullable) + - [`.nullish`](#nullish) + - [`.array`](#array) + - [`.promise`](#promise) + - [`.or`](#or) + - [`.and`](#and) + - [`.brand`](#brand) + - [`.readonly`](#readonly) + - [`.pipe`](#pipe) + - [You can use `.pipe()` to fix common issues with `z.coerce`.](#you-can-use-pipe-to-fix-common-issues-with-zcoerce) +- [Guides and concepts](#guides-and-concepts) + - [Type inference](#type-inference) + - [Writing generic functions](#writing-generic-functions) + - [Constraining allowable inputs](#constraining-allowable-inputs) + - [Error handling](#error-handling) + - [Error formatting](#error-formatting) +- [Comparison](#comparison) + - [Joi](#joi) + - [Yup](#yup) + - [io-ts](#io-ts) + - [Runtypes](#runtypes) + - [Ow](#ow) +- [Changelog](#changelog) + +## Introduction + +Zod is a TypeScript-first schema declaration and validation library. I'm using the term "schema" to broadly refer to any data type, from a simple `string` to a complex nested object. + +Zod is designed to be as developer-friendly as possible. The goal is to eliminate duplicative type declarations. With Zod, you declare a validator _once_ and Zod will automatically infer the static TypeScript type. It's easy to compose simpler types into complex data structures. + +Some other great aspects: + +- Zero dependencies +- Works in Node.js and all modern browsers +- Tiny: 8kb minified + zipped +- Immutable: methods (e.g. `.optional()`) return a new instance +- Concise, chainable interface +- Functional approach: [parse, don't validate](https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-validate/) +- Works with plain JavaScript too! You don't need to use TypeScript. + +### Sponsors + +Sponsorship at any level is appreciated and encouraged. For individual developers, consider the [Cup of Coffee tier](https://github.com/sponsors/colinhacks). If you built a paid product using Zod, consider one of the [podium tiers](https://github.com/sponsors/colinhacks). + +#### Platinum + +> [Email me](mailto:colin@colinhacks.com) to discuss sponsoring Zod at this level. + + + +#### Gold + + + + + + + + + + + + + + + + + + + + +
+ Cerbos +
+ Cerbos +
+ Scalar.com logo +
+ Scalar +
+ Speakeasy API +
+ Speakeasy +
+ Deletype logo +
+ Deletype +
+ Trigger.dev logo +
+ Trigger.dev +
+ Transloadit logo +
+ Transloadit +
+ Infisical logo +
+ Infisical +
+ Whop logo +
+ Whop +
+ CryptoJobsList logo +
+ CryptoJobsList +
+ Plain logo +
+ Plain. +
+ Inngest logo +
+ Inngest +
+ Storyblok CMS +
+ Storyblok +
+ Mux logo +
+ Mux +
+ @emreb +
+ @emreb +
+ +#### Silver + + + + + + + + + +
+ + Numeric logo + + + + Marcato Partners + + + + + + + + + + + + Bamboo Creative logo + +
+ +#### Bronze + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Brandon BayerJiří BrabecAlex JohanssonFungible Systems
AdaptableAvana WalletJason LengstorfGlobal Illumination, Inc.
MasterBornRyan PalmerMichael SweeneyNextbase
RemotionConnor SinnottMohammad-Ali A'râbiSupatool
Social Crow
+ +### Ecosystem + +There are a growing number of tools that are built atop or support Zod natively! If you've built a tool or library on top of Zod, tell me about it [on Twitter](https://twitter.com/colinhacks) or [start a Discussion](https://github.com/colinhacks/zod/discussions). I'll add it below and tweet it out. + +#### Resources + +- [Total TypeScript Zod Tutorial](https://www.totaltypescript.com/tutorials/zod) by [@mattpocockuk](https://twitter.com/mattpocockuk) +- [Fixing TypeScript's Blindspot: Runtime Typechecking](https://www.youtube.com/watch?v=rY_XqfSHock) by [@jherr](https://twitter.com/jherr) + +#### API libraries + +- [`tRPC`](https://github.com/trpc/trpc): Build end-to-end typesafe APIs without GraphQL. +- [`@anatine/zod-nestjs`](https://github.com/anatine/zod-plugins/tree/main/packages/zod-nestjs): Helper methods for using Zod in a NestJS project. +- [`zod-endpoints`](https://github.com/flock-community/zod-endpoints): Contract-first strictly typed endpoints with Zod. OpenAPI compatible. +- [`zhttp`](https://github.com/evertdespiegeleer/zhttp): An OpenAPI compatible, strictly typed http library with Zod input and response validation. +- [`domain-functions`](https://github.com/SeasonedSoftware/domain-functions/): Decouple your business logic from your framework using composable functions. With first-class type inference from end to end powered by Zod schemas. +- [`@zodios/core`](https://github.com/ecyrbe/zodios): A typescript API client with runtime and compile time validation backed by axios and zod. +- [`express-zod-api`](https://github.com/RobinTail/express-zod-api): Build Express-based APIs with I/O schema validation and custom middlewares. +- [`tapiduck`](https://github.com/sumukhbarve/monoduck/blob/main/src/tapiduck/README.md): End-to-end typesafe JSON APIs with Zod and Express; a bit like tRPC, but simpler. +- [`koa-zod-router`](https://github.com/JakeFenley/koa-zod-router): Create typesafe routes in Koa with I/O validation using Zod. + +#### Form integrations + +- [`react-hook-form`](https://github.com/react-hook-form/resolvers#zod): A first-party Zod resolver for React Hook Form. +- [`zod-validation-error`](https://github.com/causaly/zod-validation-error): Generate user-friendly error messages from `ZodError`s. +- [`zod-formik-adapter`](https://github.com/robertLichtnow/zod-formik-adapter): A community-maintained Formik adapter for Zod. +- [`react-zorm`](https://github.com/esamattis/react-zorm): Standalone `
` generation and validation for React using Zod. +- [`zodix`](https://github.com/rileytomasek/zodix): Zod utilities for FormData and URLSearchParams in Remix loaders and actions. +- [`conform`](https://conform.guide/api/zod/parseWithZod): A typesafe form validation library for progressive enhancement of HTML forms. Works with Remix and Next.js. +- [`remix-params-helper`](https://github.com/kiliman/remix-params-helper): Simplify integration of Zod with standard URLSearchParams and FormData for Remix apps. +- [`formik-validator-zod`](https://github.com/glazy/formik-validator-zod): Formik-compliant validator library that simplifies using Zod with Formik. +- [`zod-i18n-map`](https://github.com/aiji42/zod-i18n): Useful for translating Zod error messages. +- [`@modular-forms/solid`](https://github.com/fabian-hiller/modular-forms): Modular form library for SolidJS that supports Zod for validation. +- [`houseform`](https://github.com/crutchcorn/houseform/): A React form library that uses Zod for validation. +- [`sveltekit-superforms`](https://github.com/ciscoheat/sveltekit-superforms): Supercharged form library for SvelteKit with Zod validation. +- [`mobx-zod-form`](https://github.com/MonoidDev/mobx-zod-form): Data-first form builder based on MobX & Zod. +- [`@vee-validate/zod`](https://github.com/logaretm/vee-validate/tree/main/packages/zod): Form library for Vue.js with Zod schema validation. + +#### Zod to X + +- [`zod-to-ts`](https://github.com/sachinraja/zod-to-ts): Generate TypeScript definitions from Zod schemas. +- [`zod-to-json-schema`](https://github.com/StefanTerdell/zod-to-json-schema): Convert your Zod schemas into [JSON Schemas](https://json-schema.org/). +- [`@anatine/zod-openapi`](https://github.com/anatine/zod-plugins/tree/main/packages/zod-openapi): Converts a Zod schema to an OpenAPI v3.x `SchemaObject`. +- [`zod-fast-check`](https://github.com/DavidTimms/zod-fast-check): Generate `fast-check` arbitraries from Zod schemas. +- [`zod-dto`](https://github.com/kbkk/abitia/tree/master/packages/zod-dto): Generate Nest.js DTOs from a Zod schema. +- [`fastify-type-provider-zod`](https://github.com/turkerdev/fastify-type-provider-zod): Create Fastify type providers from Zod schemas. +- [`zod-to-openapi`](https://github.com/asteasolutions/zod-to-openapi): Generate full OpenAPI (Swagger) docs from Zod, including schemas, endpoints & parameters. +- [`nestjs-graphql-zod`](https://github.com/incetarik/nestjs-graphql-zod): Generates NestJS GraphQL model classes from Zod schemas. Provides GraphQL method decorators working with Zod schemas. +- [`zod-openapi`](https://github.com/samchungy/zod-openapi): Create full OpenAPI v3.x documentation from Zod schemas. +- [`fastify-zod-openapi`](https://github.com/samchungy/fastify-zod-openapi): Fastify type provider, validation, serialization and @fastify/swagger support for Zod schemas. +- [`typeschema`](https://typeschema.com/): Universal adapter for schema validation. + +#### X to Zod + +- [`ts-to-zod`](https://github.com/fabien0102/ts-to-zod): Convert TypeScript definitions into Zod schemas. +- [`@runtyping/zod`](https://github.com/johngeorgewright/runtyping/tree/master/packages/zod): Generate Zod from static types & JSON schema. +- [`json-schema-to-zod`](https://github.com/StefanTerdell/json-schema-to-zod): Convert your [JSON Schemas](https://json-schema.org/) into Zod schemas. [Live demo](https://StefanTerdell.github.io/json-schema-to-zod-react/). +- [`json-to-zod`](https://github.com/rsinohara/json-to-zod): Convert JSON objects into Zod schemas. [Live demo](https://rsinohara.github.io/json-to-zod-react/). +- [`graphql-codegen-typescript-validation-schema`](https://github.com/Code-Hex/graphql-codegen-typescript-validation-schema): GraphQL Code Generator plugin to generate form validation schema from your GraphQL schema. +- [`zod-prisma`](https://github.com/CarterGrimmeisen/zod-prisma): Generate Zod schemas from your Prisma schema. +- [`Supervillain`](https://github.com/Southclaws/supervillain): Generate Zod schemas from your Go structs. +- [`prisma-zod-generator`](https://github.com/omar-dulaimi/prisma-zod-generator): Emit Zod schemas from your Prisma schema. +- [`prisma-trpc-generator`](https://github.com/omar-dulaimi/prisma-trpc-generator): Emit fully implemented tRPC routers and their validation schemas using Zod. +- [`zod-prisma-types`](https://github.com/chrishoermann/zod-prisma-types) Create Zod types from your Prisma models. +- [`quicktype`](https://app.quicktype.io/): Convert JSON objects and JSON schemas into Zod schemas. +- [`@sanity-typed/zod`](https://github.com/saiichihashimoto/sanity-typed/tree/main/packages/zod): Generate Zod Schemas from [Sanity Schemas](https://www.sanity.io/docs/schema-types). +- [`java-to-zod`](https://github.com/ivangreene/java-to-zod): Convert POJOs to Zod schemas +- [`Orval`](https://github.com/anymaniax/orval): Generate Zod schemas from OpenAPI schemas + +#### Mocking + +- [`@anatine/zod-mock`](https://github.com/anatine/zod-plugins/tree/main/packages/zod-mock): Generate mock data from a Zod schema. Powered by [faker.js](https://github.com/faker-js/faker). +- [`zod-mocking`](https://github.com/dipasqualew/zod-mocking): Generate mock data from your Zod schemas. +- [`zod-fixture`](https://github.com/timdeschryver/zod-fixture): Use your zod schemas to automate the generation of non-relevant test fixtures in a deterministic way. +- [`zocker`](https://zocker.sigrist.dev): Generate plausible mock-data from your schemas. +- [`zodock`](https://github.com/ItMaga/zodock) Generate mock data based on Zod schemas. + +#### Powered by Zod + +- [`freerstore`](https://github.com/JacobWeisenburger/freerstore): Firestore cost optimizer. +- [`slonik`](https://github.com/gajus/slonik/tree/gajus/add-zod-validation-backwards-compatible#runtime-validation-and-static-type-inference): Node.js Postgres client with strong Zod integration. +- [`soly`](https://github.com/mdbetancourt/soly): Create CLI applications with zod. +- [`pastel`](https://github.com/vadimdemedes/pastel): Create CLI applications with react, zod, and ink. +- [`zod-xlsx`](https://github.com/sidwebworks/zod-xlsx): A xlsx based resource validator using Zod schemas. +- [`znv`](https://github.com/lostfictions/znv): Type-safe environment parsing and validation for Node.js with Zod schemas. +- [`zod-config`](https://github.com/alexmarqs/zod-config): Load configurations across multiple sources with flexible adapters, ensuring type safety with Zod. + +#### Utilities for Zod + +- [`zod_utilz`](https://github.com/JacobWeisenburger/zod_utilz): Framework agnostic utilities for Zod. +- [`zod-playground`](https://github.com/marilari88/zod-playground): A tool for learning and testing Zod schema validation functionalities. [Link](https://zod-playground.vercel.app/). +- [`zod-sandbox`](https://github.com/nereumelo/zod-sandbox): Controlled environment for testing zod schemas. [Live demo](https://zod-sandbox.vercel.app/). +- [`zod-dev`](https://github.com/schalkventer/zod-dev): Conditionally disables Zod runtime parsing in production. +- [`zod-accelerator`](https://github.com/duplojs/duplojs-zod-accelerator): Accelerates Zod's throughput up to ~100x. + +## Installation + +### Requirements + +- TypeScript 4.5+! +- You must enable `strict` mode in your `tsconfig.json`. This is a best practice for all TypeScript projects. + + ```ts + // tsconfig.json + { + // ... + "compilerOptions": { + // ... + "strict": true + } + } + ``` + +### From `npm` (Node/Bun) + +```sh +npm install zod # npm +yarn add zod # yarn +bun add zod # bun +pnpm add zod # pnpm +``` + +Zod also publishes a canary version on every commit. To install the canary: + +```sh +npm install zod@canary # npm +yarn add zod@canary # yarn +bun add zod@canary # bun +pnpm add zod@canary # pnpm +``` + +### From `deno.land/x` (Deno) + +Unlike Node, Deno relies on direct URL imports instead of a package manager like NPM. Zod is available on [deno.land/x](https://deno.land/x). The latest version can be imported like so: + +```ts +import { z } from "https://deno.land/x/zod/mod.ts"; +``` + +You can also specify a particular version: + +```ts +import { z } from "https://deno.land/x/zod@v3.16.1/mod.ts"; +``` + +> The rest of this README assumes you are using npm and importing directly from the `"zod"` package. + +## Basic usage + +Creating a simple string schema + +```ts +import { z } from "zod"; + +// creating a schema for strings +const mySchema = z.string(); + +// parsing +mySchema.parse("tuna"); // => "tuna" +mySchema.parse(12); // => throws ZodError + +// "safe" parsing (doesn't throw error if validation fails) +mySchema.safeParse("tuna"); // => { success: true; data: "tuna" } +mySchema.safeParse(12); // => { success: false; error: ZodError } +``` + +Creating an object schema + +```ts +import { z } from "zod"; + +const User = z.object({ + username: z.string(), +}); + +User.parse({ username: "Ludwig" }); + +// extract the inferred type +type User = z.infer; +// { username: string } +``` + +## Primitives + +```ts +import { z } from "zod"; + +// primitive values +z.string(); +z.number(); +z.bigint(); +z.boolean(); +z.date(); +z.symbol(); + +// empty types +z.undefined(); +z.null(); +z.void(); // accepts undefined + +// catch-all types +// allows any value +z.any(); +z.unknown(); + +// never type +// allows no values +z.never(); +``` + +## Coercion for primitives + +Zod now provides a more convenient way to coerce primitive values. + +```ts +const schema = z.coerce.string(); +schema.parse("tuna"); // => "tuna" +schema.parse(12); // => "12" +``` + +During the parsing step, the input is passed through the `String()` function, which is a JavaScript built-in for coercing data into strings. + +```ts +schema.parse(12); // => "12" +schema.parse(true); // => "true" +schema.parse(undefined); // => "undefined" +schema.parse(null); // => "null" +``` + +The returned schema is a normal `ZodString` instance so you can use all string methods. + +```ts +z.coerce.string().email().min(5); +``` + +**How coercion works** + +All primitive types support coercion. Zod coerces all inputs using the built-in constructors: `String(input)`, `Number(input)`, `new Date(input)`, etc. + +```ts +z.coerce.string(); // String(input) +z.coerce.number(); // Number(input) +z.coerce.boolean(); // Boolean(input) +z.coerce.bigint(); // BigInt(input) +z.coerce.date(); // new Date(input) +``` + +**Note** — Boolean coercion with `z.coerce.boolean()` may not work how you expect. Any [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy) value is coerced to `true`, and any [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy) value is coerced to `false`. + +```ts +const schema = z.coerce.boolean(); // Boolean(input) + +schema.parse("tuna"); // => true +schema.parse("true"); // => true +schema.parse("false"); // => true +schema.parse(1); // => true +schema.parse([]); // => true + +schema.parse(0); // => false +schema.parse(""); // => false +schema.parse(undefined); // => false +schema.parse(null); // => false +``` + +For more control over coercion logic, consider using [`z.preprocess`](#preprocess) or [`z.pipe()`](#pipe). + +## Literals + +Literal schemas represent a [literal type](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#literal-types), like `"hello world"` or `5`. + +```ts +const tuna = z.literal("tuna"); +const twelve = z.literal(12); +const twobig = z.literal(2n); // bigint literal +const tru = z.literal(true); + +const terrificSymbol = Symbol("terrific"); +const terrific = z.literal(terrificSymbol); + +// retrieve literal value +tuna.value; // "tuna" +``` + +> Currently there is no support for Date literals in Zod. If you have a use case for this feature, please file an issue. + +## Strings + +Zod includes a handful of string-specific validations. + +```ts +// validations +z.string().max(5); +z.string().min(5); +z.string().length(5); +z.string().email(); +z.string().url(); +z.string().emoji(); +z.string().uuid(); +z.string().nanoid(); +z.string().cuid(); +z.string().cuid2(); +z.string().ulid(); +z.string().regex(regex); +z.string().includes(string); +z.string().startsWith(string); +z.string().endsWith(string); +z.string().datetime(); // ISO 8601; by default only `Z` timezone allowed +z.string().ip(); // defaults to allow both IPv4 and IPv6 + +// transforms +z.string().trim(); // trim whitespace +z.string().toLowerCase(); // toLowerCase +z.string().toUpperCase(); // toUpperCase + +// added in Zod 3.23 +z.string().date(); // ISO date format (YYYY-MM-DD) +z.string().time(); // ISO time format (HH:mm:ss[.SSSSSS]) +z.string().duration(); // ISO 8601 duration +z.string().base64(); +``` + +> Check out [validator.js](https://github.com/validatorjs/validator.js) for a bunch of other useful string validation functions that can be used in conjunction with [Refinements](#refine). + +You can customize some common error messages when creating a string schema. + +```ts +const name = z.string({ + required_error: "Name is required", + invalid_type_error: "Name must be a string", +}); +``` + +When using validation methods, you can pass in an additional argument to provide a custom error message. + +```ts +z.string().min(5, { message: "Must be 5 or more characters long" }); +z.string().max(5, { message: "Must be 5 or fewer characters long" }); +z.string().length(5, { message: "Must be exactly 5 characters long" }); +z.string().email({ message: "Invalid email address" }); +z.string().url({ message: "Invalid url" }); +z.string().emoji({ message: "Contains non-emoji characters" }); +z.string().uuid({ message: "Invalid UUID" }); +z.string().includes("tuna", { message: "Must include tuna" }); +z.string().startsWith("https://", { message: "Must provide secure URL" }); +z.string().endsWith(".com", { message: "Only .com domains allowed" }); +z.string().datetime({ message: "Invalid datetime string! Must be UTC." }); +z.string().date({ message: "Invalid date string!" }); +z.string().time({ message: "Invalid time string!" }); +z.string().ip({ message: "Invalid IP address" }); +``` + +### Datetimes + +As you may have noticed, Zod string includes a few date/time related validations. These validations are regular expression based, so they are not as strict as a full date/time library. However, they are very convenient for validating user input. + +The `z.string().datetime()` method enforces ISO 8601; default is no timezone offsets and arbitrary sub-second decimal precision. + +```ts +const datetime = z.string().datetime(); + +datetime.parse("2020-01-01T00:00:00Z"); // pass +datetime.parse("2020-01-01T00:00:00.123Z"); // pass +datetime.parse("2020-01-01T00:00:00.123456Z"); // pass (arbitrary precision) +datetime.parse("2020-01-01T00:00:00+02:00"); // fail (no offsets allowed) +``` + +Timezone offsets can be allowed by setting the `offset` option to `true`. + +```ts +const datetime = z.string().datetime({ offset: true }); + +datetime.parse("2020-01-01T00:00:00+02:00"); // pass +datetime.parse("2020-01-01T00:00:00.123+02:00"); // pass (millis optional) +datetime.parse("2020-01-01T00:00:00.123+0200"); // pass (millis optional) +datetime.parse("2020-01-01T00:00:00.123+02"); // pass (only offset hours) +datetime.parse("2020-01-01T00:00:00Z"); // pass (Z still supported) +``` + +You can additionally constrain the allowable `precision`. By default, arbitrary sub-second precision is supported (but optional). + +```ts +const datetime = z.string().datetime({ precision: 3 }); + +datetime.parse("2020-01-01T00:00:00.123Z"); // pass +datetime.parse("2020-01-01T00:00:00Z"); // fail +datetime.parse("2020-01-01T00:00:00.123456Z"); // fail +``` + +### Dates + +> Added in Zod 3.23 + +The `z.string().date()` method validates strings in the format `YYYY-MM-DD`. + +```ts +const date = z.string().date(); + +date.parse("2020-01-01"); // pass +date.parse("2020-1-1"); // fail +date.parse("2020-01-32"); // fail +``` + +### Times + +> Added in Zod 3.23 + +The `z.string().time()` method validates strings in the format `HH:MM:SS[.s+]`. The second can include arbitrary decimal precision. It does not allow timezone offsets of any kind. + +```ts +const time = z.string().time(); + +time.parse("00:00:00"); // pass +time.parse("09:52:31"); // pass +time.parse("23:59:59.9999999"); // pass (arbitrary precision) + +time.parse("00:00:00.123Z"); // fail (no `Z` allowed) +time.parse("00:00:00.123+02:00"); // fail (no offsets allowed) +``` + +You can set the `precision` option to constrain the allowable decimal precision. + +```ts +const time = z.string().time({ precision: 3 }); + +time.parse("00:00:00.123"); // pass +time.parse("00:00:00.123456"); // fail +time.parse("00:00:00"); // fail +``` + +### IP addresses + +The `z.string().ip()` method by default validate IPv4 and IPv6. + +```ts +const ip = z.string().ip(); + +ip.parse("192.168.1.1"); // pass +ip.parse("84d5:51a0:9114:1855:4cfa:f2d7:1f12:7003"); // pass +ip.parse("84d5:51a0:9114:1855:4cfa:f2d7:1f12:192.168.1.1"); // pass + +ip.parse("256.1.1.1"); // fail +ip.parse("84d5:51a0:9114:gggg:4cfa:f2d7:1f12:7003"); // fail +``` + +You can additionally set the IP `version`. + +```ts +const ipv4 = z.string().ip({ version: "v4" }); +ipv4.parse("84d5:51a0:9114:1855:4cfa:f2d7:1f12:7003"); // fail + +const ipv6 = z.string().ip({ version: "v6" }); +ipv6.parse("192.168.1.1"); // fail +``` + +## Numbers + +You can customize certain error messages when creating a number schema. + +```ts +const age = z.number({ + required_error: "Age is required", + invalid_type_error: "Age must be a number", +}); +``` + +Zod includes a handful of number-specific validations. + +```ts +z.number().gt(5); +z.number().gte(5); // alias .min(5) +z.number().lt(5); +z.number().lte(5); // alias .max(5) + +z.number().int(); // value must be an integer + +z.number().positive(); // > 0 +z.number().nonnegative(); // >= 0 +z.number().negative(); // < 0 +z.number().nonpositive(); // <= 0 + +z.number().multipleOf(5); // Evenly divisible by 5. Alias .step(5) + +z.number().finite(); // value must be finite, not Infinity or -Infinity +z.number().safe(); // value must be between Number.MIN_SAFE_INTEGER and Number.MAX_SAFE_INTEGER +``` + +Optionally, you can pass in a second argument to provide a custom error message. + +```ts +z.number().lte(5, { message: "this👏is👏too👏big" }); +``` + +## BigInts + +Zod includes a handful of bigint-specific validations. + +```ts +z.bigint().gt(5n); +z.bigint().gte(5n); // alias `.min(5n)` +z.bigint().lt(5n); +z.bigint().lte(5n); // alias `.max(5n)` + +z.bigint().positive(); // > 0n +z.bigint().nonnegative(); // >= 0n +z.bigint().negative(); // < 0n +z.bigint().nonpositive(); // <= 0n + +z.bigint().multipleOf(5n); // Evenly divisible by 5n. +``` + +## NaNs + +You can customize certain error messages when creating a nan schema. + +```ts +const isNaN = z.nan({ + required_error: "isNaN is required", + invalid_type_error: "isNaN must be 'not a number'", +}); +``` + +## Booleans + +You can customize certain error messages when creating a boolean schema. + +```ts +const isActive = z.boolean({ + required_error: "isActive is required", + invalid_type_error: "isActive must be a boolean", +}); +``` + +## Dates + +Use z.date() to validate `Date` instances. + +```ts +z.date().safeParse(new Date()); // success: true +z.date().safeParse("2022-01-12T00:00:00.000Z"); // success: false +``` + +You can customize certain error messages when creating a date schema. + +```ts +const myDateSchema = z.date({ + required_error: "Please select a date and time", + invalid_type_error: "That's not a date!", +}); +``` + +Zod provides a handful of date-specific validations. + +```ts +z.date().min(new Date("1900-01-01"), { message: "Too old" }); +z.date().max(new Date(), { message: "Too young!" }); +``` + +**Coercion to Date** + +Since [zod 3.20](https://github.com/colinhacks/zod/releases/tag/v3.20), use [`z.coerce.date()`](#coercion-for-primitives) to pass the input through `new Date(input)`. + +```ts +const dateSchema = z.coerce.date(); +type DateSchema = z.infer; +// type DateSchema = Date + +/* valid dates */ +console.log(dateSchema.safeParse("2023-01-10T00:00:00.000Z").success); // true +console.log(dateSchema.safeParse("2023-01-10").success); // true +console.log(dateSchema.safeParse("1/10/23").success); // true +console.log(dateSchema.safeParse(new Date("1/10/23")).success); // true + +/* invalid dates */ +console.log(dateSchema.safeParse("2023-13-10").success); // false +console.log(dateSchema.safeParse("0000-00-00").success); // false +``` + +For older zod versions, use [`z.preprocess`](#preprocess) like [described in this thread](https://github.com/colinhacks/zod/discussions/879#discussioncomment-2036276). + +## Zod enums + +```ts +const FishEnum = z.enum(["Salmon", "Tuna", "Trout"]); +type FishEnum = z.infer; +// 'Salmon' | 'Tuna' | 'Trout' +``` + +`z.enum` is a Zod-native way to declare a schema with a fixed set of allowable _string_ values. Pass the array of values directly into `z.enum()`. Alternatively, use `as const` to define your enum values as a tuple of strings. See the [const assertion docs](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-4.html#const-assertions) for details. + +```ts +const VALUES = ["Salmon", "Tuna", "Trout"] as const; +const FishEnum = z.enum(VALUES); +``` + +This is not allowed, since Zod isn't able to infer the exact values of each element. + +```ts +const fish = ["Salmon", "Tuna", "Trout"]; +const FishEnum = z.enum(fish); +``` + +**`.enum`** + +To get autocompletion with a Zod enum, use the `.enum` property of your schema: + +```ts +FishEnum.enum.Salmon; // => autocompletes + +FishEnum.enum; +/* +=> { + Salmon: "Salmon", + Tuna: "Tuna", + Trout: "Trout", +} +*/ +``` + +You can also retrieve the list of options as a tuple with the `.options` property: + +```ts +FishEnum.options; // ["Salmon", "Tuna", "Trout"]; +``` + +**`.exclude/.extract()`** + +You can create subsets of a Zod enum with the `.exclude` and `.extract` methods. + +```ts +const FishEnum = z.enum(["Salmon", "Tuna", "Trout"]); +const SalmonAndTrout = FishEnum.extract(["Salmon", "Trout"]); +const TunaOnly = FishEnum.exclude(["Salmon", "Trout"]); +``` + +## Native enums + +Zod enums are the recommended approach to defining and validating enums. But if you need to validate against an enum from a third-party library (or you don't want to rewrite your existing enums) you can use `z.nativeEnum()`. + +**Numeric enums** + +```ts +enum Fruits { + Apple, + Banana, +} + +const FruitEnum = z.nativeEnum(Fruits); +type FruitEnum = z.infer; // Fruits + +FruitEnum.parse(Fruits.Apple); // passes +FruitEnum.parse(Fruits.Banana); // passes +FruitEnum.parse(0); // passes +FruitEnum.parse(1); // passes +FruitEnum.parse(3); // fails +``` + +**String enums** + +```ts +enum Fruits { + Apple = "apple", + Banana = "banana", + Cantaloupe, // you can mix numerical and string enums +} + +const FruitEnum = z.nativeEnum(Fruits); +type FruitEnum = z.infer; // Fruits + +FruitEnum.parse(Fruits.Apple); // passes +FruitEnum.parse(Fruits.Cantaloupe); // passes +FruitEnum.parse("apple"); // passes +FruitEnum.parse("banana"); // passes +FruitEnum.parse(0); // passes +FruitEnum.parse("Cantaloupe"); // fails +``` + +**Const enums** + +The `.nativeEnum()` function works for `as const` objects as well. ⚠️ `as const` requires TypeScript 3.4+! + +```ts +const Fruits = { + Apple: "apple", + Banana: "banana", + Cantaloupe: 3, +} as const; + +const FruitEnum = z.nativeEnum(Fruits); +type FruitEnum = z.infer; // "apple" | "banana" | 3 + +FruitEnum.parse("apple"); // passes +FruitEnum.parse("banana"); // passes +FruitEnum.parse(3); // passes +FruitEnum.parse("Cantaloupe"); // fails +``` + +You can access the underlying object with the `.enum` property: + +```ts +FruitEnum.enum.Apple; // "apple" +``` + +## Optionals + +You can make any schema optional with `z.optional()`. This wraps the schema in a `ZodOptional` instance and returns the result. + +```ts +const schema = z.optional(z.string()); + +schema.parse(undefined); // => returns undefined +type A = z.infer; // string | undefined +``` + +For convenience, you can also call the `.optional()` method on an existing schema. + +```ts +const user = z.object({ + username: z.string().optional(), +}); +type C = z.infer; // { username?: string | undefined }; +``` + +You can extract the wrapped schema from a `ZodOptional` instance with `.unwrap()`. + +```ts +const stringSchema = z.string(); +const optionalString = stringSchema.optional(); +optionalString.unwrap() === stringSchema; // true +``` + +## Nullables + +Similarly, you can create nullable types with `z.nullable()`. + +```ts +const nullableString = z.nullable(z.string()); +nullableString.parse("asdf"); // => "asdf" +nullableString.parse(null); // => null +``` + +Or use the `.nullable()` method. + +```ts +const E = z.string().nullable(); // equivalent to nullableString +type E = z.infer; // string | null +``` + +Extract the inner schema with `.unwrap()`. + +```ts +const stringSchema = z.string(); +const nullableString = stringSchema.nullable(); +nullableString.unwrap() === stringSchema; // true +``` + +## Objects + +```ts +// all properties are required by default +const Dog = z.object({ + name: z.string(), + age: z.number(), +}); + +// extract the inferred type like this +type Dog = z.infer; + +// equivalent to: +type Dog = { + name: string; + age: number; +}; +``` + +### `.shape` + +Use `.shape` to access the schemas for a particular key. + +```ts +Dog.shape.name; // => string schema +Dog.shape.age; // => number schema +``` + +### `.keyof` + +Use `.keyof` to create a `ZodEnum` schema from the keys of an object schema. + +```ts +const keySchema = Dog.keyof(); +keySchema; // ZodEnum<["name", "age"]> +``` + +### `.extend` + +You can add additional fields to an object schema with the `.extend` method. + +```ts +const DogWithBreed = Dog.extend({ + breed: z.string(), +}); +``` + +You can use `.extend` to overwrite fields! Be careful with this power! + +### `.merge` + +Equivalent to `A.extend(B.shape)`. + +```ts +const BaseTeacher = z.object({ students: z.array(z.string()) }); +const HasID = z.object({ id: z.string() }); + +const Teacher = BaseTeacher.merge(HasID); +type Teacher = z.infer; // => { students: string[], id: string } +``` + +> If the two schemas share keys, the properties of B overrides the property of A. The returned schema also inherits the "unknownKeys" policy (strip/strict/passthrough) and the catchall schema of B. + +### `.pick/.omit` + +Inspired by TypeScript's built-in `Pick` and `Omit` utility types, all Zod object schemas have `.pick` and `.omit` methods that return a modified version. Consider this Recipe schema: + +```ts +const Recipe = z.object({ + id: z.string(), + name: z.string(), + ingredients: z.array(z.string()), +}); +``` + +To only keep certain keys, use `.pick` . + +```ts +const JustTheName = Recipe.pick({ name: true }); +type JustTheName = z.infer; +// => { name: string } +``` + +To remove certain keys, use `.omit` . + +```ts +const NoIDRecipe = Recipe.omit({ id: true }); + +type NoIDRecipe = z.infer; +// => { name: string, ingredients: string[] } +``` + +### `.partial` + +Inspired by the built-in TypeScript utility type [Partial](https://www.typescriptlang.org/docs/handbook/utility-types.html#partialtype), the `.partial` method makes all properties optional. + +Starting from this object: + +```ts +const user = z.object({ + email: z.string(), + username: z.string(), +}); +// { email: string; username: string } +``` + +We can create a partial version: + +```ts +const partialUser = user.partial(); +// { email?: string | undefined; username?: string | undefined } +``` + +You can also specify which properties to make optional: + +```ts +const optionalEmail = user.partial({ + email: true, +}); +/* +{ + email?: string | undefined; + username: string +} +*/ +``` + +### `.deepPartial` + +The `.partial` method is shallow — it only applies one level deep. There is also a "deep" version: + +```ts +const user = z.object({ + username: z.string(), + location: z.object({ + latitude: z.number(), + longitude: z.number(), + }), + strings: z.array(z.object({ value: z.string() })), +}); + +const deepPartialUser = user.deepPartial(); + +/* +{ + username?: string | undefined, + location?: { + latitude?: number | undefined; + longitude?: number | undefined; + } | undefined, + strings?: { value?: string}[] +} +*/ +``` + +> Important limitation: deep partials only work as expected in hierarchies of objects, arrays, and tuples. + +### `.required` + +Contrary to the `.partial` method, the `.required` method makes all properties required. + +Starting from this object: + +```ts +const user = z + .object({ + email: z.string(), + username: z.string(), + }) + .partial(); +// { email?: string | undefined; username?: string | undefined } +``` + +We can create a required version: + +```ts +const requiredUser = user.required(); +// { email: string; username: string } +``` + +You can also specify which properties to make required: + +```ts +const requiredEmail = user.required({ + email: true, +}); +/* +{ + email: string; + username?: string | undefined; +} +*/ +``` + +### `.passthrough` + +By default Zod object schemas strip out unrecognized keys during parsing. + +```ts +const person = z.object({ + name: z.string(), +}); + +person.parse({ + name: "bob dylan", + extraKey: 61, +}); +// => { name: "bob dylan" } +// extraKey has been stripped +``` + +Instead, if you want to pass through unknown keys, use `.passthrough()` . + +```ts +person.passthrough().parse({ + name: "bob dylan", + extraKey: 61, +}); +// => { name: "bob dylan", extraKey: 61 } +``` + +### `.strict` + +By default Zod object schemas strip out unrecognized keys during parsing. You can _disallow_ unknown keys with `.strict()` . If there are any unknown keys in the input, Zod will throw an error. + +```ts +const person = z + .object({ + name: z.string(), + }) + .strict(); + +person.parse({ + name: "bob dylan", + extraKey: 61, +}); +// => throws ZodError +``` + +### `.strip` + +You can use the `.strip` method to reset an object schema to the default behavior (stripping unrecognized keys). + +### `.catchall` + +You can pass a "catchall" schema into an object schema. All unknown keys will be validated against it. + +```ts +const person = z + .object({ + name: z.string(), + }) + .catchall(z.number()); + +person.parse({ + name: "bob dylan", + validExtraKey: 61, // works fine +}); + +person.parse({ + name: "bob dylan", + validExtraKey: false, // fails +}); +// => throws ZodError +``` + +Using `.catchall()` obviates `.passthrough()` , `.strip()` , or `.strict()`. All keys are now considered "known". + +## Arrays + +```ts +const stringArray = z.array(z.string()); + +// equivalent +const stringArray = z.string().array(); +``` + +Be careful with the `.array()` method. It returns a new `ZodArray` instance. This means the _order_ in which you call methods matters. For instance: + +```ts +z.string().optional().array(); // (string | undefined)[] +z.string().array().optional(); // string[] | undefined +``` + +### `.element` + +Use `.element` to access the schema for an element of the array. + +```ts +stringArray.element; // => string schema +``` + +### `.nonempty` + +If you want to ensure that an array contains at least one element, use `.nonempty()`. + +```ts +const nonEmptyStrings = z.string().array().nonempty(); +// the inferred type is now +// [string, ...string[]] + +nonEmptyStrings.parse([]); // throws: "Array cannot be empty" +nonEmptyStrings.parse(["Ariana Grande"]); // passes +``` + +You can optionally specify a custom error message: + +```ts +// optional custom error message +const nonEmptyStrings = z.string().array().nonempty({ + message: "Can't be empty!", +}); +``` + +### `.min/.max/.length` + +```ts +z.string().array().min(5); // must contain 5 or more items +z.string().array().max(5); // must contain 5 or fewer items +z.string().array().length(5); // must contain 5 items exactly +``` + +Unlike `.nonempty()` these methods do not change the inferred type. + +## Tuples + +Unlike arrays, tuples have a fixed number of elements and each element can have a different type. + +```ts +const athleteSchema = z.tuple([ + z.string(), // name + z.number(), // jersey number + z.object({ + pointsScored: z.number(), + }), // statistics +]); + +type Athlete = z.infer; +// type Athlete = [string, number, { pointsScored: number }] +``` + +A variadic ("rest") argument can be added with the `.rest` method. + +```ts +const variadicTuple = z.tuple([z.string()]).rest(z.number()); +const result = variadicTuple.parse(["hello", 1, 2, 3]); +// => [string, ...number[]]; +``` + +## Unions + +Zod includes a built-in `z.union` method for composing "OR" types. + +```ts +const stringOrNumber = z.union([z.string(), z.number()]); + +stringOrNumber.parse("foo"); // passes +stringOrNumber.parse(14); // passes +``` + +Zod will test the input against each of the "options" in order and return the first value that validates successfully. + +For convenience, you can also use the [`.or` method](#or): + +```ts +const stringOrNumber = z.string().or(z.number()); +``` + +**Optional string validation:** + +To validate an optional form input, you can union the desired string validation with an empty string [literal](#literals). + +This example validates an input that is optional but needs to contain a [valid URL](#strings): + +```ts +const optionalUrl = z.union([z.string().url().nullish(), z.literal("")]); + +console.log(optionalUrl.safeParse(undefined).success); // true +console.log(optionalUrl.safeParse(null).success); // true +console.log(optionalUrl.safeParse("").success); // true +console.log(optionalUrl.safeParse("https://zod.dev").success); // true +console.log(optionalUrl.safeParse("not a valid url").success); // false +``` + +## Discriminated unions + +A discriminated union is a union of object schemas that all share a particular key. + +```ts +type MyUnion = + | { status: "success"; data: string } + | { status: "failed"; error: Error }; +``` + +Such unions can be represented with the `z.discriminatedUnion` method. This enables faster evaluation, because Zod can check the _discriminator key_ (`status` in the example above) to determine which schema should be used to parse the input. This makes parsing more efficient and lets Zod report friendlier errors. + +With the basic union method, the input is tested against each of the provided "options", and in the case of invalidity, issues for all the "options" are shown in the zod error. On the other hand, the discriminated union allows for selecting just one of the "options", testing against it, and showing only the issues related to this "option". + +```ts +const myUnion = z.discriminatedUnion("status", [ + z.object({ status: z.literal("success"), data: z.string() }), + z.object({ status: z.literal("failed"), error: z.instanceof(Error) }), +]); + +myUnion.parse({ status: "success", data: "yippie ki yay" }); +``` + +You can extract a reference to the array of schemas with the `.options` property. + +```ts +myUnion.options; // [ZodObject<...>, ZodObject<...>] +``` + +To merge two or more discriminated unions, use `.options` with destructuring. + +```ts +const A = z.discriminatedUnion("status", [ + /* options */ +]); +const B = z.discriminatedUnion("status", [ + /* options */ +]); + +const AB = z.discriminatedUnion("status", [...A.options, ...B.options]); +``` + +## Records + +Record schemas are used to validate types such as `Record`. This is particularly useful for storing or caching items by ID. + + + +```ts +const User = z.object({ name: z.string() }); + +const UserStore = z.record(z.string(), User); +type UserStore = z.infer; +// => Record +``` + +The schema and inferred type can be used like so: + +```ts +const userStore: UserStore = {}; + +userStore["77d2586b-9e8e-4ecf-8b21-ea7e0530eadd"] = { + name: "Carlotta", +}; // passes + +userStore["77d2586b-9e8e-4ecf-8b21-ea7e0530eadd"] = { + whatever: "Ice cream sundae", +}; // TypeError +``` + +**A note on numerical keys** + +While `z.record(keyType, valueType)` is able to accept numerical key types and TypeScript's built-in Record type is `Record`, it's hard to represent the TypeScript type `Record` in Zod. + +As it turns out, TypeScript's behavior surrounding `[k: number]` is a little unintuitive: + +```ts +const testMap: { [k: number]: string } = { + 1: "one", +}; + +for (const key in testMap) { + console.log(`${key}: ${typeof key}`); +} +// prints: `1: string` +``` + +As you can see, JavaScript automatically casts all object keys to strings under the hood. Since Zod is trying to bridge the gap between static and runtime types, it doesn't make sense to provide a way of creating a record schema with numerical keys, since there's no such thing as a numerical key in runtime JavaScript. + +## Maps + +```ts +const stringNumberMap = z.map(z.string(), z.number()); + +type StringNumberMap = z.infer; +// type StringNumberMap = Map +``` + +## Sets + +```ts +const numberSet = z.set(z.number()); +type NumberSet = z.infer; +// type NumberSet = Set +``` + +Set schemas can be further constrained with the following utility methods. + +```ts +z.set(z.string()).nonempty(); // must contain at least one item +z.set(z.string()).min(5); // must contain 5 or more items +z.set(z.string()).max(5); // must contain 5 or fewer items +z.set(z.string()).size(5); // must contain 5 items exactly +``` + +## Intersections + +Intersections are useful for creating "logical AND" types. This is useful for intersecting two object types. + +```ts +const Person = z.object({ + name: z.string(), +}); + +const Employee = z.object({ + role: z.string(), +}); + +const EmployedPerson = z.intersection(Person, Employee); + +// equivalent to: +const EmployedPerson = Person.and(Employee); +``` + +Though in many cases, it is recommended to use `A.merge(B)` to merge two objects. The `.merge` method returns a new `ZodObject` instance, whereas `A.and(B)` returns a less useful `ZodIntersection` instance that lacks common object methods like `pick` and `omit`. + +```ts +const a = z.union([z.number(), z.string()]); +const b = z.union([z.number(), z.boolean()]); +const c = z.intersection(a, b); + +type c = z.infer; // => number +``` + + + + + +## Recursive types + +You can define a recursive schema in Zod, but because of a limitation of TypeScript, their type can't be statically inferred. Instead you'll need to define the type definition manually, and provide it to Zod as a "type hint". + +```ts +const baseCategorySchema = z.object({ + name: z.string(), +}); + +type Category = z.infer & { + subcategories: Category[]; +}; + +const categorySchema: z.ZodType = baseCategorySchema.extend({ + subcategories: z.lazy(() => categorySchema.array()), +}); + +categorySchema.parse({ + name: "People", + subcategories: [ + { + name: "Politicians", + subcategories: [ + { + name: "Presidents", + subcategories: [], + }, + ], + }, + ], +}); // passes +``` + +Thanks to [crasite](https://github.com/crasite) for this example. + +### ZodType with ZodEffects + +When using `z.ZodType` with `z.ZodEffects` ( +[`.refine`](https://github.com/colinhacks/zod#refine), +[`.transform`](https://github.com/colinhacks/zod#transform), +[`preprocess`](https://github.com/colinhacks/zod#preprocess), +etc... +), you will need to define the input and output types of the schema. `z.ZodType` + +```ts +const isValidId = (id: string): id is `${string}/${string}` => + id.split("/").length === 2; + +const baseSchema = z.object({ + id: z.string().refine(isValidId), +}); + +type Input = z.input & { + children: Input[]; +}; + +type Output = z.output & { + children: Output[]; +}; + +const schema: z.ZodType = baseSchema.extend({ + children: z.lazy(() => schema.array()), +}); +``` + +Thanks to [marcus13371337](https://github.com/marcus13371337) and [JoelBeeldi](https://github.com/JoelBeeldi) for this example. + +### JSON type + +If you want to validate any JSON value, you can use the snippet below. + +```ts +const literalSchema = z.union([z.string(), z.number(), z.boolean(), z.null()]); +type Literal = z.infer; +type Json = Literal | { [key: string]: Json } | Json[]; +const jsonSchema: z.ZodType = z.lazy(() => + z.union([literalSchema, z.array(jsonSchema), z.record(jsonSchema)]) +); + +jsonSchema.parse(data); +``` + +Thanks to [ggoodman](https://github.com/ggoodman) for suggesting this. + +### Cyclical objects + +Despite supporting recursive schemas, passing cyclical data into Zod will cause an infinite loop in some cases. + +> To detect cyclical objects before they cause problems, consider [this approach](https://gist.github.com/colinhacks/d35825e505e635df27cc950776c5500b). + +## Promises + +```ts +const numberPromise = z.promise(z.number()); +``` + +"Parsing" works a little differently with promise schemas. Validation happens in two parts: + +1. Zod synchronously checks that the input is an instance of Promise (i.e. an object with `.then` and `.catch` methods.). +2. Zod uses `.then` to attach an additional validation step onto the existing Promise. You'll have to use `.catch` on the returned Promise to handle validation failures. + +```ts +numberPromise.parse("tuna"); +// ZodError: Non-Promise type: string + +numberPromise.parse(Promise.resolve("tuna")); +// => Promise + +const test = async () => { + await numberPromise.parse(Promise.resolve("tuna")); + // ZodError: Non-number type: string + + await numberPromise.parse(Promise.resolve(3.14)); + // => 3.14 +}; +``` + + + +## Instanceof + +You can use `z.instanceof` to check that the input is an instance of a class. This is useful to validate inputs against classes that are exported from third-party libraries. + +```ts +class Test { + name: string; +} + +const TestSchema = z.instanceof(Test); + +const blob: any = "whatever"; +TestSchema.parse(new Test()); // passes +TestSchema.parse(blob); // throws +``` + +## Functions + +Zod also lets you define "function schemas". This makes it easy to validate the inputs and outputs of a function without intermixing your validation code and "business logic". + +You can create a function schema with `z.function(args, returnType)` . + +```ts +const myFunction = z.function(); + +type myFunction = z.infer; +// => ()=>unknown +``` + +Define inputs and outputs. + +```ts +const myFunction = z + .function() + .args(z.string(), z.number()) // accepts an arbitrary number of arguments + .returns(z.boolean()); + +type myFunction = z.infer; +// => (arg0: string, arg1: number)=>boolean +``` + + + +Function schemas have an `.implement()` method which accepts a function and returns a new function that automatically validates its inputs and outputs. + +```ts +const trimmedLength = z + .function() + .args(z.string()) // accepts an arbitrary number of arguments + .returns(z.number()) + .implement((x) => { + // TypeScript knows x is a string! + return x.trim().length; + }); + +trimmedLength("sandwich"); // => 8 +trimmedLength(" asdf "); // => 4 +``` + +If you only care about validating inputs, just don't call the `.returns()` method. The output type will be inferred from the implementation. + +> You can use the special `z.void()` option if your function doesn't return anything. This will let Zod properly infer the type of void-returning functions. (Void-returning functions actually return undefined.) + +```ts +const myFunction = z + .function() + .args(z.string()) + .implement((arg) => { + return [arg.length]; + }); + +myFunction; // (arg: string)=>number[] +``` + +Extract the input and output schemas from a function schema. + +```ts +myFunction.parameters(); +// => ZodTuple<[ZodString, ZodNumber]> + +myFunction.returnType(); +// => ZodBoolean +``` + + + +## Preprocess + +> Zod now supports primitive coercion without the need for `.preprocess()`. See the [coercion docs](#coercion-for-primitives) for more information. + +Typically Zod operates under a "parse then transform" paradigm. Zod validates the input first, then passes it through a chain of transformation functions. (For more information about transforms, read the [.transform docs](#transform).) + +But sometimes you want to apply some transform to the input _before_ parsing happens. A common use case: type coercion. Zod enables this with the `z.preprocess()`. + +```ts +const castToString = z.preprocess((val) => String(val), z.string()); +``` + +This returns a `ZodEffects` instance. `ZodEffects` is a wrapper class that contains all logic pertaining to preprocessing, refinements, and transforms. + +## Custom schemas + +You can create a Zod schema for any TypeScript type by using `z.custom()`. This is useful for creating schemas for types that are not supported by Zod out of the box, such as template string literals. + +```ts +const px = z.custom<`${number}px`>((val) => { + return typeof val === "string" ? /^\d+px$/.test(val) : false; +}); + +type px = z.infer; // `${number}px` + +px.parse("42px"); // "42px" +px.parse("42vw"); // throws; +``` + +If you don't provide a validation function, Zod will allow any value. This can be dangerous! + +```ts +z.custom<{ arg: string }>(); // performs no validation +``` + +You can customize the error message and other options by passing a second argument. This parameter works the same way as the params parameter of [`.refine`](#refine). + +```ts +z.custom<...>((val) => ..., "custom error message"); +``` + +## Schema methods + +All Zod schemas contain certain methods. + +### `.parse` + +`.parse(data: unknown): T` + +Given any Zod schema, you can call its `.parse` method to check `data` is valid. If it is, a value is returned with full type information! Otherwise, an error is thrown. + +> IMPORTANT: The value returned by `.parse` is a _deep clone_ of the variable you passed in. + +```ts +const stringSchema = z.string(); + +stringSchema.parse("fish"); // => returns "fish" +stringSchema.parse(12); // throws error +``` + +### `.parseAsync` + +`.parseAsync(data:unknown): Promise` + +If you use asynchronous [refinements](#refine) or [transforms](#transform) (more on those later), you'll need to use `.parseAsync`. + +```ts +const stringSchema = z.string().refine(async (val) => val.length <= 8); + +await stringSchema.parseAsync("hello"); // => returns "hello" +await stringSchema.parseAsync("hello world"); // => throws error +``` + +### `.safeParse` + +`.safeParse(data:unknown): { success: true; data: T; } | { success: false; error: ZodError; }` + +If you don't want Zod to throw errors when validation fails, use `.safeParse`. This method returns an object containing either the successfully parsed data or a ZodError instance containing detailed information about the validation problems. + +```ts +stringSchema.safeParse(12); +// => { success: false; error: ZodError } + +stringSchema.safeParse("billie"); +// => { success: true; data: 'billie' } +``` + +The result is a _discriminated union_, so you can handle errors very conveniently: + +```ts +const result = stringSchema.safeParse("billie"); +if (!result.success) { + // handle error then return + result.error; +} else { + // do something + result.data; +} +``` + +### `.safeParseAsync` + +> Alias: `.spa` + +An asynchronous version of `safeParse`. + +```ts +await stringSchema.safeParseAsync("billie"); +``` + +For convenience, this has been aliased to `.spa`: + +```ts +await stringSchema.spa("billie"); +``` + +### `.refine` + +`.refine(validator: (data:T)=>any, params?: RefineParams)` + +Zod lets you provide custom validation logic via _refinements_. (For advanced features like creating multiple issues and customizing error codes, see [`.superRefine`](#superrefine).) + +Zod was designed to mirror TypeScript as closely as possible. But there are many so-called "refinement types" you may wish to check for that can't be represented in TypeScript's type system. For instance: checking that a number is an integer or that a string is a valid email address. + +For example, you can define a custom validation check on _any_ Zod schema with `.refine` : + +```ts +const myString = z.string().refine((val) => val.length <= 255, { + message: "String can't be more than 255 characters", +}); +``` + +> ⚠️ Refinement functions should not throw. Instead they should return a falsy value to signal failure. + +#### Arguments + +As you can see, `.refine` takes two arguments. + +1. The first is the validation function. This function takes one input (of type `T` — the inferred type of the schema) and returns `any`. Any truthy value will pass validation. (Prior to zod@1.6.2 the validation function had to return a boolean.) +2. The second argument accepts some options. You can use this to customize certain error-handling behavior: + +```ts +type RefineParams = { + // override error message + message?: string; + + // appended to error path + path?: (string | number)[]; + + // params object you can use to customize message + // in error map + params?: object; +}; +``` + +For advanced cases, the second argument can also be a function that returns `RefineParams`. + +```ts +const longString = z.string().refine( + (val) => val.length > 10, + (val) => ({ message: `${val} is not more than 10 characters` }) +); +``` + +#### Customize error path + +```ts +const passwordForm = z + .object({ + password: z.string(), + confirm: z.string(), + }) + .refine((data) => data.password === data.confirm, { + message: "Passwords don't match", + path: ["confirm"], // path of error + }); + +passwordForm.parse({ password: "asdf", confirm: "qwer" }); +``` + +Because you provided a `path` parameter, the resulting error will be: + +```ts +ZodError { + issues: [{ + "code": "custom", + "path": [ "confirm" ], + "message": "Passwords don't match" + }] +} +``` + +#### Asynchronous refinements + +Refinements can also be async: + +```ts +const userId = z.string().refine(async (id) => { + // verify that ID exists in database + return true; +}); +``` + +> ⚠️ If you use async refinements, you must use the `.parseAsync` method to parse data! Otherwise Zod will throw an error. + +#### Relationship to transforms + +Transforms and refinements can be interleaved: + +```ts +z.string() + .transform((val) => val.length) + .refine((val) => val > 25); +``` + + + +### `.superRefine` + +The `.refine` method is actually syntactic sugar atop a more versatile (and verbose) method called `superRefine`. Here's an example: + +```ts +const Strings = z.array(z.string()).superRefine((val, ctx) => { + if (val.length > 3) { + ctx.addIssue({ + code: z.ZodIssueCode.too_big, + maximum: 3, + type: "array", + inclusive: true, + message: "Too many items 😡", + }); + } + + if (val.length !== new Set(val).size) { + ctx.addIssue({ + code: z.ZodIssueCode.custom, + message: `No duplicates allowed.`, + }); + } +}); +``` + +You can add as many issues as you like. If `ctx.addIssue` is _not_ called during the execution of the function, validation passes. + +Normally refinements always create issues with a `ZodIssueCode.custom` error code, but with `superRefine` it's possible to throw issues of any `ZodIssueCode`. Each issue code is described in detail in the Error Handling guide: [ERROR_HANDLING.md](ERROR_HANDLING.md). + +#### Abort early + +By default, parsing will continue even after a refinement check fails. For instance, if you chain together multiple refinements, they will all be executed. However, it may be desirable to _abort early_ to prevent later refinements from being executed. To achieve this, pass the `fatal` flag to `ctx.addIssue` and return `z.NEVER`. + +```ts +const schema = z.number().superRefine((val, ctx) => { + if (val < 10) { + ctx.addIssue({ + code: z.ZodIssueCode.custom, + message: "should be >= 10", + fatal: true, + }); + + return z.NEVER; + } + + if (val !== 12) { + ctx.addIssue({ + code: z.ZodIssueCode.custom, + message: "should be twelve", + }); + } +}); +``` + +#### Type refinements + +If you provide a [type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) to `.refine()` or `.superRefine()`, the resulting type will be narrowed down to your predicate's type. This is useful if you are mixing multiple chained refinements and transformations: + +```ts +const schema = z + .object({ + first: z.string(), + second: z.number(), + }) + .nullable() + .superRefine((arg, ctx): arg is { first: string; second: number } => { + if (!arg) { + ctx.addIssue({ + code: z.ZodIssueCode.custom, // customize your issue + message: "object should exist", + }); + } + + return z.NEVER; // The return value is not used, but we need to return something to satisfy the typing + }) + // here, TS knows that arg is not null + .refine((arg) => arg.first === "bob", "`first` is not `bob`!"); +``` + +> ⚠️ You **must** use `ctx.addIssue()` instead of returning a boolean value to indicate whether the validation passes. If `ctx.addIssue` is _not_ called during the execution of the function, validation passes. + +### `.transform` + +To transform data after parsing, use the `transform` method. + +```ts +const stringToNumber = z.string().transform((val) => val.length); + +stringToNumber.parse("string"); // => 6 +``` + +#### Chaining order + +Note that `stringToNumber` above is an instance of the `ZodEffects` subclass. It is NOT an instance of `ZodString`. If you want to use the built-in methods of `ZodString` (e.g. `.email()`) you must apply those methods _before_ any transforms. + +```ts +const emailToDomain = z + .string() + .email() + .transform((val) => val.split("@")[1]); + +emailToDomain.parse("colinhacks@example.com"); // => example.com +``` + +#### Validating during transform + +The `.transform` method can simultaneously validate and transform the value. This is often simpler and less duplicative than chaining `transform` and `refine`. + +As with `.superRefine`, the transform function receives a `ctx` object with an `addIssue` method that can be used to register validation issues. + +```ts +const numberInString = z.string().transform((val, ctx) => { + const parsed = parseInt(val); + if (isNaN(parsed)) { + ctx.addIssue({ + code: z.ZodIssueCode.custom, + message: "Not a number", + }); + + // This is a special symbol you can use to + // return early from the transform function. + // It has type `never` so it does not affect the + // inferred return type. + return z.NEVER; + } + return parsed; +}); +``` + +#### Relationship to refinements + +Transforms and refinements can be interleaved. These will be executed in the order they are declared. + +```ts +const nameToGreeting = z + .string() + .transform((val) => val.toUpperCase()) + .refine((val) => val.length > 15) + .transform((val) => `Hello ${val}`) + .refine((val) => val.indexOf("!") === -1); +``` + +#### Async transforms + +Transforms can also be async. + +```ts +const IdToUser = z + .string() + .uuid() + .transform(async (id) => { + return await getUserById(id); + }); +``` + +> ⚠️ If your schema contains asynchronous transforms, you must use .parseAsync() or .safeParseAsync() to parse data. Otherwise Zod will throw an error. + +### `.default` + +You can use transforms to implement the concept of "default values" in Zod. + +```ts +const stringWithDefault = z.string().default("tuna"); + +stringWithDefault.parse(undefined); // => "tuna" +``` + +Optionally, you can pass a function into `.default` that will be re-executed whenever a default value needs to be generated: + +```ts +const numberWithRandomDefault = z.number().default(Math.random); + +numberWithRandomDefault.parse(undefined); // => 0.4413456736055323 +numberWithRandomDefault.parse(undefined); // => 0.1871840107401901 +numberWithRandomDefault.parse(undefined); // => 0.7223408162401552 +``` + +Conceptually, this is how Zod processes default values: + +1. If the input is `undefined`, the default value is returned +2. Otherwise, the data is parsed using the base schema + +### `.describe` + +Use `.describe()` to add a `description` property to the resulting schema. + +```ts +const documentedString = z + .string() + .describe("A useful bit of text, if you know what to do with it."); +documentedString.description; // A useful bit of text… +``` + +This can be useful for documenting a field, for example in a JSON Schema using a library like [`zod-to-json-schema`](https://github.com/StefanTerdell/zod-to-json-schema)). + +### `.catch` + +Use `.catch()` to provide a "catch value" to be returned in the event of a parsing error. + +```ts +const numberWithCatch = z.number().catch(42); + +numberWithCatch.parse(5); // => 5 +numberWithCatch.parse("tuna"); // => 42 +``` + +Optionally, you can pass a function into `.catch` that will be re-executed whenever a default value needs to be generated. A `ctx` object containing the caught error will be passed into this function. + +```ts +const numberWithRandomCatch = z.number().catch((ctx) => { + ctx.error; // the caught ZodError + return Math.random(); +}); + +numberWithRandomCatch.parse("sup"); // => 0.4413456736055323 +numberWithRandomCatch.parse("sup"); // => 0.1871840107401901 +numberWithRandomCatch.parse("sup"); // => 0.7223408162401552 +``` + +Conceptually, this is how Zod processes "catch values": + +1. The data is parsed using the base schema +2. If the parsing fails, the "catch value" is returned + +### `.optional` + +A convenience method that returns an optional version of a schema. + +```ts +const optionalString = z.string().optional(); // string | undefined + +// equivalent to +z.optional(z.string()); +``` + +### `.nullable` + +A convenience method that returns a nullable version of a schema. + +```ts +const nullableString = z.string().nullable(); // string | null + +// equivalent to +z.nullable(z.string()); +``` + +### `.nullish` + +A convenience method that returns a "nullish" version of a schema. Nullish schemas will accept both `undefined` and `null`. Read more about the concept of "nullish" [in the TypeScript 3.7 release notes](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#nullish-coalescing). + +```ts +const nullishString = z.string().nullish(); // string | null | undefined + +// equivalent to +z.string().nullable().optional(); +``` + +### `.array` + +A convenience method that returns an array schema for the given type: + +```ts +const stringArray = z.string().array(); // string[] + +// equivalent to +z.array(z.string()); +``` + +### `.promise` + +A convenience method for promise types: + +```ts +const stringPromise = z.string().promise(); // Promise + +// equivalent to +z.promise(z.string()); +``` + +### `.or` + +A convenience method for [union types](#unions). + +```ts +const stringOrNumber = z.string().or(z.number()); // string | number + +// equivalent to +z.union([z.string(), z.number()]); +``` + +### `.and` + +A convenience method for creating intersection types. + +```ts +const nameAndAge = z + .object({ name: z.string() }) + .and(z.object({ age: z.number() })); // { name: string } & { age: number } + +// equivalent to +z.intersection(z.object({ name: z.string() }), z.object({ age: z.number() })); +``` + +### `.brand` + +`.brand() => ZodBranded` + +TypeScript's type system is structural, which means that any two types that are structurally equivalent are considered the same. + +```ts +type Cat = { name: string }; +type Dog = { name: string }; + +const petCat = (cat: Cat) => {}; +const fido: Dog = { name: "fido" }; +petCat(fido); // works fine +``` + +In some cases, its can be desirable to simulate _nominal typing_ inside TypeScript. For instance, you may wish to write a function that only accepts an input that has been validated by Zod. This can be achieved with _branded types_ (AKA _opaque types_). + +```ts +const Cat = z.object({ name: z.string() }).brand<"Cat">(); +type Cat = z.infer; + +const petCat = (cat: Cat) => {}; + +// this works +const simba = Cat.parse({ name: "simba" }); +petCat(simba); + +// this doesn't +petCat({ name: "fido" }); +``` + +Under the hood, this works by attaching a "brand" to the inferred type using an intersection type. This way, plain/unbranded data structures are no longer assignable to the inferred type of the schema. + +```ts +const Cat = z.object({ name: z.string() }).brand<"Cat">(); +type Cat = z.infer; +// {name: string} & {[symbol]: "Cat"} +``` + +Note that branded types do not affect the runtime result of `.parse`. It is a static-only construct. + +### `.readonly` + +`.readonly() => ZodReadonly` + +This method returns a `ZodReadonly` schema instance that parses the input using the base schema, then calls `Object.freeze()` on the result. The inferred type is also marked as `readonly`. + +```ts +const schema = z.object({ name: z.string() }).readonly(); +type schema = z.infer; +// Readonly<{name: string}> + +const result = schema.parse({ name: "fido" }); +result.name = "simba"; // error +``` + +The inferred type uses TypeScript's built-in readonly types when relevant. + +```ts +z.array(z.string()).readonly(); +// readonly string[] + +z.tuple([z.string(), z.number()]).readonly(); +// readonly [string, number] + +z.map(z.string(), z.date()).readonly(); +// ReadonlyMap + +z.set(z.string()).readonly(); +// ReadonlySet +``` + +### `.pipe` + +Schemas can be chained into validation "pipelines". It's useful for easily validating the result after a `.transform()`: + +```ts +z.string() + .transform((val) => val.length) + .pipe(z.number().min(5)); +``` + +The `.pipe()` method returns a `ZodPipeline` instance. + +#### You can use `.pipe()` to fix common issues with `z.coerce`. + +You can constrain the input to types that work well with your chosen coercion. Then use `.pipe()` to apply the coercion. + +without constrained input: + +```ts +const toDate = z.coerce.date(); + +// works intuitively +console.log(toDate.safeParse("2023-01-01").success); // true + +// might not be what you want +console.log(toDate.safeParse(null).success); // true +``` + +with constrained input: + +```ts +const datelike = z.union([z.number(), z.string(), z.date()]); +const datelikeToDate = datelike.pipe(z.coerce.date()); + +// still works intuitively +console.log(datelikeToDate.safeParse("2023-01-01").success); // true + +// more likely what you want +console.log(datelikeToDate.safeParse(null).success); // false +``` + +You can also use this technique to avoid coercions that throw uncaught errors. + +without constrained input: + +```ts +const toBigInt = z.coerce.bigint(); + +// works intuitively +console.log(toBigInt.safeParse("42")); // true + +// probably not what you want +console.log(toBigInt.safeParse(null)); // throws uncaught error +``` + +with constrained input: + +```ts +const toNumber = z.number().or(z.string()).pipe(z.coerce.number()); +const toBigInt = z.bigint().or(toNumber).pipe(z.coerce.bigint()); + +// still works intuitively +console.log(toBigInt.safeParse("42").success); // true + +// error handled by zod, more likely what you want +console.log(toBigInt.safeParse(null).success); // false +``` + +## Guides and concepts + +### Type inference + +You can extract the TypeScript type of any schema with `z.infer` . + +```ts +const A = z.string(); +type A = z.infer; // string + +const u: A = 12; // TypeError +const u: A = "asdf"; // compiles +``` + +**What about transforms?** + +In reality each Zod schema internally tracks **two** types: an input and an output. For most schemas (e.g. `z.string()`) these two are the same. But once you add transforms into the mix, these two values can diverge. For instance `z.string().transform(val => val.length)` has an input of `string` and an output of `number`. + +You can separately extract the input and output types like so: + +```ts +const stringToNumber = z.string().transform((val) => val.length); + +// ⚠️ Important: z.infer returns the OUTPUT type! +type input = z.input; // string +type output = z.output; // number + +// equivalent to z.output! +type inferred = z.infer; // number +``` + +### Writing generic functions + +With TypeScript generics, you can write reusable functions that accept Zod schemas as parameters. This enables you to create custom validation logic, schema transformations, and more, while maintaining type safety and inference. + +When attempting to write a function that accepts a Zod schema as an input, it's tempting to try something like this: + +```ts +function inferSchema(schema: z.ZodType) { + return schema; +} +``` + +This approach is incorrect, and limits TypeScript's ability to properly infer the argument. No matter what you pass in, the type of `schema` will be an instance of `ZodType`. + +```ts +inferSchema(z.string()); +// => ZodType +``` + +This approach loses type information, namely _which subclass_ the input actually is (in this case, `ZodString`). That means you can't call any string-specific methods like `.min()` on the result of `inferSchema`. + +A better approach is to infer _the schema as a whole_ instead of merely its inferred type. You can do this with a utility type called `z.ZodTypeAny`. + +```ts +function inferSchema(schema: T) { + return schema; +} + +inferSchema(z.string()); +// => ZodString +``` + +> `ZodTypeAny` is just a shorthand for `ZodType`, a type that is broad enough to match any Zod schema. + +The Result is now fully and properly typed, and the type system can infer the specific subclass of the schema. + +#### Inferring the inferred type + +If you follow the best practice of using `z.ZodTypeAny` as the generic parameter for your schema, you may encounter issues with the parsed data being typed as `any` instead of the inferred type of the schema. + +```ts +function parseData(data: unknown, schema: T) { + return schema.parse(data); +} + +parseData("sup", z.string()); +// => any +``` + +Due to how TypeScript inference works, it is treating `schema` like a `ZodTypeAny` instead of the inferred type. You can fix this with a type cast using `z.infer`. + +```ts +function parseData(data: unknown, schema: T) { + return schema.parse(data) as z.infer; + // ^^^^^^^^^^^^^^ <- add this +} + +parseData("sup", z.string()); +// => string +``` + +#### Constraining allowable inputs + +The `ZodType` class has three generic parameters. + +```ts +class ZodType< + Output = any, + Def extends ZodTypeDef = ZodTypeDef, + Input = Output +> { ... } +``` + +By constraining these in your generic input, you can limit what schemas are allowable as inputs to your function: + +```ts +function makeSchemaOptional>(schema: T) { + return schema.optional(); +} + +makeSchemaOptional(z.string()); +// works fine + +makeSchemaOptional(z.number()); +// Error: 'ZodNumber' is not assignable to parameter of type 'ZodType' +``` + +### Error handling + +Zod provides a subclass of Error called `ZodError`. ZodErrors contain an `issues` array containing detailed information about the validation problems. + +```ts +const result = z + .object({ + name: z.string(), + }) + .safeParse({ name: 12 }); + +if (!result.success) { + result.error.issues; + /* [ + { + "code": "invalid_type", + "expected": "string", + "received": "number", + "path": [ "name" ], + "message": "Expected string, received number" + } + ] */ +} +``` + +> For detailed information about the possible error codes and how to customize error messages, check out the dedicated error handling guide: [ERROR_HANDLING.md](ERROR_HANDLING.md) + +Zod's error reporting emphasizes _completeness_ and _correctness_. If you are looking to present a useful error message to the end user, you should either override Zod's error messages using an error map (described in detail in the Error Handling guide) or use a third-party library like [`zod-validation-error`](https://github.com/causaly/zod-validation-error) + +### Error formatting + +You can use the `.format()` method to convert this error into a nested object. + +```ts +const result = z + .object({ + name: z.string(), + }) + .safeParse({ name: 12 }); + +if (!result.success) { + const formatted = result.error.format(); + /* { + name: { _errors: [ 'Expected string, received number' ] } + } */ + + formatted.name?._errors; + // => ["Expected string, received number"] +} +``` + +## Comparison + +There are a handful of other widely-used validation libraries, but all of them have certain design limitations that make for a non-ideal developer experience. + + + + + + + +### Joi + +[https://github.com/hapijs/joi](https://github.com/hapijs/joi) + +Doesn't support static type inference 😕 + +### Yup + +[https://github.com/jquense/yup](https://github.com/jquense/yup) + +Yup is a full-featured library that was implemented first in vanilla JS, and later rewritten in TypeScript. + +- Supports casting and transforms +- All object fields are optional by default + +- Missing promise schemas +- Missing function schemas +- Missing union & intersection schemas + + + +### io-ts + +[https://github.com/gcanti/io-ts](https://github.com/gcanti/io-ts) + +io-ts is an excellent library by gcanti. The API of io-ts heavily inspired the design of Zod. + +In our experience, io-ts prioritizes functional programming purity over developer experience in many cases. This is a valid and admirable design goal, but it makes io-ts particularly hard to integrate into an existing codebase with a more procedural or object-oriented bias. For instance, consider how to define an object with optional properties in io-ts: + +```ts +import * as t from "io-ts"; + +const A = t.type({ + foo: t.string, +}); + +const B = t.partial({ + bar: t.number, +}); + +const C = t.intersection([A, B]); + +type C = t.TypeOf; +// returns { foo: string; bar?: number | undefined } +``` + +You must define the required and optional props in separate object validators, pass the optionals through `t.partial` (which marks all properties as optional), then combine them with `t.intersection` . + +Consider the equivalent in Zod: + +```ts +const C = z.object({ + foo: z.string(), + bar: z.number().optional(), +}); + +type C = z.infer; +// returns { foo: string; bar?: number | undefined } +``` + +This more declarative API makes schema definitions vastly more concise. + +`io-ts` also requires the use of gcanti's functional programming library `fp-ts` to parse results and handle errors. This is another fantastic resource for developers looking to keep their codebase strictly functional. But depending on `fp-ts` necessarily comes with a lot of intellectual overhead; a developer has to be familiar with functional programming concepts and the `fp-ts` nomenclature to use the library. + +- Supports codecs with serialization & deserialization transforms +- Supports branded types +- Supports advanced functional programming, higher-kinded types, `fp-ts` compatibility +- Missing object methods: (pick, omit, partial, deepPartial, merge, extend) +- Missing nonempty arrays with proper typing (`[T, ...T[]]`) +- Missing promise schemas +- Missing function schemas + +### Runtypes + +[https://github.com/pelotom/runtypes](https://github.com/pelotom/runtypes) + +Good type inference support. + +- Supports "pattern matching": computed properties that distribute over unions +- Missing object methods: (deepPartial, merge) +- Missing nonempty arrays with proper typing (`[T, ...T[]]`) +- Missing promise schemas +- Missing error customization + +### Ow + +[https://github.com/sindresorhus/ow](https://github.com/sindresorhus/ow) + +Ow is focused on function input validation. It's a library that makes it easy to express complicated assert statements, but it doesn't let you parse untyped data. They support a much wider variety of types; Zod has a nearly one-to-one mapping with TypeScript's type system, whereas ow lets you validate several highly-specific types out of the box (e.g. `int32Array` , see full list in their README). + +If you want to validate function inputs, use function schemas in Zod! It's a much simpler approach that lets you reuse a function type declaration without repeating yourself (namely, copy-pasting a bunch of ow assertions at the beginning of every function). Also Zod lets you validate your return types as well, so you can be sure there won't be any unexpected data passed downstream. + +## Changelog + +View the changelog at [CHANGELOG.md](CHANGELOG.md) diff --git a/front_end/third_party/mcp-sdk/zod/dist/cli.d.ts b/front_end/third_party/mcp-sdk/zod/dist/cli.d.ts new file mode 100644 index 0000000000..d9ae1944cf --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/cli.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=cli.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/cli.d.ts.map b/front_end/third_party/mcp-sdk/zod/dist/cli.d.ts.map new file mode 100644 index 0000000000..f022439b15 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/cli.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/cli.js b/front_end/third_party/mcp-sdk/zod/dist/cli.js new file mode 100644 index 0000000000..638a4d4b1d --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/cli.js @@ -0,0 +1,129 @@ +import EventSource from "eventsource"; +import WebSocket from "ws"; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +global.EventSource = EventSource; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +global.WebSocket = WebSocket; +import express from "express"; +import { Client } from "./client/index.js"; +import { SSEClientTransport } from "./client/sse.js"; +import { StdioClientTransport } from "./client/stdio.js"; +import { WebSocketClientTransport } from "./client/websocket.js"; +import { Server } from "./server/index.js"; +import { SSEServerTransport } from "./server/sse.js"; +import { StdioServerTransport } from "./server/stdio.js"; +import { ListResourcesResultSchema } from "./types.js"; +async function runClient(url_or_command, args) { + const client = new Client({ + name: "mcp-typescript test client", + version: "0.1.0", + }, { + capabilities: { + sampling: {}, + }, + }); + let clientTransport; + let url = undefined; + try { + url = new URL(url_or_command); + } + catch (_a) { + // Ignore + } + if ((url === null || url === void 0 ? void 0 : url.protocol) === "http:" || (url === null || url === void 0 ? void 0 : url.protocol) === "https:") { + clientTransport = new SSEClientTransport(new URL(url_or_command)); + } + else if ((url === null || url === void 0 ? void 0 : url.protocol) === "ws:" || (url === null || url === void 0 ? void 0 : url.protocol) === "wss:") { + clientTransport = new WebSocketClientTransport(new URL(url_or_command)); + } + else { + clientTransport = new StdioClientTransport({ + command: url_or_command, + args, + }); + } + console.log("Connected to server."); + await client.connect(clientTransport); + console.log("Initialized."); + await client.request({ method: "resources/list" }, ListResourcesResultSchema); + await client.close(); + console.log("Closed."); +} +async function runServer(port) { + if (port !== null) { + const app = express(); + let servers = []; + app.get("/sse", async (req, res) => { + console.log("Got new SSE connection"); + const transport = new SSEServerTransport("/message", res); + const server = new Server({ + name: "mcp-typescript test server", + version: "0.1.0", + }, { + capabilities: {}, + }); + servers.push(server); + server.onclose = () => { + console.log("SSE connection closed"); + servers = servers.filter((s) => s !== server); + }; + await server.connect(transport); + }); + app.post("/message", async (req, res) => { + console.log("Received message"); + const sessionId = req.query.sessionId; + const transport = servers + .map((s) => s.transport) + .find((t) => t.sessionId === sessionId); + if (!transport) { + res.status(404).send("Session not found"); + return; + } + await transport.handlePostMessage(req, res); + }); + app.listen(port, () => { + console.log(`Server running on http://localhost:${port}/sse`); + }); + } + else { + const server = new Server({ + name: "mcp-typescript test server", + version: "0.1.0", + }, { + capabilities: { + prompts: {}, + resources: {}, + tools: {}, + logging: {}, + }, + }); + const transport = new StdioServerTransport(); + await server.connect(transport); + console.log("Server running on stdio"); + } +} +const args = process.argv.slice(2); +const command = args[0]; +switch (command) { + case "client": + if (args.length < 2) { + console.error("Usage: client [args...]"); + process.exit(1); + } + runClient(args[1], args.slice(2)).catch((error) => { + console.error(error); + process.exit(1); + }); + break; + case "server": { + const port = args[1] ? parseInt(args[1]) : null; + runServer(port).catch((error) => { + console.error(error); + process.exit(1); + }); + break; + } + default: + console.error("Unrecognized command:", command); +} +//# sourceMappingURL=cli.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/cli.js.map b/front_end/third_party/mcp-sdk/zod/dist/cli.js.map new file mode 100644 index 0000000000..3ce2d24c3c --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/cli.js.map @@ -0,0 +1 @@ +{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,aAAa,CAAC;AACtC,OAAO,SAAS,MAAM,IAAI,CAAC;AAE3B,8DAA8D;AAC7D,MAAc,CAAC,WAAW,GAAG,WAAW,CAAC;AAC1C,8DAA8D;AAC7D,MAAc,CAAC,SAAS,GAAG,SAAS,CAAC;AAEtC,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAEvD,KAAK,UAAU,SAAS,CAAC,cAAsB,EAAE,IAAc;IAC7D,MAAM,MAAM,GAAG,IAAI,MAAM,CACvB;QACE,IAAI,EAAE,4BAA4B;QAClC,OAAO,EAAE,OAAO;KACjB,EACD;QACE,YAAY,EAAE;YACZ,QAAQ,EAAE,EAAE;SACb;KACF,CACF,CAAC;IAEF,IA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AAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;QAEH,MAAM;IAER,KAAK,QAAQ,CAAC,CAAC,CAAC;QACd,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAChD,SAAS,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YAC9B,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;QAEH,MAAM;IACR,CAAC;IAED;QACE,OAAO,CAAC,KAAK,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;AACpD,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/client/index.d.ts b/front_end/third_party/mcp-sdk/zod/dist/client/index.d.ts new file mode 100644 index 0000000000..d0a4295db8 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/client/index.d.ts @@ -0,0 +1,773 @@ +import { Protocol, ProtocolOptions, RequestOptions } from "../shared/protocol.js"; +import { Transport } from "../shared/transport.js"; +import { CallToolRequest, CallToolResultSchema, ClientCapabilities, ClientNotification, ClientRequest, ClientResult, CompatibilityCallToolResultSchema, CompleteRequest, GetPromptRequest, Implementation, ListPromptsRequest, ListResourcesRequest, ListResourceTemplatesRequest, ListToolsRequest, LoggingLevel, Notification, ReadResourceRequest, Request, Result, ServerCapabilities, SubscribeRequest, UnsubscribeRequest } from "../types.js"; +export type ClientOptions = ProtocolOptions & { + /** + * Capabilities to advertise as being supported by this client. + */ + capabilities: ClientCapabilities; +}; +/** + * An MCP client on top of a pluggable transport. + * + * The client will automatically begin the initialization flow with the server when connect() is called. + * + * To use with custom types, extend the base Request/Notification/Result types and pass them as type parameters: + * + * ```typescript + * // Custom schemas + * const CustomRequestSchema = RequestSchema.extend({...}) + * const CustomNotificationSchema = NotificationSchema.extend({...}) + * const CustomResultSchema = ResultSchema.extend({...}) + * + * // Type aliases + * type CustomRequest = z.infer + * type CustomNotification = z.infer + * type CustomResult = z.infer + * + * // Create typed client + * const client = new Client({ + * name: "CustomClient", + * version: "1.0.0" + * }) + * ``` + */ +export declare class Client extends Protocol { + private _clientInfo; + private _serverCapabilities?; + private _serverVersion?; + private _capabilities; + /** + * Initializes this client with the given name and version information. + */ + constructor(_clientInfo: Implementation, options: ClientOptions); + protected assertCapability(capability: keyof ServerCapabilities, method: string): void; + connect(transport: Transport): Promise; + /** + * After initialization has completed, this will be populated with the server's reported capabilities. + */ + getServerCapabilities(): ServerCapabilities | undefined; + /** + * After initialization has completed, this will be populated with information about the server's name and version. + */ + getServerVersion(): Implementation | undefined; + protected assertCapabilityForMethod(method: RequestT["method"]): void; + protected assertNotificationCapability(method: NotificationT["method"]): void; + protected assertRequestHandlerCapability(method: string): void; + ping(options?: RequestOptions): Promise<{ + _meta?: import("zod").objectOutputType<{}, import("zod").ZodTypeAny, "passthrough"> | undefined; + }>; + complete(params: CompleteRequest["params"], options?: RequestOptions): Promise, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + completion: import("zod").ZodObject<{ + values: import("zod").ZodArray; + total: import("zod").ZodOptional; + hasMore: import("zod").ZodOptional; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + values: import("zod").ZodArray; + total: import("zod").ZodOptional; + hasMore: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + values: import("zod").ZodArray; + total: import("zod").ZodOptional; + hasMore: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">>; + }>, import("zod").ZodTypeAny, "passthrough">>; + setLoggingLevel(level: LoggingLevel, options?: RequestOptions): Promise<{ + _meta?: import("zod").objectOutputType<{}, import("zod").ZodTypeAny, "passthrough"> | undefined; + }>; + getPrompt(params: GetPromptRequest["params"], options?: RequestOptions): Promise, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + description: import("zod").ZodOptional; + messages: import("zod").ZodArray; + content: import("zod").ZodUnion<[import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, import("zod").ZodTypeAny, "passthrough">>]>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + role: import("zod").ZodEnum<["user", "assistant"]>; + content: import("zod").ZodUnion<[import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, import("zod").ZodTypeAny, "passthrough">>]>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + role: import("zod").ZodEnum<["user", "assistant"]>; + content: import("zod").ZodUnion<[import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, import("zod").ZodTypeAny, "passthrough">>]>; + }, import("zod").ZodTypeAny, "passthrough">>, "many">; + }>, import("zod").ZodTypeAny, "passthrough">>; + listPrompts(params?: ListPromptsRequest["params"], options?: RequestOptions): Promise, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + nextCursor: import("zod").ZodOptional; + }>, { + prompts: import("zod").ZodArray; + arguments: import("zod").ZodOptional; + required: import("zod").ZodOptional; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + name: import("zod").ZodString; + description: import("zod").ZodOptional; + required: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + name: import("zod").ZodString; + description: import("zod").ZodOptional; + required: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">>, "many">>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + name: import("zod").ZodString; + description: import("zod").ZodOptional; + arguments: import("zod").ZodOptional; + required: import("zod").ZodOptional; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + name: import("zod").ZodString; + description: import("zod").ZodOptional; + required: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + name: import("zod").ZodString; + description: import("zod").ZodOptional; + required: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">>, "many">>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + name: import("zod").ZodString; + description: import("zod").ZodOptional; + arguments: import("zod").ZodOptional; + required: import("zod").ZodOptional; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + name: import("zod").ZodString; + description: import("zod").ZodOptional; + required: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + name: import("zod").ZodString; + description: import("zod").ZodOptional; + required: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">>, "many">>; + }, import("zod").ZodTypeAny, "passthrough">>, "many">; + }>, import("zod").ZodTypeAny, "passthrough">>; + listResources(params?: ListResourcesRequest["params"], options?: RequestOptions): Promise, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + nextCursor: import("zod").ZodOptional; + }>, { + resources: import("zod").ZodArray; + mimeType: import("zod").ZodOptional; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + uri: import("zod").ZodString; + name: import("zod").ZodString; + description: import("zod").ZodOptional; + mimeType: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + uri: import("zod").ZodString; + name: import("zod").ZodString; + description: import("zod").ZodOptional; + mimeType: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">>, "many">; + }>, import("zod").ZodTypeAny, "passthrough">>; + listResourceTemplates(params?: ListResourceTemplatesRequest["params"], options?: RequestOptions): Promise, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + nextCursor: import("zod").ZodOptional; + }>, { + resourceTemplates: import("zod").ZodArray; + mimeType: import("zod").ZodOptional; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + uriTemplate: import("zod").ZodString; + name: import("zod").ZodString; + description: import("zod").ZodOptional; + mimeType: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + uriTemplate: import("zod").ZodString; + name: import("zod").ZodString; + description: import("zod").ZodOptional; + mimeType: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">>, "many">; + }>, import("zod").ZodTypeAny, "passthrough">>; + readResource(params: ReadResourceRequest["params"], options?: RequestOptions): Promise, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + contents: import("zod").ZodArray; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>, "many">; + }>, import("zod").ZodTypeAny, "passthrough">>; + subscribeResource(params: SubscribeRequest["params"], options?: RequestOptions): Promise<{ + _meta?: import("zod").objectOutputType<{}, import("zod").ZodTypeAny, "passthrough"> | undefined; + }>; + unsubscribeResource(params: UnsubscribeRequest["params"], options?: RequestOptions): Promise<{ + _meta?: import("zod").objectOutputType<{}, import("zod").ZodTypeAny, "passthrough"> | undefined; + }>; + callTool(params: CallToolRequest["params"], resultSchema?: typeof CallToolResultSchema | typeof CompatibilityCallToolResultSchema, options?: RequestOptions): Promise, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + content: import("zod").ZodArray; + text: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"resource">; + resource: import("zod").ZodUnion<[import("zod").ZodObject; + }, { + text: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + text: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject; + }, { + blob: import("zod").ZodString; + }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType; + }, { + blob: import("zod").ZodString; + }>, import("zod").ZodTypeAny, "passthrough">>]>; + }, import("zod").ZodTypeAny, "passthrough">>]>, "many">; + isError: import("zod").ZodOptional>; + }>, import("zod").ZodTypeAny, "passthrough"> | import("zod").objectOutputType, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + toolResult: import("zod").ZodUnknown; + }>, import("zod").ZodTypeAny, "passthrough">>; + listTools(params?: ListToolsRequest["params"], options?: RequestOptions): Promise, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + nextCursor: import("zod").ZodOptional; + }>, { + tools: import("zod").ZodArray; + inputSchema: import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, import("zod").ZodTypeAny, "passthrough">>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + name: import("zod").ZodString; + description: import("zod").ZodOptional; + inputSchema: import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, import("zod").ZodTypeAny, "passthrough">>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + name: import("zod").ZodString; + description: import("zod").ZodOptional; + inputSchema: import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"object">; + properties: import("zod").ZodOptional, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, import("zod").ZodTypeAny, "passthrough">>; + }, import("zod").ZodTypeAny, "passthrough">>, "many">; + }>, import("zod").ZodTypeAny, "passthrough">>; + sendRootsListChanged(): Promise; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/client/index.d.ts.map b/front_end/third_party/mcp-sdk/zod/dist/client/index.d.ts.map new file mode 100644 index 0000000000..f347d6f4d6 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/client/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL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,oBAAoB,CAAC,QAAQ,CAAC,EACvC,OAAO,CAAC,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;IASpB,qBAAqB,CACzB,MAAM,CAAC,EAAE,4BAA4B,CAAC,QAAQ,CAAC,EAC/C,OAAO,CAAC,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;IASpB,YAAY,CAChB,MAAM,EAAE,mBAAmB,CAAC,QAAQ,CAAC,EACrC,OAAO,CAAC,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IASpB,iBAAiB,CACrB,MAAM,EAAE,gBAAgB,CAAC,QAAQ,CAAC,EAClC,OAAO,CAAC,EAAE,cAAc;;;IASpB,mBAAmB,CACvB,MAAM,EAAE,kBAAkB,CAAC,QAAQ,CAAC,EACpC,OAAO,CAAC,EAAE,cAAc;;;IASpB,QAAQ,CACZ,MAAM,EAAE,eAAe,CAAC,QAAQ,CAAC,EACjC,YAAY,GACR,OAAO,oBAAoB,GAC3B,OAAO,iCAAwD,EACnE,OAAO,CAAC,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IASpB,SAAS,CACb,MAAM,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,EACnC,OAAO,CAAC,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IASpB,oBAAoB;CAG3B"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/client/index.js b/front_end/third_party/mcp-sdk/zod/dist/client/index.js new file mode 100644 index 0000000000..4622c2d3cc --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/client/index.js @@ -0,0 +1,206 @@ +import { Protocol, } from "../shared/protocol.js"; +import { CallToolResultSchema, CompleteResultSchema, EmptyResultSchema, GetPromptResultSchema, InitializeResultSchema, LATEST_PROTOCOL_VERSION, ListPromptsResultSchema, ListResourcesResultSchema, ListResourceTemplatesResultSchema, ListToolsResultSchema, ReadResourceResultSchema, SUPPORTED_PROTOCOL_VERSIONS, } from "../types.js"; +/** + * An MCP client on top of a pluggable transport. + * + * The client will automatically begin the initialization flow with the server when connect() is called. + * + * To use with custom types, extend the base Request/Notification/Result types and pass them as type parameters: + * + * ```typescript + * // Custom schemas + * const CustomRequestSchema = RequestSchema.extend({...}) + * const CustomNotificationSchema = NotificationSchema.extend({...}) + * const CustomResultSchema = ResultSchema.extend({...}) + * + * // Type aliases + * type CustomRequest = z.infer + * type CustomNotification = z.infer + * type CustomResult = z.infer + * + * // Create typed client + * const client = new Client({ + * name: "CustomClient", + * version: "1.0.0" + * }) + * ``` + */ +export class Client extends Protocol { + /** + * Initializes this client with the given name and version information. + */ + constructor(_clientInfo, options) { + super(options); + this._clientInfo = _clientInfo; + this._capabilities = options.capabilities; + } + assertCapability(capability, method) { + var _a; + if (!((_a = this._serverCapabilities) === null || _a === void 0 ? void 0 : _a[capability])) { + throw new Error(`Server does not support ${capability} (required for ${method})`); + } + } + async connect(transport) { + await super.connect(transport); + try { + const result = await this.request({ + method: "initialize", + params: { + protocolVersion: LATEST_PROTOCOL_VERSION, + capabilities: this._capabilities, + clientInfo: this._clientInfo, + }, + }, InitializeResultSchema); + if (result === undefined) { + throw new Error(`Server sent invalid initialize result: ${result}`); + } + if (!SUPPORTED_PROTOCOL_VERSIONS.includes(result.protocolVersion)) { + throw new Error(`Server's protocol version is not supported: ${result.protocolVersion}`); + } + this._serverCapabilities = result.capabilities; + this._serverVersion = result.serverInfo; + await this.notification({ + method: "notifications/initialized", + }); + } + catch (error) { + // Disconnect if initialization fails. + void this.close(); + throw error; + } + } + /** + * After initialization has completed, this will be populated with the server's reported capabilities. + */ + getServerCapabilities() { + return this._serverCapabilities; + } + /** + * After initialization has completed, this will be populated with information about the server's name and version. + */ + getServerVersion() { + return this._serverVersion; + } + assertCapabilityForMethod(method) { + var _a, _b, _c, _d, _e; + switch (method) { + case "logging/setLevel": + if (!((_a = this._serverCapabilities) === null || _a === void 0 ? void 0 : _a.logging)) { + throw new Error(`Server does not support logging (required for ${method})`); + } + break; + case "prompts/get": + case "prompts/list": + if (!((_b = this._serverCapabilities) === null || _b === void 0 ? void 0 : _b.prompts)) { + throw new Error(`Server does not support prompts (required for ${method})`); + } + break; + case "resources/list": + case "resources/templates/list": + case "resources/read": + case "resources/subscribe": + case "resources/unsubscribe": + if (!((_c = this._serverCapabilities) === null || _c === void 0 ? void 0 : _c.resources)) { + throw new Error(`Server does not support resources (required for ${method})`); + } + if (method === "resources/subscribe" && + !this._serverCapabilities.resources.subscribe) { + throw new Error(`Server does not support resource subscriptions (required for ${method})`); + } + break; + case "tools/call": + case "tools/list": + if (!((_d = this._serverCapabilities) === null || _d === void 0 ? void 0 : _d.tools)) { + throw new Error(`Server does not support tools (required for ${method})`); + } + break; + case "completion/complete": + if (!((_e = this._serverCapabilities) === null || _e === void 0 ? void 0 : _e.prompts)) { + throw new Error(`Server does not support prompts (required for ${method})`); + } + break; + case "initialize": + // No specific capability required for initialize + break; + case "ping": + // No specific capability required for ping + break; + } + } + assertNotificationCapability(method) { + var _a; + switch (method) { + case "notifications/roots/list_changed": + if (!((_a = this._capabilities.roots) === null || _a === void 0 ? void 0 : _a.listChanged)) { + throw new Error(`Client does not support roots list changed notifications (required for ${method})`); + } + break; + case "notifications/initialized": + // No specific capability required for initialized + break; + case "notifications/cancelled": + // Cancellation notifications are always allowed + break; + case "notifications/progress": + // Progress notifications are always allowed + break; + } + } + assertRequestHandlerCapability(method) { + switch (method) { + case "sampling/createMessage": + if (!this._capabilities.sampling) { + throw new Error(`Client does not support sampling capability (required for ${method})`); + } + break; + case "roots/list": + if (!this._capabilities.roots) { + throw new Error(`Client does not support roots capability (required for ${method})`); + } + break; + case "ping": + // No specific capability required for ping + break; + } + } + async ping(options) { + return this.request({ method: "ping" }, EmptyResultSchema, options); + } + async complete(params, options) { + return this.request({ method: "completion/complete", params }, CompleteResultSchema, options); + } + async setLoggingLevel(level, options) { + return this.request({ method: "logging/setLevel", params: { level } }, EmptyResultSchema, options); + } + async getPrompt(params, options) { + return this.request({ method: "prompts/get", params }, GetPromptResultSchema, options); + } + async listPrompts(params, options) { + return this.request({ method: "prompts/list", params }, ListPromptsResultSchema, options); + } + async listResources(params, options) { + return this.request({ method: "resources/list", params }, ListResourcesResultSchema, options); + } + async listResourceTemplates(params, options) { + return this.request({ method: "resources/templates/list", params }, ListResourceTemplatesResultSchema, options); + } + async readResource(params, options) { + return this.request({ method: "resources/read", params }, ReadResourceResultSchema, options); + } + async subscribeResource(params, options) { + return this.request({ method: "resources/subscribe", params }, EmptyResultSchema, options); + } + async unsubscribeResource(params, options) { + return this.request({ method: "resources/unsubscribe", params }, EmptyResultSchema, options); + } + async callTool(params, resultSchema = CallToolResultSchema, options) { + return this.request({ method: "tools/call", params }, resultSchema, options); + } + async listTools(params, options) { + return this.request({ method: "tools/list", params }, ListToolsResultSchema, options); + } + async sendRootsListChanged() { + return this.notification({ method: "notifications/roots/list_changed" }); + } +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/client/index.js.map b/front_end/third_party/mcp-sdk/zod/dist/client/index.js.map new file mode 100644 index 0000000000..cedc261ccf --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/client/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,GAGT,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAEL,oBAAoB,EAOpB,oBAAoB,EACpB,iBAAiB,EAEjB,qBAAqB,EAErB,sBAAsB,EACtB,uBAAuB,EAEvB,uBAAuB,EAEvB,yBAAyB,EAEzB,iCAAiC,EAEjC,qBAAqB,EAIrB,wBAAwB,EAKxB,2BAA2B,GAE5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AC,oBAAoB;QACxB,OAAO,IAAI,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,kCAAkC,EAAE,CAAC,CAAC;IAC3E,CAAC;CACF"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/client/index.test.d.ts b/front_end/third_party/mcp-sdk/zod/dist/client/index.test.d.ts new file mode 100644 index 0000000000..121d59b38b --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/client/index.test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=index.test.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/client/index.test.d.ts.map b/front_end/third_party/mcp-sdk/zod/dist/client/index.test.d.ts.map new file mode 100644 index 0000000000..2b9c387f05 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/client/index.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../src/client/index.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/client/index.test.js b/front_end/third_party/mcp-sdk/zod/dist/client/index.test.js new file mode 100644 index 0000000000..e67a09564d --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/client/index.test.js @@ -0,0 +1,393 @@ +/* eslint-disable @typescript-eslint/no-unused-vars */ +/* eslint-disable no-constant-binary-expression */ +/* eslint-disable @typescript-eslint/no-unused-expressions */ +import { Client } from "./index.js"; +import { z } from "zod"; +import { RequestSchema, NotificationSchema, ResultSchema, LATEST_PROTOCOL_VERSION, SUPPORTED_PROTOCOL_VERSIONS, InitializeRequestSchema, ListResourcesRequestSchema, ListToolsRequestSchema, CreateMessageRequestSchema, ListRootsRequestSchema, ErrorCode, } from "../types.js"; +import { Server } from "../server/index.js"; +import { InMemoryTransport } from "../inMemory.js"; +test("should initialize with matching protocol version", async () => { + const clientTransport = { + start: jest.fn().mockResolvedValue(undefined), + close: jest.fn().mockResolvedValue(undefined), + send: jest.fn().mockImplementation((message) => { + var _a; + if (message.method === "initialize") { + (_a = clientTransport.onmessage) === null || _a === void 0 ? void 0 : _a.call(clientTransport, { + jsonrpc: "2.0", + id: message.id, + result: { + protocolVersion: LATEST_PROTOCOL_VERSION, + capabilities: {}, + serverInfo: { + name: "test", + version: "1.0", + }, + }, + }); + } + return Promise.resolve(); + }), + }; + const client = new Client({ + name: "test client", + version: "1.0", + }, { + capabilities: { + sampling: {}, + }, + }); + await client.connect(clientTransport); + // Should have sent initialize with latest version + expect(clientTransport.send).toHaveBeenCalledWith(expect.objectContaining({ + method: "initialize", + params: expect.objectContaining({ + protocolVersion: LATEST_PROTOCOL_VERSION, + }), + })); +}); +test("should initialize with supported older protocol version", async () => { + const OLD_VERSION = SUPPORTED_PROTOCOL_VERSIONS[1]; + const clientTransport = { + start: jest.fn().mockResolvedValue(undefined), + close: jest.fn().mockResolvedValue(undefined), + send: jest.fn().mockImplementation((message) => { + var _a; + if (message.method === "initialize") { + (_a = clientTransport.onmessage) === null || _a === void 0 ? void 0 : _a.call(clientTransport, { + jsonrpc: "2.0", + id: message.id, + result: { + protocolVersion: OLD_VERSION, + capabilities: {}, + serverInfo: { + name: "test", + version: "1.0", + }, + }, + }); + } + return Promise.resolve(); + }), + }; + const client = new Client({ + name: "test client", + version: "1.0", + }, { + capabilities: { + sampling: {}, + }, + }); + await client.connect(clientTransport); + // Connection should succeed with the older version + expect(client.getServerVersion()).toEqual({ + name: "test", + version: "1.0", + }); +}); +test("should reject unsupported protocol version", async () => { + const clientTransport = { + start: jest.fn().mockResolvedValue(undefined), + close: jest.fn().mockResolvedValue(undefined), + send: jest.fn().mockImplementation((message) => { + var _a; + if (message.method === "initialize") { + (_a = clientTransport.onmessage) === null || _a === void 0 ? void 0 : _a.call(clientTransport, { + jsonrpc: "2.0", + id: message.id, + result: { + protocolVersion: "invalid-version", + capabilities: {}, + serverInfo: { + name: "test", + version: "1.0", + }, + }, + }); + } + return Promise.resolve(); + }), + }; + const client = new Client({ + name: "test client", + version: "1.0", + }, { + capabilities: { + sampling: {}, + }, + }); + await expect(client.connect(clientTransport)).rejects.toThrow("Server's protocol version is not supported: invalid-version"); + expect(clientTransport.close).toHaveBeenCalled(); +}); +test("should respect server capabilities", async () => { + const server = new Server({ + name: "test server", + version: "1.0", + }, { + capabilities: { + resources: {}, + tools: {}, + }, + }); + server.setRequestHandler(InitializeRequestSchema, (_request) => ({ + protocolVersion: LATEST_PROTOCOL_VERSION, + capabilities: { + resources: {}, + tools: {}, + }, + serverInfo: { + name: "test", + version: "1.0", + }, + })); + server.setRequestHandler(ListResourcesRequestSchema, () => ({ + resources: [], + })); + server.setRequestHandler(ListToolsRequestSchema, () => ({ + tools: [], + })); + const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair(); + const client = new Client({ + name: "test client", + version: "1.0", + }, { + capabilities: { + sampling: {}, + }, + enforceStrictCapabilities: true, + }); + await Promise.all([ + client.connect(clientTransport), + server.connect(serverTransport), + ]); + // Server supports resources and tools, but not prompts + expect(client.getServerCapabilities()).toEqual({ + resources: {}, + tools: {}, + }); + // These should work + await expect(client.listResources()).resolves.not.toThrow(); + await expect(client.listTools()).resolves.not.toThrow(); + // This should throw because prompts are not supported + await expect(client.listPrompts()).rejects.toThrow("Server does not support prompts"); +}); +test("should respect client notification capabilities", async () => { + const server = new Server({ + name: "test server", + version: "1.0", + }, { + capabilities: {}, + }); + const client = new Client({ + name: "test client", + version: "1.0", + }, { + capabilities: { + roots: { + listChanged: true, + }, + }, + }); + const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair(); + await Promise.all([ + client.connect(clientTransport), + server.connect(serverTransport), + ]); + // This should work because the client has the roots.listChanged capability + await expect(client.sendRootsListChanged()).resolves.not.toThrow(); + // Create a new client without the roots.listChanged capability + const clientWithoutCapability = new Client({ + name: "test client without capability", + version: "1.0", + }, { + capabilities: {}, + enforceStrictCapabilities: true, + }); + await clientWithoutCapability.connect(clientTransport); + // This should throw because the client doesn't have the roots.listChanged capability + await expect(clientWithoutCapability.sendRootsListChanged()).rejects.toThrow(/^Client does not support/); +}); +test("should respect server notification capabilities", async () => { + const server = new Server({ + name: "test server", + version: "1.0", + }, { + capabilities: { + logging: {}, + resources: { + listChanged: true, + }, + }, + }); + const client = new Client({ + name: "test client", + version: "1.0", + }, { + capabilities: {}, + }); + const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair(); + await Promise.all([ + client.connect(clientTransport), + server.connect(serverTransport), + ]); + // These should work because the server has the corresponding capabilities + await expect(server.sendLoggingMessage({ level: "info", data: "Test" })).resolves.not.toThrow(); + await expect(server.sendResourceListChanged()).resolves.not.toThrow(); + // This should throw because the server doesn't have the tools capability + await expect(server.sendToolListChanged()).rejects.toThrow("Server does not support notifying of tool list changes"); +}); +test("should only allow setRequestHandler for declared capabilities", () => { + const client = new Client({ + name: "test client", + version: "1.0", + }, { + capabilities: { + sampling: {}, + }, + }); + // This should work because sampling is a declared capability + expect(() => { + client.setRequestHandler(CreateMessageRequestSchema, () => ({ + model: "test-model", + role: "assistant", + content: { + type: "text", + text: "Test response", + }, + })); + }).not.toThrow(); + // This should throw because roots listing is not a declared capability + expect(() => { + client.setRequestHandler(ListRootsRequestSchema, () => ({})); + }).toThrow("Client does not support roots capability"); +}); +/* + Test that custom request/notification/result schemas can be used with the Client class. + */ +test("should typecheck", () => { + const GetWeatherRequestSchema = RequestSchema.extend({ + method: z.literal("weather/get"), + params: z.object({ + city: z.string(), + }), + }); + const GetForecastRequestSchema = RequestSchema.extend({ + method: z.literal("weather/forecast"), + params: z.object({ + city: z.string(), + days: z.number(), + }), + }); + const WeatherForecastNotificationSchema = NotificationSchema.extend({ + method: z.literal("weather/alert"), + params: z.object({ + severity: z.enum(["warning", "watch"]), + message: z.string(), + }), + }); + const WeatherRequestSchema = GetWeatherRequestSchema.or(GetForecastRequestSchema); + const WeatherNotificationSchema = WeatherForecastNotificationSchema; + const WeatherResultSchema = ResultSchema.extend({ + temperature: z.number(), + conditions: z.string(), + }); + // Create a typed Client for weather data + const weatherClient = new Client({ + name: "WeatherClient", + version: "1.0.0", + }, { + capabilities: { + sampling: {}, + }, + }); + // Typecheck that only valid weather requests/notifications/results are allowed + false && + weatherClient.request({ + method: "weather/get", + params: { + city: "Seattle", + }, + }, WeatherResultSchema); + false && + weatherClient.notification({ + method: "weather/alert", + params: { + severity: "warning", + message: "Storm approaching", + }, + }); +}); +test("should handle client cancelling a request", async () => { + const server = new Server({ + name: "test server", + version: "1.0", + }, { + capabilities: { + resources: {}, + }, + }); + // Set up server to delay responding to listResources + server.setRequestHandler(ListResourcesRequestSchema, async (request, extra) => { + await new Promise((resolve) => setTimeout(resolve, 1000)); + return { + resources: [], + }; + }); + const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair(); + const client = new Client({ + name: "test client", + version: "1.0", + }, { + capabilities: {}, + }); + await Promise.all([ + client.connect(clientTransport), + server.connect(serverTransport), + ]); + // Set up abort controller + const controller = new AbortController(); + // Issue request but cancel it immediately + const listResourcesPromise = client.listResources(undefined, { + signal: controller.signal, + }); + controller.abort("Cancelled by test"); + // Request should be rejected + await expect(listResourcesPromise).rejects.toBe("Cancelled by test"); +}); +test("should handle request timeout", async () => { + const server = new Server({ + name: "test server", + version: "1.0", + }, { + capabilities: { + resources: {}, + }, + }); + // Set up server with a delayed response + server.setRequestHandler(ListResourcesRequestSchema, async (_request, extra) => { + const timer = new Promise((resolve) => { + const timeout = setTimeout(resolve, 100); + extra.signal.addEventListener("abort", () => clearTimeout(timeout)); + }); + await timer; + return { + resources: [], + }; + }); + const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair(); + const client = new Client({ + name: "test client", + version: "1.0", + }, { + capabilities: {}, + }); + await Promise.all([ + client.connect(clientTransport), + server.connect(serverTransport), + ]); + // Request with 0 msec timeout should fail immediately + await expect(client.listResources(undefined, { timeout: 0 })).rejects.toMatchObject({ + code: ErrorCode.RequestTimeout, + }); +}); +//# sourceMappingURL=index.test.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/client/index.test.js.map b/front_end/third_party/mcp-sdk/zod/dist/client/index.test.js.map new file mode 100644 index 0000000000..14b87ae118 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/client/index.test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../src/client/index.test.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,kDAAkD;AAClD,6DAA6D;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,YAAY,EACZ,uBAAuB,EACvB,2BAA2B,EAC3B,uBAAuB,EACvB,0BAA0B,EAC1B,sBAAsB,EACtB,0BAA0B,EAC1B,sBAAsB,EACtB,SAAS,GACV,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,IAAI,CAAC,kDAAkD,EAAE,KAAK,IAAI,EAAE;IAClE,MAAM,eAAe,GAAc;QACjC,KAAK,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,SAAS,CAAC;QAC7C,KAAK,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,SAAS,CAAC;QAC7C,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,kBAAkB,CAAC,CAAC,OAAO,EAAE,EAAE;;YAC7C,IAAI,OAAO,CAAC,MAAM,KAAK,YAAY,EAAE,CAAC;gBACpC,MAAA,eAAe,CAAC,SAAS,gEAAG;oBAC1B,OAAO,EAAE,KAAK;oBACd,EAAE,EAAE,OAAO,CAAC,EAAE;oBACd,MAAM,EAAE;wBACN,eAAe,EAAE,uBAAuB;wBACxC,YAAY,EAAE,EAAE;wBAChB,UAAU,EAAE;4BACV,I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EvC,MAAM,MAAM,GAAG,IAAI,MAAM,CACvB;QACE,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE,KAAK;KACf,EACD;QACE,YAAY,EAAE,EAAE;KACjB,CACF,CAAC;IAEF,MAAM,OAAO,CAAC,GAAG,CAAC;QAChB,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC;QAC/B,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC;KAChC,CAAC,CAAC;IAEH,sDAAsD;IACtD,MAAM,MAAM,CACV,MAAM,CAAC,aAAa,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAChD,CAAC,OAAO,CAAC,aAAa,CAAC;QACtB,IAAI,EAAE,SAAS,CAAC,cAAc;KAC/B,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/client/sse.d.ts b/front_end/third_party/mcp-sdk/zod/dist/client/sse.d.ts new file mode 100644 index 0000000000..a419b60171 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/client/sse.d.ts @@ -0,0 +1,22 @@ +import { Transport } from "../shared/transport.js"; +import { JSONRPCMessage } from "../types.js"; +/** + * Client transport for SSE: this will connect to a server using Server-Sent Events for receiving + * messages and make separate POST requests for sending messages. + * + * This uses the EventSource API in browsers. You can install the `eventsource` package for Node.js. + */ +export declare class SSEClientTransport implements Transport { + private _eventSource?; + private _endpoint?; + private _abortController?; + private _url; + onclose?: () => void; + onerror?: (error: Error) => void; + onmessage?: (message: JSONRPCMessage) => void; + constructor(url: URL); + start(): Promise; + close(): Promise; + send(message: JSONRPCMessage): Promise; +} +//# sourceMappingURL=sse.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/client/sse.d.ts.map b/front_end/third_party/mcp-sdk/zod/dist/client/sse.d.ts.map new file mode 100644 index 0000000000..9f77c54f0a --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/client/sse.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"sse.d.ts","sourceRoot":"","sources":["../../src/client/sse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAwB,MAAM,aAAa,CAAC;AAEnE;;;;;GAKG;AACH,qBAAa,kBAAmB,YAAW,SAAS;IAClD,OAAO,CAAC,YAAY,CAAC,CAAc;IACnC,OAAO,CAAC,SAAS,CAAC,CAAM;IACxB,OAAO,CAAC,gBAAgB,CAAC,CAAkB;IAC3C,OAAO,CAAC,IAAI,CAAM;IAElB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;gBAElC,GAAG,EAAE,GAAG;IAIpB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAyDhB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAMtB,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CA0BnD"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/client/sse.js b/front_end/third_party/mcp-sdk/zod/dist/client/sse.js new file mode 100644 index 0000000000..5dac069137 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/client/sse.js @@ -0,0 +1,91 @@ +import { JSONRPCMessageSchema } from "../types.js"; +/** + * Client transport for SSE: this will connect to a server using Server-Sent Events for receiving + * messages and make separate POST requests for sending messages. + * + * This uses the EventSource API in browsers. You can install the `eventsource` package for Node.js. + */ +export class SSEClientTransport { + constructor(url) { + this._url = url; + } + start() { + if (this._eventSource) { + throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically."); + } + return new Promise((resolve, reject) => { + this._eventSource = new EventSource(this._url.href); + this._abortController = new AbortController(); + this._eventSource.onerror = (event) => { + var _a; + const error = new Error(`SSE error: ${JSON.stringify(event)}`); + reject(error); + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + }; + this._eventSource.onopen = () => { + // The connection is open, but we need to wait for the endpoint to be received. + }; + this._eventSource.addEventListener("endpoint", (event) => { + var _a; + const messageEvent = event; + try { + this._endpoint = new URL(messageEvent.data, this._url); + if (this._endpoint.origin !== this._url.origin) { + throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`); + } + } + catch (error) { + reject(error); + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + void this.close(); + return; + } + resolve(); + }); + this._eventSource.onmessage = (event) => { + var _a, _b; + const messageEvent = event; + let message; + try { + message = JSONRPCMessageSchema.parse(JSON.parse(messageEvent.data)); + } + catch (error) { + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + return; + } + (_b = this.onmessage) === null || _b === void 0 ? void 0 : _b.call(this, message); + }; + }); + } + async close() { + var _a, _b, _c; + (_a = this._abortController) === null || _a === void 0 ? void 0 : _a.abort(); + (_b = this._eventSource) === null || _b === void 0 ? void 0 : _b.close(); + (_c = this.onclose) === null || _c === void 0 ? void 0 : _c.call(this); + } + async send(message) { + var _a, _b; + if (!this._endpoint) { + throw new Error("Not connected"); + } + try { + const response = await fetch(this._endpoint, { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(message), + signal: (_a = this._abortController) === null || _a === void 0 ? void 0 : _a.signal, + }); + if (!response.ok) { + const text = await response.text().catch(() => null); + throw new Error(`Error POSTing to endpoint (HTTP ${response.status}): ${text}`); + } + } + catch (error) { + (_b = this.onerror) === null || _b === void 0 ? void 0 : _b.call(this, error); + throw error; + } + } +} +//# sourceMappingURL=sse.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/client/sse.js.map b/front_end/third_party/mcp-sdk/zod/dist/client/sse.js.map new file mode 100644 index 0000000000..706813a404 --- /dev/null +++ b/front_end/third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AK,CAAC,eAAe,CAAC,CAAC;QACnC,CAAC;QAED,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,SAAS,EAAE;gBAC3C,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE;oBACP,cAAc,EAAE,kBAAkB;iBACnC;gBACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;gBAC7B,MAAM,EAAE,MAAA,IAAI,CAAC,gBAAgB,0CAAE,MAAM;aACtC,CAAC,CAAC;YAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;gBACjB,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;gBACrD,MAAM,IAAI,KAAK,CACb,mCAAmC,QAAQ,CAAC,MAAM,MAAM,IAAI,EAAE,CAC/D,CAAC;YACJ,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAA,IAAI,CAAC,OAAO,qDAAG,KAAc,CAAC,CAAC;YAC/B,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/client/stdio.d.ts b/front_end/third_party/mcp-sdk/zod/dist/client/stdio.d.ts new file mode 100644 index 0000000000..a33b7a5f09 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/client/stdio.d.ts @@ -0,0 +1,63 @@ +import { IOType } from "node:child_process"; +import { JSONRPCMessage } from "../types.js"; +import { Transport } from "../shared/transport.js"; +import { Stream } from "node:stream"; +export type StdioServerParameters = { + /** + * The executable to run to start the server. + */ + command: string; + /** + * Command line arguments to pass to the executable. + */ + args?: string[]; + /** + * The environment to use when spawning the process. + * + * If not specified, the result of getDefaultEnvironment() will be used. + */ + env?: Record; + /** + * How to handle stderr of the child process. This matches the semantics of Node's `child_process.spawn`. + * + * The default is "inherit", meaning messages to stderr will be printed to the parent process's stderr. + */ + stderr?: IOType | Stream | number; +}; +/** + * Environment variables to inherit by default, if an environment is not explicitly given. + */ +export declare const DEFAULT_INHERITED_ENV_VARS: string[]; +/** + * Returns a default environment object including only environment variables deemed safe to inherit. + */ +export declare function getDefaultEnvironment(): Record; +/** + * Client transport for stdio: this will connect to a server by spawning a process and communicating with it over stdin/stdout. + * + * This transport is only available in Node.js environments. + */ +export declare class StdioClientTransport implements Transport { + private _process?; + private _abortController; + private _readBuffer; + private _serverParams; + onclose?: () => void; + onerror?: (error: Error) => void; + onmessage?: (message: JSONRPCMessage) => void; + constructor(server: StdioServerParameters); + /** + * Starts the server process and prepares to communicate with it. + */ + start(): Promise; + /** + * The stderr stream of the child process, if `StdioServerParameters.stderr` was set to "pipe" or "overlapped". + * + * This is only available after the process has been started. + */ + get stderr(): Stream | null; + private processReadBuffer; + close(): Promise; + send(message: JSONRPCMessage): Promise; +} +//# sourceMappingURL=stdio.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/client/stdio.d.ts.map b/front_end/third_party/mcp-sdk/zod/dist/client/stdio.d.ts.map new file mode 100644 index 0000000000..8ff96a51cc --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/client/stdio.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"stdio.d.ts","sourceRoot":"","sources":["../../src/client/stdio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,MAAM,EAAS,MAAM,oBAAoB,CAAC;AAGjE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAEhB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE7B;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;CACnC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,UAgBmB,CAAC;AAE3D;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAkB9D;AAED;;;;GAIG;AACH,qBAAa,oBAAqB,YAAW,SAAS;IACpD,OAAO,CAAC,QAAQ,CAAC,CAAe;IAChC,OAAO,CAAC,gBAAgB,CAA0C;IAClE,OAAO,CAAC,WAAW,CAAgC;IACnD,OAAO,CAAC,aAAa,CAAwB;IAE7C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;gBAElC,MAAM,EAAE,qBAAqB;IAIzC;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAuD5B;;;;OAIG;IACH,IAAI,MAAM,IAAI,MAAM,GAAG,IAAI,CAE1B;IAED,OAAO,CAAC,iBAAiB;IAenB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAM5B,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAc7C"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/client/stdio.js b/front_end/third_party/mcp-sdk/zod/dist/client/stdio.js new file mode 100644 index 0000000000..332689ecd7 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/client/stdio.js @@ -0,0 +1,148 @@ +import { spawn } from "node:child_process"; +import process from "node:process"; +import { ReadBuffer, serializeMessage } from "../shared/stdio.js"; +/** + * Environment variables to inherit by default, if an environment is not explicitly given. + */ +export const DEFAULT_INHERITED_ENV_VARS = process.platform === "win32" + ? [ + "APPDATA", + "HOMEDRIVE", + "HOMEPATH", + "LOCALAPPDATA", + "PATH", + "PROCESSOR_ARCHITECTURE", + "SYSTEMDRIVE", + "SYSTEMROOT", + "TEMP", + "USERNAME", + "USERPROFILE", + ] + : /* list inspired by the default env inheritance of sudo */ + ["HOME", "LOGNAME", "PATH", "SHELL", "TERM", "USER"]; +/** + * Returns a default environment object including only environment variables deemed safe to inherit. + */ +export function getDefaultEnvironment() { + const env = {}; + for (const key of DEFAULT_INHERITED_ENV_VARS) { + const value = process.env[key]; + if (value === undefined) { + continue; + } + if (value.startsWith("()")) { + // Skip functions, which are a security risk. + continue; + } + env[key] = value; + } + return env; +} +/** + * Client transport for stdio: this will connect to a server by spawning a process and communicating with it over stdin/stdout. + * + * This transport is only available in Node.js environments. + */ +export class StdioClientTransport { + constructor(server) { + this._abortController = new AbortController(); + this._readBuffer = new ReadBuffer(); + this._serverParams = server; + } + /** + * Starts the server process and prepares to communicate with it. + */ + async start() { + if (this._process) { + throw new Error("StdioClientTransport already started! If using Client class, note that connect() calls start() automatically."); + } + return new Promise((resolve, reject) => { + var _a, _b, _c, _d, _e, _f; + this._process = spawn(this._serverParams.command, (_a = this._serverParams.args) !== null && _a !== void 0 ? _a : [], { + env: (_b = this._serverParams.env) !== null && _b !== void 0 ? _b : getDefaultEnvironment(), + stdio: ["pipe", "pipe", (_c = this._serverParams.stderr) !== null && _c !== void 0 ? _c : "inherit"], + shell: false, + signal: this._abortController.signal, + windowsHide: process.platform === "win32" && isElectron(), + }); + this._process.on("error", (error) => { + var _a, _b; + if (error.name === "AbortError") { + // Expected when close() is called. + (_a = this.onclose) === null || _a === void 0 ? void 0 : _a.call(this); + return; + } + reject(error); + (_b = this.onerror) === null || _b === void 0 ? void 0 : _b.call(this, error); + }); + this._process.on("spawn", () => { + resolve(); + }); + this._process.on("close", (_code) => { + var _a; + this._process = undefined; + (_a = this.onclose) === null || _a === void 0 ? void 0 : _a.call(this); + }); + (_d = this._process.stdin) === null || _d === void 0 ? void 0 : _d.on("error", (error) => { + var _a; + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + }); + (_e = this._process.stdout) === null || _e === void 0 ? void 0 : _e.on("data", (chunk) => { + this._readBuffer.append(chunk); + this.processReadBuffer(); + }); + (_f = this._process.stdout) === null || _f === void 0 ? void 0 : _f.on("error", (error) => { + var _a; + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + }); + }); + } + /** + * The stderr stream of the child process, if `StdioServerParameters.stderr` was set to "pipe" or "overlapped". + * + * This is only available after the process has been started. + */ + get stderr() { + var _a, _b; + return (_b = (_a = this._process) === null || _a === void 0 ? void 0 : _a.stderr) !== null && _b !== void 0 ? _b : null; + } + processReadBuffer() { + var _a, _b; + while (true) { + try { + const message = this._readBuffer.readMessage(); + if (message === null) { + break; + } + (_a = this.onmessage) === null || _a === void 0 ? void 0 : _a.call(this, message); + } + catch (error) { + (_b = this.onerror) === null || _b === void 0 ? void 0 : _b.call(this, error); + } + } + } + async close() { + this._abortController.abort(); + this._process = undefined; + this._readBuffer.clear(); + } + send(message) { + return new Promise((resolve) => { + var _a; + if (!((_a = this._process) === null || _a === void 0 ? void 0 : _a.stdin)) { + throw new Error("Not connected"); + } + const json = serializeMessage(message); + if (this._process.stdin.write(json)) { + resolve(); + } + else { + this._process.stdin.once("drain", resolve); + } + }); + } +} +function isElectron() { + return "type" in process; +} +//# sourceMappingURL=stdio.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/client/stdio.js.map b/front_end/third_party/mcp-sdk/zod/dist/client/stdio.js.map new file mode 100644 index 0000000000..63b899076d --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/client/stdio.js.map @@ -0,0 +1 @@ +{"version":3,"file":"stdio.js","sourceRoot":"","sources":["../../src/client/stdio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,EAAE,MAAM,oBAAoB,C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;QAC1B,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;IAC3B,CAAC;IAED,IAAI,CAAC,OAAuB;QAC1B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;;YAC7B,IAAI,CAAC,CAAA,MAAA,IAAI,CAAC,QAAQ,0CAAE,KAAK,CAAA,EAAE,CAAC;gBAC1B,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;YACnC,CAAC;YAED,MAAM,IAAI,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;YACvC,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;gBACpC,OAAO,EAAE,CAAC;YACZ,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAC7C,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAED,SAAS,UAAU;IACjB,OAAO,MAAM,IAAI,OAAO,CAAC;AAC3B,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/client/stdio.test.d.ts b/front_end/third_party/mcp-sdk/zod/dist/client/stdio.test.d.ts new file mode 100644 index 0000000000..08756f1fed --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/client/stdio.test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=stdio.test.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/client/stdio.test.d.ts.map b/front_end/third_party/mcp-sdk/zod/dist/client/stdio.test.d.ts.map new file mode 100644 index 0000000000..57c12671a1 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/client/stdio.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"stdio.test.d.ts","sourceRoot":"","sources":["../../src/client/stdio.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/client/stdio.test.js b/front_end/third_party/mcp-sdk/zod/dist/client/stdio.test.js new file mode 100644 index 0000000000..5ddf1c7d25 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/client/stdio.test.js @@ -0,0 +1,51 @@ +import { StdioClientTransport } from "./stdio.js"; +const serverParameters = { + command: "/usr/bin/tee", +}; +test("should start then close cleanly", async () => { + const client = new StdioClientTransport(serverParameters); + client.onerror = (error) => { + throw error; + }; + let didClose = false; + client.onclose = () => { + didClose = true; + }; + await client.start(); + expect(didClose).toBeFalsy(); + await client.close(); + expect(didClose).toBeTruthy(); +}); +test("should read messages", async () => { + const client = new StdioClientTransport(serverParameters); + client.onerror = (error) => { + throw error; + }; + const messages = [ + { + jsonrpc: "2.0", + id: 1, + method: "ping", + }, + { + jsonrpc: "2.0", + method: "notifications/initialized", + }, + ]; + const readMessages = []; + const finished = new Promise((resolve) => { + client.onmessage = (message) => { + readMessages.push(message); + if (JSON.stringify(message) === JSON.stringify(messages[1])) { + resolve(); + } + }; + }); + await client.start(); + await client.send(messages[0]); + await client.send(messages[1]); + await finished; + expect(readMessages).toEqual(messages); + await client.close(); +}); +//# sourceMappingURL=stdio.test.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/client/stdio.test.js.map b/front_end/third_party/mcp-sdk/zod/dist/client/stdio.test.js.map new file mode 100644 index 0000000000..1af871c485 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/client/stdio.test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"stdio.test.js","sourceRoot":"","sources":["../../src/client/stdio.test.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAyB,MAAM,YAAY,CAAC;AAEzE,MAAM,gBAAgB,GAA0B;IAC9C,OAAO,EAAE,cAAc;CACxB,CAAC;AAEF,IAAI,CAAC,iCAAiC,EAAE,KAAK,IAAI,EAAE;IACjD,MAAM,MAAM,GAAG,IAAI,oBAAoB,CAAC,gBA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CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;IACrB,MAAM,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/B,MAAM,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/B,MAAM,QAAQ,CAAC;IACf,MAAM,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAEvC,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;AACvB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/client/websocket.d.ts b/front_end/third_party/mcp-sdk/zod/dist/client/websocket.d.ts new file mode 100644 index 0000000000..53945e788c --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/client/websocket.d.ts @@ -0,0 +1,17 @@ +import { Transport } from "../shared/transport.js"; +import { JSONRPCMessage } from "../types.js"; +/** + * Client transport for WebSocket: this will connect to a server over the WebSocket protocol. + */ +export declare class WebSocketClientTransport implements Transport { + private _socket?; + private _url; + onclose?: () => void; + onerror?: (error: Error) => void; + onmessage?: (message: JSONRPCMessage) => void; + constructor(url: URL); + start(): Promise; + close(): Promise; + send(message: JSONRPCMessage): Promise; +} +//# sourceMappingURL=websocket.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/client/websocket.d.ts.map b/front_end/third_party/mcp-sdk/zod/dist/client/websocket.d.ts.map new file mode 100644 index 0000000000..95d177c0f6 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/client/websocket.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"websocket.d.ts","sourceRoot":"","sources":["../../src/client/websocket.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAwB,MAAM,aAAa,CAAC;AAInE;;GAEG;AACH,qBAAa,wBAAyB,YAAW,SAAS;IACxD,OAAO,CAAC,OAAO,CAAC,CAAY;IAC5B,OAAO,CAAC,IAAI,CAAM;IAElB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;gBAElC,GAAG,EAAE,GAAG;IAIpB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAyChB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAI5B,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAW7C"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/client/websocket.js b/front_end/third_party/mcp-sdk/zod/dist/client/websocket.js new file mode 100644 index 0000000000..a424f3b569 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/client/websocket.js @@ -0,0 +1,61 @@ +import { JSONRPCMessageSchema } from "../types.js"; +const SUBPROTOCOL = "mcp"; +/** + * Client transport for WebSocket: this will connect to a server over the WebSocket protocol. + */ +export class WebSocketClientTransport { + constructor(url) { + this._url = url; + } + start() { + if (this._socket) { + throw new Error("WebSocketClientTransport already started! If using Client class, note that connect() calls start() automatically."); + } + return new Promise((resolve, reject) => { + this._socket = new WebSocket(this._url, SUBPROTOCOL); + this._socket.onerror = (event) => { + var _a; + const error = "error" in event + ? event.error + : new Error(`WebSocket error: ${JSON.stringify(event)}`); + reject(error); + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + }; + this._socket.onopen = () => { + resolve(); + }; + this._socket.onclose = () => { + var _a; + (_a = this.onclose) === null || _a === void 0 ? void 0 : _a.call(this); + }; + this._socket.onmessage = (event) => { + var _a, _b; + let message; + try { + message = JSONRPCMessageSchema.parse(JSON.parse(event.data)); + } + catch (error) { + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + return; + } + (_b = this.onmessage) === null || _b === void 0 ? void 0 : _b.call(this, message); + }; + }); + } + async close() { + var _a; + (_a = this._socket) === null || _a === void 0 ? void 0 : _a.close(); + } + send(message) { + return new Promise((resolve, reject) => { + var _a; + if (!this._socket) { + reject(new Error("Not connected")); + return; + } + (_a = this._socket) === null || _a === void 0 ? void 0 : _a.send(JSON.stringify(message)); + resolve(); + }); + } +} +//# sourceMappingURL=websocket.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/client/websocket.js.map b/front_end/third_party/mcp-sdk/zod/dist/client/websocket.js.map new file mode 100644 index 0000000000..8e62681460 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/client/websocket.js.map @@ -0,0 +1 @@ +{"version":3,"file":"websocket.js","sourceRoot":"","sources":["../../src/client/websocket.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnE,MAAM,WAAW,GAAG,KAAK,CAAC;AAE1B;;GAEG;AACH,MAAM,OAAO,wBAAwB;IAQnC,YAAY,GAAQ;QAClB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;IAClB,CAAC;IAED,KAAK;QACH,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CACb,mHAAmH,CACpH,CAAC;QACJ,CAAC;QAED,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,IAAI,CAAC,OAAO,GAAG,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;YAErD,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,CAAC,KAAK,EAAE,EAAE;;gBAC/B,MAAM,KAAK,GACT,OAAO,IAAI,KAAK;oBACd,CAAC,CAAE,KAAK,CAAC,KAAe;oBACxB,CAAC,CAAC,IAAI,KAAK,CAAC,oBAAoB,IAAI,CAAC,SAA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CAAC;YAC5C,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC,CAAC;IACL,CAAC;CACF"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/inMemory.d.ts b/front_end/third_party/mcp-sdk/zod/dist/inMemory.d.ts new file mode 100644 index 0000000000..326150354e --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/inMemory.d.ts @@ -0,0 +1,20 @@ +import { Transport } from "./shared/transport.js"; +import { JSONRPCMessage } from "./types.js"; +/** + * In-memory transport for creating clients and servers that talk to each other within the same process. + */ +export declare class InMemoryTransport implements Transport { + private _otherTransport?; + private _messageQueue; + onclose?: () => void; + onerror?: (error: Error) => void; + onmessage?: (message: JSONRPCMessage) => void; + /** + * Creates a pair of linked in-memory transports that can communicate with each other. One should be passed to a Client and one to a Server. + */ + static createLinkedPair(): [InMemoryTransport, InMemoryTransport]; + start(): Promise; + close(): Promise; + send(message: JSONRPCMessage): Promise; +} +//# sourceMappingURL=inMemory.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/inMemory.d.ts.map b/front_end/third_party/mcp-sdk/zod/dist/inMemory.d.ts.map new file mode 100644 index 0000000000..1d11ae50ee --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/inMemory.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inMemory.d.ts","sourceRoot":"","sources":["../src/inMemory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C;;GAEG;AACH,qBAAa,iBAAkB,YAAW,SAAS;IACjD,OAAO,CAAC,eAAe,CAAC,CAAoB;IAC5C,OAAO,CAAC,aAAa,CAAwB;IAE7C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;IAE9C;;OAEG;IACH,MAAM,CAAC,gBAAgB,IAAI,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAQ3D,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAUtB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAOtB,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAWnD"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/inMemory.js b/front_end/third_party/mcp-sdk/zod/dist/inMemory.js new file mode 100644 index 0000000000..c4689a2d37 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/inMemory.js @@ -0,0 +1,47 @@ +/** + * In-memory transport for creating clients and servers that talk to each other within the same process. + */ +export class InMemoryTransport { + constructor() { + this._messageQueue = []; + } + /** + * Creates a pair of linked in-memory transports that can communicate with each other. One should be passed to a Client and one to a Server. + */ + static createLinkedPair() { + const clientTransport = new InMemoryTransport(); + const serverTransport = new InMemoryTransport(); + clientTransport._otherTransport = serverTransport; + serverTransport._otherTransport = clientTransport; + return [clientTransport, serverTransport]; + } + async start() { + var _a; + // Process any messages that were queued before start was called + while (this._messageQueue.length > 0) { + const message = this._messageQueue.shift(); + if (message) { + (_a = this.onmessage) === null || _a === void 0 ? void 0 : _a.call(this, message); + } + } + } + async close() { + var _a; + const other = this._otherTransport; + this._otherTransport = undefined; + await (other === null || other === void 0 ? void 0 : other.close()); + (_a = this.onclose) === null || _a === void 0 ? void 0 : _a.call(this); + } + async send(message) { + if (!this._otherTransport) { + throw new Error("Not connected"); + } + if (this._otherTransport.onmessage) { + this._otherTransport.onmessage(message); + } + else { + this._otherTransport._messageQueue.push(message); + } + } +} +//# sourceMappingURL=inMemory.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/inMemory.js.map b/front_end/third_party/mcp-sdk/zod/dist/inMemory.js.map new file mode 100644 index 0000000000..34738386c0 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/inMemory.js.map @@ -0,0 +1 @@ +{"version":3,"file":"inMemory.js","sourceRoot":"","sources":["../src/inMemory.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,OAAO,iBAAiB;IAA9B;QAEU,kBAAa,GAAqB,EAAE,CAAC;IA6C/C,CAAC;IAvCC;;OAEG;IACH,MAAM,CAAC,gBAAgB;QACrB,MAAM,eAAe,GAAG,IAAI,iBAAiB,EAAE,CAAC;QAChD,MAAM,eAAe,GAAG,IAAI,iBAAiB,EAAE,CAAC;QAChD,eAAe,CAAC,eAAe,GAAG,eAAe,CAAC;QAClD,eAAe,CAAC,eAAe,GAAG,eAAe,CAAC;QAClD,OAAO,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,KAAK;;QACT,gEAAgE;QAChE,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACrC,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;YAC3C,IAAI,OAAO,EAAE,CAAC;gBACZ,MAAA,IAAI,CAAC,SAAS,qDAAG,OAAO,CAAC,CAAC;YAC5B,CAAC;QACH,CAAC;IACH,CAAC;IAED,KAAK,CAAC,KAAK;;QACT,MAAM,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC;QACnC,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC;QACjC,MAAM,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK,EAAE,CAAA,CAAC;QACrB,MAAA,IAAI,CAAC,OAAO,oDAAI,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,OAAuB;QAChC,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;QACnC,CAAC;QAED,IAAI,IAAI,CAAC,eAAe,CAAC,SAAS,EAAE,CAAC;YACnC,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QAC1C,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACnD,CAAC;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/inMemory.test.d.ts b/front_end/third_party/mcp-sdk/zod/dist/inMemory.test.d.ts new file mode 100644 index 0000000000..a201a0e9a0 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/inMemory.test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=inMemory.test.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/inMemory.test.d.ts.map b/front_end/third_party/mcp-sdk/zod/dist/inMemory.test.d.ts.map new file mode 100644 index 0000000000..c9bb4d7878 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/inMemory.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inMemory.test.d.ts","sourceRoot":"","sources":["../src/inMemory.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/inMemory.test.js b/front_end/third_party/mcp-sdk/zod/dist/inMemory.test.js new file mode 100644 index 0000000000..7a5703ee8a --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/inMemory.test.js @@ -0,0 +1,74 @@ +import { InMemoryTransport } from "./inMemory.js"; +describe("InMemoryTransport", () => { + let clientTransport; + let serverTransport; + beforeEach(() => { + [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair(); + }); + test("should create linked pair", () => { + expect(clientTransport).toBeDefined(); + expect(serverTransport).toBeDefined(); + }); + test("should start without error", async () => { + await expect(clientTransport.start()).resolves.not.toThrow(); + await expect(serverTransport.start()).resolves.not.toThrow(); + }); + test("should send message from client to server", async () => { + const message = { + jsonrpc: "2.0", + method: "test", + id: 1, + }; + let receivedMessage; + serverTransport.onmessage = (msg) => { + receivedMessage = msg; + }; + await clientTransport.send(message); + expect(receivedMessage).toEqual(message); + }); + test("should send message from server to client", async () => { + const message = { + jsonrpc: "2.0", + method: "test", + id: 1, + }; + let receivedMessage; + clientTransport.onmessage = (msg) => { + receivedMessage = msg; + }; + await serverTransport.send(message); + expect(receivedMessage).toEqual(message); + }); + test("should handle close", async () => { + let clientClosed = false; + let serverClosed = false; + clientTransport.onclose = () => { + clientClosed = true; + }; + serverTransport.onclose = () => { + serverClosed = true; + }; + await clientTransport.close(); + expect(clientClosed).toBe(true); + expect(serverClosed).toBe(true); + }); + test("should throw error when sending after close", async () => { + await clientTransport.close(); + await expect(clientTransport.send({ jsonrpc: "2.0", method: "test", id: 1 })).rejects.toThrow("Not connected"); + }); + test("should queue messages sent before start", async () => { + const message = { + jsonrpc: "2.0", + method: "test", + id: 1, + }; + let receivedMessage; + serverTransport.onmessage = (msg) => { + receivedMessage = msg; + }; + await clientTransport.send(message); + await serverTransport.start(); + expect(receivedMessage).toEqual(message); + }); +}); +//# sourceMappingURL=inMemory.test.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/inMemory.test.js.map b/front_end/third_party/mcp-sdk/zod/dist/inMemory.test.js.map new file mode 100644 index 0000000000..9f9f240e06 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/inMemory.test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"inMemory.test.js","sourceRoot":"","sources":["../src/inMemory.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAGlD,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,IAAI,eAAkC,CAAC;IACvC,IAAI,eAAkC,CAAC;IAEvC,UAAU,CAAC,GAAG,EAAE;QACd,CAAC,eAAe,EAAE,eAAe,CAAC,GAAG,iBAAiB,CAAC,gBAAgB,EAAE,CAAC;IAC5E,CAAC,C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AAC,OAAO,CAAC,CAAC;QACpC,MAAM,eAAe,CAAC,KAAK,EAAE,CAAC;QAC9B,MAAM,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/server/index.d.ts b/front_end/third_party/mcp-sdk/zod/dist/server/index.d.ts new file mode 100644 index 0000000000..2dbc605567 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/server/index.d.ts @@ -0,0 +1,112 @@ +import { Protocol, ProtocolOptions, RequestOptions } from "../shared/protocol.js"; +import { ClientCapabilities, CreateMessageRequest, Implementation, ListRootsRequest, LoggingMessageNotification, Notification, Request, ResourceUpdatedNotification, Result, ServerCapabilities, ServerNotification, ServerRequest, ServerResult } from "../types.js"; +export type ServerOptions = ProtocolOptions & { + /** + * Capabilities to advertise as being supported by this server. + */ + capabilities: ServerCapabilities; +}; +/** + * An MCP server on top of a pluggable transport. + * + * This server will automatically respond to the initialization flow as initiated from the client. + * + * To use with custom types, extend the base Request/Notification/Result types and pass them as type parameters: + * + * ```typescript + * // Custom schemas + * const CustomRequestSchema = RequestSchema.extend({...}) + * const CustomNotificationSchema = NotificationSchema.extend({...}) + * const CustomResultSchema = ResultSchema.extend({...}) + * + * // Type aliases + * type CustomRequest = z.infer + * type CustomNotification = z.infer + * type CustomResult = z.infer + * + * // Create typed server + * const server = new Server({ + * name: "CustomServer", + * version: "1.0.0" + * }) + * ``` + */ +export declare class Server extends Protocol { + private _serverInfo; + private _clientCapabilities?; + private _clientVersion?; + private _capabilities; + /** + * Callback for when initialization has fully completed (i.e., the client has sent an `initialized` notification). + */ + oninitialized?: () => void; + /** + * Initializes this server with the given name and version information. + */ + constructor(_serverInfo: Implementation, options: ServerOptions); + protected assertCapabilityForMethod(method: RequestT["method"]): void; + protected assertNotificationCapability(method: (ServerNotification | NotificationT)["method"]): void; + protected assertRequestHandlerCapability(method: string): void; + private _oninitialize; + /** + * After initialization has completed, this will be populated with the client's reported capabilities. + */ + getClientCapabilities(): ClientCapabilities | undefined; + /** + * After initialization has completed, this will be populated with information about the client's name and version. + */ + getClientVersion(): Implementation | undefined; + private getCapabilities; + ping(): Promise<{ + _meta?: import("zod").objectOutputType<{}, import("zod").ZodTypeAny, "passthrough"> | undefined; + }>; + createMessage(params: CreateMessageRequest["params"], options?: RequestOptions): Promise, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + model: import("zod").ZodString; + stopReason: import("zod").ZodOptional, import("zod").ZodString]>>; + role: import("zod").ZodEnum<["user", "assistant"]>; + content: import("zod").ZodDiscriminatedUnion<"type", [import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"text">; + text: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + type: import("zod").ZodLiteral<"image">; + data: import("zod").ZodString; + mimeType: import("zod").ZodString; + }, import("zod").ZodTypeAny, "passthrough">>]>; + }>, import("zod").ZodTypeAny, "passthrough">>; + listRoots(params?: ListRootsRequest["params"], options?: RequestOptions): Promise, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>; + }, { + roots: import("zod").ZodArray; + }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{ + uri: import("zod").ZodString; + name: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{ + uri: import("zod").ZodString; + name: import("zod").ZodOptional; + }, import("zod").ZodTypeAny, "passthrough">>, "many">; + }>, import("zod").ZodTypeAny, "passthrough">>; + sendLoggingMessage(params: LoggingMessageNotification["params"]): Promise; + sendResourceUpdated(params: ResourceUpdatedNotification["params"]): Promise; + sendResourceListChanged(): Promise; + sendToolListChanged(): Promise; + sendPromptListChanged(): Promise; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/server/index.d.ts.map b/front_end/third_party/mcp-sdk/zod/dist/server/index.d.ts.map new file mode 100644 index 0000000000..fc58897994 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/server/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,eAAe,EACf,cAAc,EACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EAGpB,cAAc,EAMd,gBAAgB,EAEhB,0BAA0B,EAC1B,YAAY,EACZ,OAAO,EACP,2BAA2B,EAC3B,MAAM,EACN,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,YAAY,EAEb,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,aAAa,GAAG,eAAe,GAAG;IAC5C;;OAEG;IACH,YAAY,EAAE,kBAAkB,CAAC;CAClC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,qBAAa,MAAM,CACjB,QAAQ,SAAS,OAAO,GAAG,OAAO,EAClC,aAAa,SAAS,YAAY,GAAG,YAAY,EACjD,OAAO,SAAS,MAAM,GAAG,MAAM,CAC/B,SAAQ,QAAQ,CAChB,aAAa,GAAG,QAAQ,EACxB,kBAAkB,GAAG,aAAa,EAClC,YAAY,GAAG,OAAO,CACvB;IAcG,OAAO,CAAC,WAAW;IAbrB,OAAO,CAAC,mBAAmB,CAAC,CAAqB;IACjD,OAAO,CAAC,cAAc,CAAC,CAAiB;IACxC,OAAO,CAAC,aAAa,CAAqB;IAE1C;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAE3B;;OAEG;gBAEO,WAAW,EAAE,cAAc,EACnC,OAAO,EAAE,aAAa;IAaxB,SAAS,CAAC,yBAAyB,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,GAAG,IAAI;IAwBrE,SAAS,CAAC,4BAA4B,CACpC,MAAM,EAAE,CAAC,kBAAkB,GAAG,aAAa,CAAC,CAAC,QAAQ,CAAC,GACrD,IAAI;IA6CP,SAAS,CAAC,8BAA8B,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;YAqDhD,aAAa;IAiB3B;;OAEG;IACH,qBAAqB,IAAI,kBAAkB,GAAG,SAAS;IAIvD;;OAEG;IACH,gBAAgB,IAAI,cAAc,GAAG,SAAS;IAI9C,OAAO,CAAC,eAAe;IAIjB,IAAI;;;IAIJ,aAAa,CACjB,MAAM,EAAE,oBAAoB,CAAC,QAAQ,CAAC,EACtC,OAAO,CAAC,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IASpB,SAAS,CACb,MAAM,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,EACnC,OAAO,CAAC,EAAE,cAAc;;;;;;;;;;;;;;IASpB,kBAAkB,CAAC,MAAM,EAAE,0BAA0B,CAAC,QAAQ,CAAC;IAI/D,mBAAmB,CAAC,MAAM,EAAE,2BAA2B,CAAC,QAAQ,CAAC;IAOjE,uBAAuB;IAMvB,mBAAmB;IAInB,qBAAqB;CAG5B"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/server/index.js b/front_end/third_party/mcp-sdk/zod/dist/server/index.js new file mode 100644 index 0000000000..84e79b4519 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/server/index.js @@ -0,0 +1,182 @@ +import { Protocol, } from "../shared/protocol.js"; +import { CreateMessageResultSchema, EmptyResultSchema, InitializedNotificationSchema, InitializeRequestSchema, LATEST_PROTOCOL_VERSION, ListRootsResultSchema, SUPPORTED_PROTOCOL_VERSIONS, } from "../types.js"; +/** + * An MCP server on top of a pluggable transport. + * + * This server will automatically respond to the initialization flow as initiated from the client. + * + * To use with custom types, extend the base Request/Notification/Result types and pass them as type parameters: + * + * ```typescript + * // Custom schemas + * const CustomRequestSchema = RequestSchema.extend({...}) + * const CustomNotificationSchema = NotificationSchema.extend({...}) + * const CustomResultSchema = ResultSchema.extend({...}) + * + * // Type aliases + * type CustomRequest = z.infer + * type CustomNotification = z.infer + * type CustomResult = z.infer + * + * // Create typed server + * const server = new Server({ + * name: "CustomServer", + * version: "1.0.0" + * }) + * ``` + */ +export class Server extends Protocol { + /** + * Initializes this server with the given name and version information. + */ + constructor(_serverInfo, options) { + super(options); + this._serverInfo = _serverInfo; + this._capabilities = options.capabilities; + this.setRequestHandler(InitializeRequestSchema, (request) => this._oninitialize(request)); + this.setNotificationHandler(InitializedNotificationSchema, () => { var _a; return (_a = this.oninitialized) === null || _a === void 0 ? void 0 : _a.call(this); }); + } + assertCapabilityForMethod(method) { + var _a, _b; + switch (method) { + case "sampling/createMessage": + if (!((_a = this._clientCapabilities) === null || _a === void 0 ? void 0 : _a.sampling)) { + throw new Error(`Client does not support sampling (required for ${method})`); + } + break; + case "roots/list": + if (!((_b = this._clientCapabilities) === null || _b === void 0 ? void 0 : _b.roots)) { + throw new Error(`Client does not support listing roots (required for ${method})`); + } + break; + case "ping": + // No specific capability required for ping + break; + } + } + assertNotificationCapability(method) { + switch (method) { + case "notifications/message": + if (!this._capabilities.logging) { + throw new Error(`Server does not support logging (required for ${method})`); + } + break; + case "notifications/resources/updated": + case "notifications/resources/list_changed": + if (!this._capabilities.resources) { + throw new Error(`Server does not support notifying about resources (required for ${method})`); + } + break; + case "notifications/tools/list_changed": + if (!this._capabilities.tools) { + throw new Error(`Server does not support notifying of tool list changes (required for ${method})`); + } + break; + case "notifications/prompts/list_changed": + if (!this._capabilities.prompts) { + throw new Error(`Server does not support notifying of prompt list changes (required for ${method})`); + } + break; + case "notifications/cancelled": + // Cancellation notifications are always allowed + break; + case "notifications/progress": + // Progress notifications are always allowed + break; + } + } + assertRequestHandlerCapability(method) { + switch (method) { + case "sampling/createMessage": + if (!this._capabilities.sampling) { + throw new Error(`Server does not support sampling (required for ${method})`); + } + break; + case "logging/setLevel": + if (!this._capabilities.logging) { + throw new Error(`Server does not support logging (required for ${method})`); + } + break; + case "prompts/get": + case "prompts/list": + if (!this._capabilities.prompts) { + throw new Error(`Server does not support prompts (required for ${method})`); + } + break; + case "resources/list": + case "resources/templates/list": + case "resources/read": + if (!this._capabilities.resources) { + throw new Error(`Server does not support resources (required for ${method})`); + } + break; + case "tools/call": + case "tools/list": + if (!this._capabilities.tools) { + throw new Error(`Server does not support tools (required for ${method})`); + } + break; + case "ping": + case "initialize": + // No specific capability required for these methods + break; + } + } + async _oninitialize(request) { + const requestedVersion = request.params.protocolVersion; + this._clientCapabilities = request.params.capabilities; + this._clientVersion = request.params.clientInfo; + return { + protocolVersion: SUPPORTED_PROTOCOL_VERSIONS.includes(requestedVersion) + ? requestedVersion + : LATEST_PROTOCOL_VERSION, + capabilities: this.getCapabilities(), + serverInfo: this._serverInfo, + }; + } + /** + * After initialization has completed, this will be populated with the client's reported capabilities. + */ + getClientCapabilities() { + return this._clientCapabilities; + } + /** + * After initialization has completed, this will be populated with information about the client's name and version. + */ + getClientVersion() { + return this._clientVersion; + } + getCapabilities() { + return this._capabilities; + } + async ping() { + return this.request({ method: "ping" }, EmptyResultSchema); + } + async createMessage(params, options) { + return this.request({ method: "sampling/createMessage", params }, CreateMessageResultSchema, options); + } + async listRoots(params, options) { + return this.request({ method: "roots/list", params }, ListRootsResultSchema, options); + } + async sendLoggingMessage(params) { + return this.notification({ method: "notifications/message", params }); + } + async sendResourceUpdated(params) { + return this.notification({ + method: "notifications/resources/updated", + params, + }); + } + async sendResourceListChanged() { + return this.notification({ + method: "notifications/resources/list_changed", + }); + } + async sendToolListChanged() { + return this.notification({ method: "notifications/tools/list_changed" }); + } + async sendPromptListChanged() { + return this.notification({ method: "notifications/prompts/list_changed" }); + } +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/server/index.js.map b/front_end/third_party/mcp-sdk/zod/dist/server/index.js.map new file mode 100644 index 0000000000..adfcb8c1ee --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/server/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,GAGT,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAGL,yBAAyB,EACzB,iBAAiB,EAEjB,6BAA6B,EAE7B,uBAAuB,EAEvB,uBAAuB,EAEvB,qBAAqB,EAUrB,2BAA2B,GAC5B,MAAM,aAAa,CAAC;AASrB;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,OAAO,MAIX,SAAQ,QAIT;IAUC;;OAEG;IACH,YACU,WAA2B,EACnC,OAAsB;QAEtB,KAAK,CAAC,OAAO,CAAC,CAAC;QAHP,gBAAW,GAAX,WAAW,CAAgB;QAInC,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;QAE1C,IAAI,CAAC,iBAAiB,CAAC,uBAAuB,EAAE,CAAC,OAAO,EAAE,EAAE,CAC1D,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAC5B,CAAC;QACF,IAAI,CAAC,sBAAsB,CAAC,6BAA6B,EAAE,GAAG,EAAE,WAC9D,OAAA,MAAA,IAAI,CAAC,aAAa,oDAAI,CAAA,EAAA,CACvB,CAAC;IACJ,CAAC;IAES,yBAAyB,CAAC,MAA0B;;QAC5D,QAAQ,MAAiC,EAAE,CAAC;YAC1C,KAAK,w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E,CAAC,CAAC;IACxE,CAAC;IAED,KAAK,CAAC,mBAAmB,CAAC,MAA6C;QACrE,OAAO,IAAI,CAAC,YAAY,CAAC;YACvB,MAAM,EAAE,iCAAiC;YACzC,MAAM;SACP,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,uBAAuB;QAC3B,OAAO,IAAI,CAAC,YAAY,CAAC;YACvB,MAAM,EAAE,sCAAsC;SAC/C,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,mBAAmB;QACvB,OAAO,IAAI,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,kCAAkC,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED,KAAK,CAAC,qBAAqB;QACzB,OAAO,IAAI,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,oCAAoC,EAAE,CAAC,CAAC;IAC7E,CAAC;CACF"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/server/index.test.d.ts b/front_end/third_party/mcp-sdk/zod/dist/server/index.test.d.ts new file mode 100644 index 0000000000..121d59b38b --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/server/index.test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=index.test.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/server/index.test.d.ts.map b/front_end/third_party/mcp-sdk/zod/dist/server/index.test.d.ts.map new file mode 100644 index 0000000000..2bf7a5d156 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/server/index.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../src/server/index.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/server/index.test.js b/front_end/third_party/mcp-sdk/zod/dist/server/index.test.js new file mode 100644 index 0000000000..a0b2d05bd3 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/server/index.test.js @@ -0,0 +1,408 @@ +/* eslint-disable @typescript-eslint/no-unused-vars */ +/* eslint-disable no-constant-binary-expression */ +/* eslint-disable @typescript-eslint/no-unused-expressions */ +import { Server } from "./index.js"; +import { z } from "zod"; +import { RequestSchema, NotificationSchema, ResultSchema, LATEST_PROTOCOL_VERSION, SUPPORTED_PROTOCOL_VERSIONS, CreateMessageRequestSchema, ListPromptsRequestSchema, ListResourcesRequestSchema, ListToolsRequestSchema, SetLevelRequestSchema, ErrorCode, } from "../types.js"; +import { InMemoryTransport } from "../inMemory.js"; +import { Client } from "../client/index.js"; +test("should accept latest protocol version", async () => { + var _a; + let sendPromiseResolve; + const sendPromise = new Promise((resolve) => { + sendPromiseResolve = resolve; + }); + const serverTransport = { + start: jest.fn().mockResolvedValue(undefined), + close: jest.fn().mockResolvedValue(undefined), + send: jest.fn().mockImplementation((message) => { + if (message.id === 1 && message.result) { + expect(message.result).toEqual({ + protocolVersion: LATEST_PROTOCOL_VERSION, + capabilities: expect.any(Object), + serverInfo: { + name: "test server", + version: "1.0", + }, + }); + sendPromiseResolve(undefined); + } + return Promise.resolve(); + }), + }; + const server = new Server({ + name: "test server", + version: "1.0", + }, { + capabilities: { + prompts: {}, + resources: {}, + tools: {}, + logging: {}, + }, + }); + await server.connect(serverTransport); + // Simulate initialize request with latest version + (_a = serverTransport.onmessage) === null || _a === void 0 ? void 0 : _a.call(serverTransport, { + jsonrpc: "2.0", + id: 1, + method: "initialize", + params: { + protocolVersion: LATEST_PROTOCOL_VERSION, + capabilities: {}, + clientInfo: { + name: "test client", + version: "1.0", + }, + }, + }); + await expect(sendPromise).resolves.toBeUndefined(); +}); +test("should accept supported older protocol version", async () => { + var _a; + const OLD_VERSION = SUPPORTED_PROTOCOL_VERSIONS[1]; + let sendPromiseResolve; + const sendPromise = new Promise((resolve) => { + sendPromiseResolve = resolve; + }); + const serverTransport = { + start: jest.fn().mockResolvedValue(undefined), + close: jest.fn().mockResolvedValue(undefined), + send: jest.fn().mockImplementation((message) => { + if (message.id === 1 && message.result) { + expect(message.result).toEqual({ + protocolVersion: OLD_VERSION, + capabilities: expect.any(Object), + serverInfo: { + name: "test server", + version: "1.0", + }, + }); + sendPromiseResolve(undefined); + } + return Promise.resolve(); + }), + }; + const server = new Server({ + name: "test server", + version: "1.0", + }, { + capabilities: { + prompts: {}, + resources: {}, + tools: {}, + logging: {}, + }, + }); + await server.connect(serverTransport); + // Simulate initialize request with older version + (_a = serverTransport.onmessage) === null || _a === void 0 ? void 0 : _a.call(serverTransport, { + jsonrpc: "2.0", + id: 1, + method: "initialize", + params: { + protocolVersion: OLD_VERSION, + capabilities: {}, + clientInfo: { + name: "test client", + version: "1.0", + }, + }, + }); + await expect(sendPromise).resolves.toBeUndefined(); +}); +test("should handle unsupported protocol version", async () => { + var _a; + let sendPromiseResolve; + const sendPromise = new Promise((resolve) => { + sendPromiseResolve = resolve; + }); + const serverTransport = { + start: jest.fn().mockResolvedValue(undefined), + close: jest.fn().mockResolvedValue(undefined), + send: jest.fn().mockImplementation((message) => { + if (message.id === 1 && message.result) { + expect(message.result).toEqual({ + protocolVersion: LATEST_PROTOCOL_VERSION, + capabilities: expect.any(Object), + serverInfo: { + name: "test server", + version: "1.0", + }, + }); + sendPromiseResolve(undefined); + } + return Promise.resolve(); + }), + }; + const server = new Server({ + name: "test server", + version: "1.0", + }, { + capabilities: { + prompts: {}, + resources: {}, + tools: {}, + logging: {}, + }, + }); + await server.connect(serverTransport); + // Simulate initialize request with unsupported version + (_a = serverTransport.onmessage) === null || _a === void 0 ? void 0 : _a.call(serverTransport, { + jsonrpc: "2.0", + id: 1, + method: "initialize", + params: { + protocolVersion: "invalid-version", + capabilities: {}, + clientInfo: { + name: "test client", + version: "1.0", + }, + }, + }); + await expect(sendPromise).resolves.toBeUndefined(); +}); +test("should respect client capabilities", async () => { + const server = new Server({ + name: "test server", + version: "1.0", + }, { + capabilities: { + prompts: {}, + resources: {}, + tools: {}, + logging: {}, + }, + enforceStrictCapabilities: true, + }); + const client = new Client({ + name: "test client", + version: "1.0", + }, { + capabilities: { + sampling: {}, + }, + }); + // Implement request handler for sampling/createMessage + client.setRequestHandler(CreateMessageRequestSchema, async (request) => { + // Mock implementation of createMessage + return { + model: "test-model", + role: "assistant", + content: { + type: "text", + text: "This is a test response", + }, + }; + }); + const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair(); + await Promise.all([ + client.connect(clientTransport), + server.connect(serverTransport), + ]); + expect(server.getClientCapabilities()).toEqual({ sampling: {} }); + // This should work because sampling is supported by the client + await expect(server.createMessage({ + messages: [], + maxTokens: 10, + })).resolves.not.toThrow(); + // This should still throw because roots are not supported by the client + await expect(server.listRoots()).rejects.toThrow(/^Client does not support/); +}); +test("should respect server notification capabilities", async () => { + const server = new Server({ + name: "test server", + version: "1.0", + }, { + capabilities: { + logging: {}, + }, + enforceStrictCapabilities: true, + }); + const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair(); + await server.connect(serverTransport); + // This should work because logging is supported by the server + await expect(server.sendLoggingMessage({ + level: "info", + data: "Test log message", + })).resolves.not.toThrow(); + // This should throw because resource notificaitons are not supported by the server + await expect(server.sendResourceUpdated({ uri: "test://resource" })).rejects.toThrow(/^Server does not support/); +}); +test("should only allow setRequestHandler for declared capabilities", () => { + const server = new Server({ + name: "test server", + version: "1.0", + }, { + capabilities: { + prompts: {}, + resources: {}, + }, + }); + // These should work because the capabilities are declared + expect(() => { + server.setRequestHandler(ListPromptsRequestSchema, () => ({ prompts: [] })); + }).not.toThrow(); + expect(() => { + server.setRequestHandler(ListResourcesRequestSchema, () => ({ + resources: [], + })); + }).not.toThrow(); + // These should throw because the capabilities are not declared + expect(() => { + server.setRequestHandler(ListToolsRequestSchema, () => ({ tools: [] })); + }).toThrow(/^Server does not support tools/); + expect(() => { + server.setRequestHandler(SetLevelRequestSchema, () => ({})); + }).toThrow(/^Server does not support logging/); +}); +/* + Test that custom request/notification/result schemas can be used with the Server class. + */ +test("should typecheck", () => { + const GetWeatherRequestSchema = RequestSchema.extend({ + method: z.literal("weather/get"), + params: z.object({ + city: z.string(), + }), + }); + const GetForecastRequestSchema = RequestSchema.extend({ + method: z.literal("weather/forecast"), + params: z.object({ + city: z.string(), + days: z.number(), + }), + }); + const WeatherForecastNotificationSchema = NotificationSchema.extend({ + method: z.literal("weather/alert"), + params: z.object({ + severity: z.enum(["warning", "watch"]), + message: z.string(), + }), + }); + const WeatherRequestSchema = GetWeatherRequestSchema.or(GetForecastRequestSchema); + const WeatherNotificationSchema = WeatherForecastNotificationSchema; + const WeatherResultSchema = ResultSchema.extend({ + temperature: z.number(), + conditions: z.string(), + }); + // Create a typed Server for weather data + const weatherServer = new Server({ + name: "WeatherServer", + version: "1.0.0", + }, { + capabilities: { + prompts: {}, + resources: {}, + tools: {}, + logging: {}, + }, + }); + // Typecheck that only valid weather requests/notifications/results are allowed + weatherServer.setRequestHandler(GetWeatherRequestSchema, (request) => { + return { + temperature: 72, + conditions: "sunny", + }; + }); + weatherServer.setNotificationHandler(WeatherForecastNotificationSchema, (notification) => { + console.log(`Weather alert: ${notification.params.message}`); + }); +}); +test("should handle server cancelling a request", async () => { + const server = new Server({ + name: "test server", + version: "1.0", + }, { + capabilities: { + sampling: {}, + }, + }); + const client = new Client({ + name: "test client", + version: "1.0", + }, { + capabilities: { + sampling: {}, + }, + }); + // Set up client to delay responding to createMessage + client.setRequestHandler(CreateMessageRequestSchema, async (_request, extra) => { + await new Promise((resolve) => setTimeout(resolve, 1000)); + return { + model: "test", + role: "assistant", + content: { + type: "text", + text: "Test response", + }, + }; + }); + const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair(); + await Promise.all([ + client.connect(clientTransport), + server.connect(serverTransport), + ]); + // Set up abort controller + const controller = new AbortController(); + // Issue request but cancel it immediately + const createMessagePromise = server.createMessage({ + messages: [], + maxTokens: 10, + }, { + signal: controller.signal, + }); + controller.abort("Cancelled by test"); + // Request should be rejected + await expect(createMessagePromise).rejects.toBe("Cancelled by test"); +}); +test("should handle request timeout", async () => { + const server = new Server({ + name: "test server", + version: "1.0", + }, { + capabilities: { + sampling: {}, + }, + }); + // Set up client that delays responses + const client = new Client({ + name: "test client", + version: "1.0", + }, { + capabilities: { + sampling: {}, + }, + }); + client.setRequestHandler(CreateMessageRequestSchema, async (_request, extra) => { + await new Promise((resolve, reject) => { + const timeout = setTimeout(resolve, 100); + extra.signal.addEventListener("abort", () => { + clearTimeout(timeout); + reject(extra.signal.reason); + }); + }); + return { + model: "test", + role: "assistant", + content: { + type: "text", + text: "Test response", + }, + }; + }); + const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair(); + await Promise.all([ + client.connect(clientTransport), + server.connect(serverTransport), + ]); + // Request with 0 msec timeout should fail immediately + await expect(server.createMessage({ + messages: [], + maxTokens: 10, + }, { timeout: 0 })).rejects.toMatchObject({ + code: ErrorCode.RequestTimeout, + }); +}); +//# sourceMappingURL=index.test.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/server/index.test.js.map b/front_end/third_party/mcp-sdk/zod/dist/server/index.test.js.map new file mode 100644 index 0000000000..5810586c2d --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/server/index.test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../src/server/index.test.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,kDAAkD;AAClD,6DAA6D;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,YAAY,EACZ,uBAAuB,EACvB,2BAA2B,EAC3B,0BAA0B,EAC1B,wBAAwB,EACxB,0BAA0B,EAC1B,sBAAsB,EACtB,qBAAqB,EACrB,SAAS,GACV,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,IAAI,CA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C,CAAC;IAEH,sDAAsD;IACtD,MAAM,MAAM,CACV,MAAM,CAAC,aAAa,CAClB;QACE,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,EAAE;KACd,EACD,EAAE,OAAO,EAAE,CAAC,EAAE,CACf,CACF,CAAC,OAAO,CAAC,aAAa,CAAC;QACtB,IAAI,EAAE,SAAS,CAAC,cAAc;KAC/B,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/server/sse.d.ts b/front_end/third_party/mcp-sdk/zod/dist/server/sse.d.ts new file mode 100644 index 0000000000..0b178f1a6a --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/server/sse.d.ts @@ -0,0 +1,46 @@ +import { IncomingMessage, ServerResponse } from "node:http"; +import { Transport } from "../shared/transport.js"; +import { JSONRPCMessage } from "../types.js"; +/** + * Server transport for SSE: this will send messages over an SSE connection and receive messages from HTTP POST requests. + * + * This transport is only available in Node.js environments. + */ +export declare class SSEServerTransport implements Transport { + private _endpoint; + private res; + private _sseResponse?; + private _sessionId; + onclose?: () => void; + onerror?: (error: Error) => void; + onmessage?: (message: JSONRPCMessage) => void; + /** + * Creates a new SSE server transport, which will direct the client to POST messages to the relative or absolute URL identified by `_endpoint`. + */ + constructor(_endpoint: string, res: ServerResponse); + /** + * Handles the initial SSE connection request. + * + * This should be called when a GET request is made to establish the SSE stream. + */ + start(): Promise; + /** + * Handles incoming POST messages. + * + * This should be called when a POST request is made to send a message to the server. + */ + handlePostMessage(req: IncomingMessage, res: ServerResponse, parsedBody?: unknown): Promise; + /** + * Handle a client message, regardless of how it arrived. This can be used to inform the server of messages that arrive via a means different than HTTP POST. + */ + handleMessage(message: unknown): Promise; + close(): Promise; + send(message: JSONRPCMessage): Promise; + /** + * Returns the session ID for this transport. + * + * This can be used to route incoming POST requests. + */ + get sessionId(): string; +} +//# sourceMappingURL=sse.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/server/sse.d.ts.map b/front_end/third_party/mcp-sdk/zod/dist/server/sse.d.ts.map new file mode 100644 index 0000000000..d64e193f4d --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/server/sse.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"sse.d.ts","sourceRoot":"","sources":["../../src/server/sse.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAwB,MAAM,aAAa,CAAC;AAMnE;;;;GAIG;AACH,qBAAa,kBAAmB,YAAW,SAAS;IAYhD,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,GAAG;IAZb,OAAO,CAAC,YAAY,CAAC,CAAiB;IACtC,OAAO,CAAC,UAAU,CAAS;IAE3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;IAE9C;;OAEG;gBAEO,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,cAAc;IAK7B;;;;OAIG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAyB5B;;;;OAIG;IACG,iBAAiB,CACrB,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,UAAU,CAAC,EAAE,OAAO,GACnB,OAAO,CAAC,IAAI,CAAC;IAkChB;;OAEG;IACG,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAY9C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAMtB,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAUlD;;;;OAIG;IACH,IAAI,SAAS,IAAI,MAAM,CAEtB;CACF"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/server/sse.js b/front_end/third_party/mcp-sdk/zod/dist/server/sse.js new file mode 100644 index 0000000000..efdf79a668 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/server/sse.js @@ -0,0 +1,116 @@ +import { randomUUID } from "node:crypto"; +import { JSONRPCMessageSchema } from "../types.js"; +import getRawBody from "raw-body"; +import contentType from "content-type"; +const MAXIMUM_MESSAGE_SIZE = "4mb"; +/** + * Server transport for SSE: this will send messages over an SSE connection and receive messages from HTTP POST requests. + * + * This transport is only available in Node.js environments. + */ +export class SSEServerTransport { + /** + * Creates a new SSE server transport, which will direct the client to POST messages to the relative or absolute URL identified by `_endpoint`. + */ + constructor(_endpoint, res) { + this._endpoint = _endpoint; + this.res = res; + this._sessionId = randomUUID(); + } + /** + * Handles the initial SSE connection request. + * + * This should be called when a GET request is made to establish the SSE stream. + */ + async start() { + if (this._sseResponse) { + throw new Error("SSEServerTransport already started! If using Server class, note that connect() calls start() automatically."); + } + this.res.writeHead(200, { + "Content-Type": "text/event-stream", + "Cache-Control": "no-cache", + Connection: "keep-alive", + }); + // Send the endpoint event + this.res.write(`event: endpoint\ndata: ${encodeURI(this._endpoint)}?sessionId=${this._sessionId}\n\n`); + this._sseResponse = this.res; + this.res.on("close", () => { + var _a; + this._sseResponse = undefined; + (_a = this.onclose) === null || _a === void 0 ? void 0 : _a.call(this); + }); + } + /** + * Handles incoming POST messages. + * + * This should be called when a POST request is made to send a message to the server. + */ + async handlePostMessage(req, res, parsedBody) { + var _a, _b, _c; + if (!this._sseResponse) { + const message = "SSE connection not established"; + res.writeHead(500).end(message); + throw new Error(message); + } + let body; + try { + const ct = contentType.parse((_a = req.headers["content-type"]) !== null && _a !== void 0 ? _a : ""); + if (ct.type !== "application/json") { + throw new Error(`Unsupported content-type: ${ct}`); + } + body = parsedBody !== null && parsedBody !== void 0 ? parsedBody : await getRawBody(req, { + limit: MAXIMUM_MESSAGE_SIZE, + encoding: (_b = ct.parameters.charset) !== null && _b !== void 0 ? _b : "utf-8", + }); + } + catch (error) { + res.writeHead(400).end(String(error)); + (_c = this.onerror) === null || _c === void 0 ? void 0 : _c.call(this, error); + return; + } + try { + await this.handleMessage(typeof body === 'string' ? JSON.parse(body) : body); + } + catch (_d) { + res.writeHead(400).end(`Invalid message: ${body}`); + return; + } + res.writeHead(202).end("Accepted"); + } + /** + * Handle a client message, regardless of how it arrived. This can be used to inform the server of messages that arrive via a means different than HTTP POST. + */ + async handleMessage(message) { + var _a, _b; + let parsedMessage; + try { + parsedMessage = JSONRPCMessageSchema.parse(message); + } + catch (error) { + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + throw error; + } + (_b = this.onmessage) === null || _b === void 0 ? void 0 : _b.call(this, parsedMessage); + } + async close() { + var _a, _b; + (_a = this._sseResponse) === null || _a === void 0 ? void 0 : _a.end(); + this._sseResponse = undefined; + (_b = this.onclose) === null || _b === void 0 ? void 0 : _b.call(this); + } + async send(message) { + if (!this._sseResponse) { + throw new Error("Not connected"); + } + this._sseResponse.write(`event: message\ndata: ${JSON.stringify(message)}\n\n`); + } + /** + * Returns the session ID for this transport. + * + * This can be used to route incoming POST requests. + */ + get sessionId() { + return this._sessionId; + } +} +//# sourceMappingURL=sse.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/server/sse.js.map b/front_end/third_party/mcp-sdk/zod/dist/server/sse.js.map new file mode 100644 index 0000000000..e611e5da7a --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/server/sse.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sse.js","sourceRoot":"","sources":["../../src/server/sse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,OAAO,EAAkB,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,UAAU,MAAM,UAAU,CAAC;AAClC,OAAO,WAAW,MAAM,cAAc,CA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,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACtD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAA,IAAI,CAAC,OAAO,qDAAG,KAAc,CAAC,CAAC;YAC/B,MAAM,KAAK,CAAC;QACd,CAAC;QAED,MAAA,IAAI,CAAC,SAAS,qDAAG,aAAa,CAAC,CAAC;IAClC,CAAC;IAED,KAAK,CAAC,KAAK;;QACT,MAAA,IAAI,CAAC,YAAY,0CAAE,GAAG,EAAE,CAAC;QACzB,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC;QAC9B,MAAA,IAAI,CAAC,OAAO,oDAAI,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,OAAuB;QAChC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YACvB,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;QACnC,CAAC;QAED,IAAI,CAAC,YAAY,CAAC,KAAK,CACrB,yBAAyB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CACvD,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;CACF"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/server/stdio.d.ts b/front_end/third_party/mcp-sdk/zod/dist/server/stdio.d.ts new file mode 100644 index 0000000000..92ab191948 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/server/stdio.d.ts @@ -0,0 +1,28 @@ +import { Readable, Writable } from "node:stream"; +import { JSONRPCMessage } from "../types.js"; +import { Transport } from "../shared/transport.js"; +/** + * Server transport for stdio: this communicates with a MCP client by reading from the current process' stdin and writing to stdout. + * + * This transport is only available in Node.js environments. + */ +export declare class StdioServerTransport implements Transport { + private _stdin; + private _stdout; + private _readBuffer; + private _started; + constructor(_stdin?: Readable, _stdout?: Writable); + onclose?: () => void; + onerror?: (error: Error) => void; + onmessage?: (message: JSONRPCMessage) => void; + _ondata: (chunk: Buffer) => void; + _onerror: (error: Error) => void; + /** + * Starts listening for messages on stdin. + */ + start(): Promise; + private processReadBuffer; + close(): Promise; + send(message: JSONRPCMessage): Promise; +} +//# sourceMappingURL=stdio.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/server/stdio.d.ts.map b/front_end/third_party/mcp-sdk/zod/dist/server/stdio.d.ts.map new file mode 100644 index 0000000000..674ba6adc8 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/server/stdio.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"stdio.d.ts","sourceRoot":"","sources":["../../src/server/stdio.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD;;;;GAIG;AACH,qBAAa,oBAAqB,YAAW,SAAS;IAKlD,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,OAAO;IALjB,OAAO,CAAC,WAAW,CAAgC;IACnD,OAAO,CAAC,QAAQ,CAAS;gBAGf,MAAM,GAAE,QAAwB,EAChC,OAAO,GAAE,QAAyB;IAG5C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;IAG9C,OAAO,UAAW,MAAM,UAGtB;IACF,QAAQ,UAAW,KAAK,UAEtB;IAEF;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAY5B,OAAO,CAAC,iBAAiB;IAenB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAO5B,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAU7C"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/server/stdio.js b/front_end/third_party/mcp-sdk/zod/dist/server/stdio.js new file mode 100644 index 0000000000..608e28b9be --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/server/stdio.js @@ -0,0 +1,69 @@ +import process from "node:process"; +import { ReadBuffer, serializeMessage } from "../shared/stdio.js"; +/** + * Server transport for stdio: this communicates with a MCP client by reading from the current process' stdin and writing to stdout. + * + * This transport is only available in Node.js environments. + */ +export class StdioServerTransport { + constructor(_stdin = process.stdin, _stdout = process.stdout) { + this._stdin = _stdin; + this._stdout = _stdout; + this._readBuffer = new ReadBuffer(); + this._started = false; + // Arrow functions to bind `this` properly, while maintaining function identity. + this._ondata = (chunk) => { + this._readBuffer.append(chunk); + this.processReadBuffer(); + }; + this._onerror = (error) => { + var _a; + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + }; + } + /** + * Starts listening for messages on stdin. + */ + async start() { + if (this._started) { + throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically."); + } + this._started = true; + this._stdin.on("data", this._ondata); + this._stdin.on("error", this._onerror); + } + processReadBuffer() { + var _a, _b; + while (true) { + try { + const message = this._readBuffer.readMessage(); + if (message === null) { + break; + } + (_a = this.onmessage) === null || _a === void 0 ? void 0 : _a.call(this, message); + } + catch (error) { + (_b = this.onerror) === null || _b === void 0 ? void 0 : _b.call(this, error); + } + } + } + async close() { + var _a; + this._stdin.off("data", this._ondata); + this._stdin.off("error", this._onerror); + this._readBuffer.clear(); + (_a = this.onclose) === null || _a === void 0 ? void 0 : _a.call(this); + } + send(message) { + return new Promise((resolve) => { + const json = serializeMessage(message); + if (this._stdout.write(json)) { + resolve(); + } + else { + this._stdout.once("drain", resolve); + } + }); + } +} +//# sourceMappingURL=stdio.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/server/stdio.js.map b/front_end/third_party/mcp-sdk/zod/dist/server/stdio.js.map new file mode 100644 index 0000000000..8851537d00 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/server/stdio.js.map @@ -0,0 +1 @@ +{"version":3,"file":"stdio.js","sourceRoot":"","sources":["../../src/server/stdio.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,cAAc,CAAC;AAEnC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAIlE;;;;GAIG;AACH,MAAM,OAAO,oBAAoB;IAI/B,YACU,SAAmB,OAAO,CAAC,KAAK,EAChC,UAAoB,OAAO,CAAC,MAAM;QADlC,WAAM,GAAN,MAAM,CAA0B;QAChC,YAAO,GAAP,OAAO,CAA2B;QALpC,gBAAW,GAAe,IAAI,UAAU,EAAE,CAAC;QAC3C,aAAQ,GAAG,KAAK,CAAC;QAWzB,gFAAgF;QAChF,YAAO,GAAG,CAAC,KAAa,EAAE,EAAE;YAC1B,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC/B,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAC3B,CAAC,CAAC;QACF,aAAQ,GAAG,CAAC,KAAY,EAAE,EAAE;;YAC1B,MAAA,IAAI,CAAC,OAAO,qDAAG,KAAK,CAAC,CAAC;QACxB,CAAC,CAAC;IAbC,CAAC;IAeJ;;OAEG;IACH,KAAK,CAAC,KAAK;QACT,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,MAAM,IAAI,KAAK,CACb,+GAA+G,CAChH,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACrC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IACzC,CAAC;IAEO,iBAAiB;;QACvB,OAAO,IAAI,EAAE,CAAC;YACZ,IAAI,CAAC;gBACH,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC;gBAC/C,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;oBACrB,MAAM;gBACR,CAAC;gBAED,MAAA,IAAI,CAAC,SAAS,qDAAG,OAAO,CAAC,CAAC;YAC5B,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAA,IAAI,CAAC,OAAO,qDAAG,KAAc,CAAC,CAAC;YACjC,CAAC;QACH,CAAC;IACH,CAAC;IAED,KAAK,CAAC,KAAK;;QACT,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACtC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QACxC,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;QACzB,MAAA,IAAI,CAAC,OAAO,oDAAI,CAAC;IACnB,CAAC;IAED,IAAI,CAAC,OAAuB;QAC1B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YAC7B,MAAM,IAAI,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;YACvC,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC7B,OAAO,EAAE,CAAC;YACZ,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YACtC,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/server/stdio.test.d.ts b/front_end/third_party/mcp-sdk/zod/dist/server/stdio.test.d.ts new file mode 100644 index 0000000000..08756f1fed --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/server/stdio.test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=stdio.test.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/server/stdio.test.d.ts.map b/front_end/third_party/mcp-sdk/zod/dist/server/stdio.test.d.ts.map new file mode 100644 index 0000000000..00b43946b0 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/server/stdio.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"stdio.test.d.ts","sourceRoot":"","sources":["../../src/server/stdio.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/server/stdio.test.js b/front_end/third_party/mcp-sdk/zod/dist/server/stdio.test.js new file mode 100644 index 0000000000..a7183a4b21 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/server/stdio.test.js @@ -0,0 +1,87 @@ +import { Readable, Writable } from "node:stream"; +import { ReadBuffer, serializeMessage } from "../shared/stdio.js"; +import { StdioServerTransport } from "./stdio.js"; +let input; +let outputBuffer; +let output; +beforeEach(() => { + input = new Readable({ + // We'll use input.push() instead. + read: () => { }, + }); + outputBuffer = new ReadBuffer(); + output = new Writable({ + write(chunk, encoding, callback) { + outputBuffer.append(chunk); + callback(); + }, + }); +}); +test("should start then close cleanly", async () => { + const server = new StdioServerTransport(input, output); + server.onerror = (error) => { + throw error; + }; + let didClose = false; + server.onclose = () => { + didClose = true; + }; + await server.start(); + expect(didClose).toBeFalsy(); + await server.close(); + expect(didClose).toBeTruthy(); +}); +test("should not read until started", async () => { + const server = new StdioServerTransport(input, output); + server.onerror = (error) => { + throw error; + }; + let didRead = false; + const readMessage = new Promise((resolve) => { + server.onmessage = (message) => { + didRead = true; + resolve(message); + }; + }); + const message = { + jsonrpc: "2.0", + id: 1, + method: "ping", + }; + input.push(serializeMessage(message)); + expect(didRead).toBeFalsy(); + await server.start(); + expect(await readMessage).toEqual(message); +}); +test("should read multiple messages", async () => { + const server = new StdioServerTransport(input, output); + server.onerror = (error) => { + throw error; + }; + const messages = [ + { + jsonrpc: "2.0", + id: 1, + method: "ping", + }, + { + jsonrpc: "2.0", + method: "notifications/initialized", + }, + ]; + const readMessages = []; + const finished = new Promise((resolve) => { + server.onmessage = (message) => { + readMessages.push(message); + if (JSON.stringify(message) === JSON.stringify(messages[1])) { + resolve(); + } + }; + }); + input.push(serializeMessage(messages[0])); + input.push(serializeMessage(messages[1])); + await server.start(); + await finished; + expect(readMessages).toEqual(messages); +}); +//# sourceMappingURL=stdio.test.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/server/stdio.test.js.map b/front_end/third_party/mcp-sdk/zod/dist/server/stdio.test.js.map new file mode 100644 index 0000000000..db814ecc88 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/server/stdio.test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"stdio.test.js","sourceRoot":"","sources":["../../src/server/stdio.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAElE,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAElD,IAAI,KAAe,CAAC;AACpB,IAAI,YAAwB,CAAC;AAC7B,IAAI,MAAgB,CAAC;AAErB,UAAU,CAAC,GAAG,EAAE;IACd,KAAK,GAAG,IAAI,QAAQ,CAAC;QACnB,kCAAkC;QAClC,IAAI,EAAE,GAAG,EAAE,GAAE,CAAC;KACf,CAAC,CAAC;IAEH,YAAY,GAAG,IAAI,UAAU,EAAE,CAAC;IAChC,MAAM,GAAG,IAAI,QAAQ,CAAC;QACpB,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ;YAC7B,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC3B,QAAQ,EAAE,CAAC;QACb,CAAC;KACF,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,iCAA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MAAM,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AACzC,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/shared/protocol.d.ts b/front_end/third_party/mcp-sdk/zod/dist/shared/protocol.d.ts new file mode 100644 index 0000000000..85f9981897 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/shared/protocol.d.ts @@ -0,0 +1,157 @@ +import { ZodLiteral, ZodObject, ZodType, z } from "zod"; +import { Notification, Progress, Request, Result } from "../types.js"; +import { Transport } from "./transport.js"; +/** + * Callback for progress notifications. + */ +export type ProgressCallback = (progress: Progress) => void; +/** + * Additional initialization options. + */ +export type ProtocolOptions = { + /** + * Whether to restrict emitted requests to only those that the remote side has indicated that they can handle, through their advertised capabilities. + * + * Note that this DOES NOT affect checking of _local_ side capabilities, as it is considered a logic error to mis-specify those. + * + * Currently this defaults to false, for backwards compatibility with SDK versions that did not advertise capabilities correctly. In future, this will default to true. + */ + enforceStrictCapabilities?: boolean; +}; +/** + * The default request timeout, in miliseconds. + */ +export declare const DEFAULT_REQUEST_TIMEOUT_MSEC = 60000; +/** + * Options that can be given per request. + */ +export type RequestOptions = { + /** + * If set, requests progress notifications from the remote end (if supported). When progress notifications are received, this callback will be invoked. + */ + onprogress?: ProgressCallback; + /** + * Can be used to cancel an in-flight request. This will cause an AbortError to be raised from request(). + */ + signal?: AbortSignal; + /** + * A timeout (in milliseconds) for this request. If exceeded, an McpError with code `RequestTimeout` will be raised from request(). + * + * If not specified, `DEFAULT_REQUEST_TIMEOUT_MSEC` will be used as the timeout. + */ + timeout?: number; +}; +/** + * Extra data given to request handlers. + */ +export type RequestHandlerExtra = { + /** + * An abort signal used to communicate if the request was cancelled from the sender's side. + */ + signal: AbortSignal; +}; +/** + * Implements MCP protocol framing on top of a pluggable transport, including + * features like request/response linking, notifications, and progress. + */ +export declare abstract class Protocol { + private _options?; + private _transport?; + private _requestMessageId; + private _requestHandlers; + private _requestHandlerAbortControllers; + private _notificationHandlers; + private _responseHandlers; + private _progressHandlers; + /** + * Callback for when the connection is closed for any reason. + * + * This is invoked when close() is called as well. + */ + onclose?: () => void; + /** + * Callback for when an error occurs. + * + * Note that errors are not necessarily fatal; they are used for reporting any kind of exceptional condition out of band. + */ + onerror?: (error: Error) => void; + /** + * A handler to invoke for any request types that do not have their own handler installed. + */ + fallbackRequestHandler?: (request: Request) => Promise; + /** + * A handler to invoke for any notification types that do not have their own handler installed. + */ + fallbackNotificationHandler?: (notification: Notification) => Promise; + constructor(_options?: ProtocolOptions | undefined); + /** + * Attaches to the given transport, starts it, and starts listening for messages. + * + * The Protocol object assumes ownership of the Transport, replacing any callbacks that have already been set, and expects that it is the only user of the Transport instance going forward. + */ + connect(transport: Transport): Promise; + private _onclose; + private _onerror; + private _onnotification; + private _onrequest; + private _onprogress; + private _onresponse; + get transport(): Transport | undefined; + /** + * Closes the connection. + */ + close(): Promise; + /** + * A method to check if a capability is supported by the remote side, for the given method to be called. + * + * This should be implemented by subclasses. + */ + protected abstract assertCapabilityForMethod(method: SendRequestT["method"]): void; + /** + * A method to check if a notification is supported by the local side, for the given method to be sent. + * + * This should be implemented by subclasses. + */ + protected abstract assertNotificationCapability(method: SendNotificationT["method"]): void; + /** + * A method to check if a request handler is supported by the local side, for the given method to be handled. + * + * This should be implemented by subclasses. + */ + protected abstract assertRequestHandlerCapability(method: string): void; + /** + * Sends a request and wait for a response. + * + * Do not use this method to emit notifications! Use notification() instead. + */ + request>(request: SendRequestT, resultSchema: T, options?: RequestOptions): Promise>; + /** + * Emits a notification, which is a one-way message that does not expect a response. + */ + notification(notification: SendNotificationT): Promise; + /** + * Registers a handler to invoke when this protocol object receives a request with the given method. + * + * Note that this will replace any previous request handler for the same method. + */ + setRequestHandler; + }>>(requestSchema: T, handler: (request: z.infer, extra: RequestHandlerExtra) => SendResultT | Promise): void; + /** + * Removes the request handler for the given method. + */ + removeRequestHandler(method: string): void; + /** + * Registers a handler to invoke when this protocol object receives a notification with the given method. + * + * Note that this will replace any previous notification handler for the same method. + */ + setNotificationHandler; + }>>(notificationSchema: T, handler: (notification: z.infer) => void | Promise): void; + /** + * Removes the notification handler for the given method. + */ + removeNotificationHandler(method: string): void; +} +//# sourceMappingURL=protocol.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/shared/protocol.d.ts.map b/front_end/third_party/mcp-sdk/zod/dist/shared/protocol.d.ts.map new file mode 100644 index 0000000000..09790f204d --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/shared/protocol.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/shared/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxD,OAAO,EAQL,YAAY,EAEZ,QAAQ,EAGR,OAAO,EAEP,MAAM,EACP,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;AAE5D;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;;;OAMG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,4BAA4B,QAAQ,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAE9B;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC;;OAEG;IACH,MAAM,EAAE,WAAW,CAAC;CACrB,CAA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b/front_end/third_party/mcp-sdk/zod/dist/shared/protocol.js new file mode 100644 index 0000000000..1621792ea6 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/shared/protocol.js @@ -0,0 +1,297 @@ +import { CancelledNotificationSchema, ErrorCode, McpError, PingRequestSchema, ProgressNotificationSchema, } from "../types.js"; +/** + * The default request timeout, in miliseconds. + */ +export const DEFAULT_REQUEST_TIMEOUT_MSEC = 60000; +/** + * Implements MCP protocol framing on top of a pluggable transport, including + * features like request/response linking, notifications, and progress. + */ +export class Protocol { + constructor(_options) { + this._options = _options; + this._requestMessageId = 0; + this._requestHandlers = new Map(); + this._requestHandlerAbortControllers = new Map(); + this._notificationHandlers = new Map(); + this._responseHandlers = new Map(); + this._progressHandlers = new Map(); + this.setNotificationHandler(CancelledNotificationSchema, (notification) => { + const controller = this._requestHandlerAbortControllers.get(notification.params.requestId); + controller === null || controller === void 0 ? void 0 : controller.abort(notification.params.reason); + }); + this.setNotificationHandler(ProgressNotificationSchema, (notification) => { + this._onprogress(notification); + }); + this.setRequestHandler(PingRequestSchema, + // Automatic pong by default. + (_request) => ({})); + } + /** + * Attaches to the given transport, starts it, and starts listening for messages. + * + * The Protocol object assumes ownership of the Transport, replacing any callbacks that have already been set, and expects that it is the only user of the Transport instance going forward. + */ + async connect(transport) { + this._transport = transport; + this._transport.onclose = () => { + this._onclose(); + }; + this._transport.onerror = (error) => { + this._onerror(error); + }; + this._transport.onmessage = (message) => { + if (!("method" in message)) { + this._onresponse(message); + } + else if ("id" in message) { + this._onrequest(message); + } + else { + this._onnotification(message); + } + }; + await this._transport.start(); + } + _onclose() { + var _a; + const responseHandlers = this._responseHandlers; + this._responseHandlers = new Map(); + this._progressHandlers.clear(); + this._transport = undefined; + (_a = this.onclose) === null || _a === void 0 ? void 0 : _a.call(this); + const error = new McpError(ErrorCode.ConnectionClosed, "Connection closed"); + for (const handler of responseHandlers.values()) { + handler(error); + } + } + _onerror(error) { + var _a; + (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error); + } + _onnotification(notification) { + var _a; + const handler = (_a = this._notificationHandlers.get(notification.method)) !== null && _a !== void 0 ? _a : this.fallbackNotificationHandler; + // Ignore notifications not being subscribed to. + if (handler === undefined) { + return; + } + // Starting with Promise.resolve() puts any synchronous errors into the monad as well. + Promise.resolve() + .then(() => handler(notification)) + .catch((error) => this._onerror(new Error(`Uncaught error in notification handler: ${error}`))); + } + _onrequest(request) { + var _a, _b; + const handler = (_a = this._requestHandlers.get(request.method)) !== null && _a !== void 0 ? _a : this.fallbackRequestHandler; + if (handler === undefined) { + (_b = this._transport) === null || _b === void 0 ? void 0 : _b.send({ + jsonrpc: "2.0", + id: request.id, + error: { + code: ErrorCode.MethodNotFound, + message: "Method not found", + }, + }).catch((error) => this._onerror(new Error(`Failed to send an error response: ${error}`))); + return; + } + const abortController = new AbortController(); + this._requestHandlerAbortControllers.set(request.id, abortController); + // Starting with Promise.resolve() puts any synchronous errors into the monad as well. + Promise.resolve() + .then(() => handler(request, { signal: abortController.signal })) + .then((result) => { + var _a; + if (abortController.signal.aborted) { + return; + } + return (_a = this._transport) === null || _a === void 0 ? void 0 : _a.send({ + result, + jsonrpc: "2.0", + id: request.id, + }); + }, (error) => { + var _a, _b; + if (abortController.signal.aborted) { + return; + } + return (_a = this._transport) === null || _a === void 0 ? void 0 : _a.send({ + jsonrpc: "2.0", + id: request.id, + error: { + code: Number.isSafeInteger(error["code"]) + ? error["code"] + : ErrorCode.InternalError, + message: (_b = error.message) !== null && _b !== void 0 ? _b : "Internal error", + }, + }); + }) + .catch((error) => this._onerror(new Error(`Failed to send response: ${error}`))) + .finally(() => { + this._requestHandlerAbortControllers.delete(request.id); + }); + } + _onprogress(notification) { + const { progressToken, ...params } = notification.params; + const handler = this._progressHandlers.get(Number(progressToken)); + if (handler === undefined) { + this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(notification)}`)); + return; + } + handler(params); + } + _onresponse(response) { + const messageId = response.id; + const handler = this._responseHandlers.get(Number(messageId)); + if (handler === undefined) { + this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(response)}`)); + return; + } + this._responseHandlers.delete(Number(messageId)); + this._progressHandlers.delete(Number(messageId)); + if ("result" in response) { + handler(response); + } + else { + const error = new McpError(response.error.code, response.error.message, response.error.data); + handler(error); + } + } + get transport() { + return this._transport; + } + /** + * Closes the connection. + */ + async close() { + var _a; + await ((_a = this._transport) === null || _a === void 0 ? void 0 : _a.close()); + } + /** + * Sends a request and wait for a response. + * + * Do not use this method to emit notifications! Use notification() instead. + */ + request(request, resultSchema, options) { + return new Promise((resolve, reject) => { + var _a, _b, _c, _d; + if (!this._transport) { + reject(new Error("Not connected")); + return; + } + if (((_a = this._options) === null || _a === void 0 ? void 0 : _a.enforceStrictCapabilities) === true) { + this.assertCapabilityForMethod(request.method); + } + (_b = options === null || options === void 0 ? void 0 : options.signal) === null || _b === void 0 ? void 0 : _b.throwIfAborted(); + const messageId = this._requestMessageId++; + const jsonrpcRequest = { + ...request, + jsonrpc: "2.0", + id: messageId, + }; + if (options === null || options === void 0 ? void 0 : options.onprogress) { + this._progressHandlers.set(messageId, options.onprogress); + jsonrpcRequest.params = { + ...request.params, + _meta: { progressToken: messageId }, + }; + } + let timeoutId = undefined; + this._responseHandlers.set(messageId, (response) => { + var _a; + if (timeoutId !== undefined) { + clearTimeout(timeoutId); + } + if ((_a = options === null || options === void 0 ? void 0 : options.signal) === null || _a === void 0 ? void 0 : _a.aborted) { + return; + } + if (response instanceof Error) { + return reject(response); + } + try { + const result = resultSchema.parse(response.result); + resolve(result); + } + catch (error) { + reject(error); + } + }); + const cancel = (reason) => { + var _a; + this._responseHandlers.delete(messageId); + this._progressHandlers.delete(messageId); + (_a = this._transport) === null || _a === void 0 ? void 0 : _a.send({ + jsonrpc: "2.0", + method: "notifications/cancelled", + params: { + requestId: messageId, + reason: String(reason), + }, + }).catch((error) => this._onerror(new Error(`Failed to send cancellation: ${error}`))); + reject(reason); + }; + (_c = options === null || options === void 0 ? void 0 : options.signal) === null || _c === void 0 ? void 0 : _c.addEventListener("abort", () => { + var _a; + if (timeoutId !== undefined) { + clearTimeout(timeoutId); + } + cancel((_a = options === null || options === void 0 ? void 0 : options.signal) === null || _a === void 0 ? void 0 : _a.reason); + }); + const timeout = (_d = options === null || options === void 0 ? void 0 : options.timeout) !== null && _d !== void 0 ? _d : DEFAULT_REQUEST_TIMEOUT_MSEC; + timeoutId = setTimeout(() => cancel(new McpError(ErrorCode.RequestTimeout, "Request timed out", { + timeout, + })), timeout); + this._transport.send(jsonrpcRequest).catch((error) => { + if (timeoutId !== undefined) { + clearTimeout(timeoutId); + } + reject(error); + }); + }); + } + /** + * Emits a notification, which is a one-way message that does not expect a response. + */ + async notification(notification) { + if (!this._transport) { + throw new Error("Not connected"); + } + this.assertNotificationCapability(notification.method); + const jsonrpcNotification = { + ...notification, + jsonrpc: "2.0", + }; + await this._transport.send(jsonrpcNotification); + } + /** + * Registers a handler to invoke when this protocol object receives a request with the given method. + * + * Note that this will replace any previous request handler for the same method. + */ + setRequestHandler(requestSchema, handler) { + const method = requestSchema.shape.method.value; + this.assertRequestHandlerCapability(method); + this._requestHandlers.set(method, (request, extra) => Promise.resolve(handler(requestSchema.parse(request), extra))); + } + /** + * Removes the request handler for the given method. + */ + removeRequestHandler(method) { + this._requestHandlers.delete(method); + } + /** + * Registers a handler to invoke when this protocol object receives a notification with the given method. + * + * Note that this will replace any previous notification handler for the same method. + */ + setNotificationHandler(notificationSchema, handler) { + this._notificationHandlers.set(notificationSchema.shape.method.value, (notification) => Promise.resolve(handler(notificationSchema.parse(notification)))); + } + /** + * Removes the notification handler for the given method. + */ + removeNotificationHandler(method) { + this._notificationHandlers.delete(method); + } +} +//# sourceMappingURL=protocol.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/shared/protocol.js.map b/front_end/third_party/mcp-sdk/zod/dist/shared/protocol.js.map new file mode 100644 index 0000000000..ae2eaa1589 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/shared/protocol.js.map @@ -0,0 +1 @@ +{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/shared/protocol.ts"],"names":[],"mappings":"AACA,OAAO,EACL,2BAA2B,EAC3B,SAAS,EAKT,QAAQ,EAER,iBAAiB,EAGjB,0BAA0B,GAI3B,MAAM,aAAa,CAAC;AAsBrB;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,KAAK,CAAC;AAkClD;;;GAGG;AACH,MAAM,OAAgB,QAAQ;IAkD5B,YAAoB,QAA0B;QAA1B,aAAQ,GAAR,QAAQ,CAAkB;QA5CtC,sBAAiB,GAAG,CAAC,CAAC;QACtB,qBAAgB,GAMpB,IAAI,GAAG,EAAE,CAAC;QACN,oCAA+B,GACrC,IAAI,GAAG,EAAE,CAAC;QACJ,0BAAqB,GAGzB,IAAI,GAAG,EAAE,CAAC;QACN,sBAAiB,GAGrB,IAAI,GAAG,EAAE,CAAC;QACN,sBAAiB,GAAkC,IAAI,GAAG,EAAE,CAAC;QA2BnE,IAAI,CAAC,sBAAsB,CAAC,2BAA2B,EAAE,CAAC,YAAY,EAAE,EAAE;YACxE,MAAM,UAAU,GAAG,IAAI,CAAC,+BAA+B,CAAC,GAAG,CACzD,YAAY,CAAC,MAAM,CAAC,SAAS,CAC9B,CAAC;YACF,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,sBAAsB,CAAC,0BAA0B,EAAE,CAAC,YAAY,EAAE,EAAE;YACvE,IAAI,CAAC,WAAW,CAAC,YAA+C,CAAC,CAAC;QACpE,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,iBAAiB,CACpB,iBAAiB;QACjB,6BAA6B;QAC7B,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,EAAE,CAAgB,CAClC,CAAC;IACJ,CAAC;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B,CAAC,CAAC;IAClD,CAAC;IAED;;;;OAIG;IACH,iBAAiB,CAKf,aAAgB,EAChB,OAGuC;QAEvC,MAAM,MAAM,GAAG,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;QAChD,IAAI,CAAC,8BAA8B,CAAC,MAAM,CAAC,CAAC;QAC5C,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CACnD,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,CAAC,CAC9D,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,oBAAoB,CAAC,MAAc;QACjC,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACvC,CAAC;IAED;;;;OAIG;IACH,sBAAsB,CAKpB,kBAAqB,EACrB,OAA2D;QAE3D,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAC5B,kBAAkB,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,EACrC,CAAC,YAAY,EAAE,EAAE,CACf,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,kBAAkB,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CACnE,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,yBAAyB,CAAC,MAAc;QACtC,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC5C,CAAC;CACF"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/shared/stdio.d.ts b/front_end/third_party/mcp-sdk/zod/dist/shared/stdio.d.ts new file mode 100644 index 0000000000..c997594734 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/shared/stdio.d.ts @@ -0,0 +1,13 @@ +import { JSONRPCMessage } from "../types.js"; +/** + * Buffers a continuous stdio stream into discrete JSON-RPC messages. + */ +export declare class ReadBuffer { + private _buffer?; + append(chunk: Buffer): void; + readMessage(): JSONRPCMessage | null; + clear(): void; +} +export declare function deserializeMessage(line: string): JSONRPCMessage; +export declare function serializeMessage(message: JSONRPCMessage): string; +//# sourceMappingURL=stdio.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/shared/stdio.d.ts.map b/front_end/third_party/mcp-sdk/zod/dist/shared/stdio.d.ts.map new file mode 100644 index 0000000000..c7da7764b7 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/shared/stdio.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"stdio.d.ts","sourceRoot":"","sources":["../../src/shared/stdio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,aAAa,CAAC;AAEnE;;GAEG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,OAAO,CAAC,CAAS;IAEzB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAI3B,WAAW,IAAI,cAAc,GAAG,IAAI;IAepC,KAAK,IAAI,IAAI;CAGd;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAE/D;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,CAEhE"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/shared/stdio.js b/front_end/third_party/mcp-sdk/zod/dist/shared/stdio.js new file mode 100644 index 0000000000..d0dde05886 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/shared/stdio.js @@ -0,0 +1,31 @@ +import { JSONRPCMessageSchema } from "../types.js"; +/** + * Buffers a continuous stdio stream into discrete JSON-RPC messages. + */ +export class ReadBuffer { + append(chunk) { + this._buffer = this._buffer ? Buffer.concat([this._buffer, chunk]) : chunk; + } + readMessage() { + if (!this._buffer) { + return null; + } + const index = this._buffer.indexOf("\n"); + if (index === -1) { + return null; + } + const line = this._buffer.toString("utf8", 0, index); + this._buffer = this._buffer.subarray(index + 1); + return deserializeMessage(line); + } + clear() { + this._buffer = undefined; + } +} +export function deserializeMessage(line) { + return JSONRPCMessageSchema.parse(JSON.parse(line)); +} +export function serializeMessage(message) { + return JSON.stringify(message) + "\n"; +} +//# sourceMappingURL=stdio.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/shared/stdio.js.map b/front_end/third_party/mcp-sdk/zod/dist/shared/stdio.js.map new file mode 100644 index 0000000000..77ca55aa54 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/shared/stdio.js.map @@ -0,0 +1 @@ +{"version":3,"file":"stdio.js","sourceRoot":"","sources":["../../src/shared/stdio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnE;;GAEG;AACH,MAAM,OAAO,UAAU;IAGrB,MAAM,CAAC,KAAa;QAClB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAC7E,CAAC;IAED,WAAW;QACT,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YAClB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;YACjB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;QACrD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QAChD,OAAO,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;IAED,KAAK;QACH,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC;IAC3B,CAAC;CACF;AAED,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,OAAO,oBAAoB,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;AACtD,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,OAAuB;IACtD,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;AACxC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/shared/stdio.test.d.ts b/front_end/third_party/mcp-sdk/zod/dist/shared/stdio.test.d.ts new file mode 100644 index 0000000000..08756f1fed --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/shared/stdio.test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=stdio.test.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/shared/stdio.test.d.ts.map b/front_end/third_party/mcp-sdk/zod/dist/shared/stdio.test.d.ts.map new file mode 100644 index 0000000000..74d313b133 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/shared/stdio.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"stdio.test.d.ts","sourceRoot":"","sources":["../../src/shared/stdio.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/shared/stdio.test.js b/front_end/third_party/mcp-sdk/zod/dist/shared/stdio.test.js new file mode 100644 index 0000000000..35b669b48e --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/shared/stdio.test.js @@ -0,0 +1,27 @@ +import { ReadBuffer } from "./stdio.js"; +const testMessage = { + jsonrpc: "2.0", + method: "foobar", +}; +test("should have no messages after initialization", () => { + const readBuffer = new ReadBuffer(); + expect(readBuffer.readMessage()).toBeNull(); +}); +test("should only yield a message after a newline", () => { + const readBuffer = new ReadBuffer(); + readBuffer.append(Buffer.from(JSON.stringify(testMessage))); + expect(readBuffer.readMessage()).toBeNull(); + readBuffer.append(Buffer.from("\n")); + expect(readBuffer.readMessage()).toEqual(testMessage); + expect(readBuffer.readMessage()).toBeNull(); +}); +test("should be reusable after clearing", () => { + const readBuffer = new ReadBuffer(); + readBuffer.append(Buffer.from("foobar")); + readBuffer.clear(); + expect(readBuffer.readMessage()).toBeNull(); + readBuffer.append(Buffer.from(JSON.stringify(testMessage))); + readBuffer.append(Buffer.from("\n")); + expect(readBuffer.readMessage()).toEqual(testMessage); +}); +//# sourceMappingURL=stdio.test.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/shared/stdio.test.js.map b/front_end/third_party/mcp-sdk/zod/dist/shared/stdio.test.js.map new file mode 100644 index 0000000000..283f9943a5 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/shared/stdio.test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"stdio.test.js","sourceRoot":"","sources":["../../src/shared/stdio.test.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,WAAW,GAAmB;IAClC,OAAO,EAAE,KAAK;IACd,MAAM,EAAE,QAAQ;CACjB,CAAC;AAEF,IAAI,CAAC,8CAA8C,EAAE,GAAG,EAAE;IACxD,MAAM,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC;IACpC,MAAM,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;AAC9C,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,6CAA6C,EAAE,GAAG,EAAE;IACvD,MAAM,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC;IAEpC,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAC5D,MAAM,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;IAE5C,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACrC,MAAM,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IACtD,MAAM,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;AAC9C,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,mCAAmC,EAAE,GAAG,EAAE;IAC7C,MAAM,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC;IAEpC,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;IACzC,UAAU,CAAC,KAAK,EAAE,CAAC;IACnB,MAAM,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;IAE5C,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAC5D,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACrC,MAAM,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;AACxD,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/shared/transport.d.ts b/front_end/third_party/mcp-sdk/zod/dist/shared/transport.d.ts new file mode 100644 index 0000000000..faae12820b --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/shared/transport.d.ts @@ -0,0 +1,39 @@ +import { JSONRPCMessage } from "../types.js"; +/** + * Describes the minimal contract for a MCP transport that a client or server can communicate over. + */ +export interface Transport { + /** + * Starts processing messages on the transport, including any connection steps that might need to be taken. + * + * This method should only be called after callbacks are installed, or else messages may be lost. + * + * NOTE: This method should not be called explicitly when using Client, Server, or Protocol classes, as they will implicitly call start(). + */ + start(): Promise; + /** + * Sends a JSON-RPC message (request or response). + */ + send(message: JSONRPCMessage): Promise; + /** + * Closes the connection. + */ + close(): Promise; + /** + * Callback for when the connection is closed for any reason. + * + * This should be invoked when close() is called as well. + */ + onclose?: () => void; + /** + * Callback for when an error occurs. + * + * Note that errors are not necessarily fatal; they are used for reporting any kind of exceptional condition out of band. + */ + onerror?: (error: Error) => void; + /** + * Callback for when a message (request or response) is received over the connection. + */ + onmessage?: (message: JSONRPCMessage) => void; +} +//# sourceMappingURL=transport.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/shared/transport.d.ts.map b/front_end/third_party/mcp-sdk/zod/dist/shared/transport.d.ts.map new file mode 100644 index 0000000000..8db9ddf6d1 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/shared/transport.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/shared/transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;;;;;OAMG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB;;OAEG;IACH,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7C;;OAEG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAEjC;;OAEG;IACH,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;CAC/C"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/shared/transport.js b/front_end/third_party/mcp-sdk/zod/dist/shared/transport.js new file mode 100644 index 0000000000..00d3520ba0 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/shared/transport.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=transport.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/shared/transport.js.map b/front_end/third_party/mcp-sdk/zod/dist/shared/transport.js.map new file mode 100644 index 0000000000..75cff09644 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/shared/transport.js.map @@ -0,0 +1 @@ +{"version":3,"file":"transport.js","sourceRoot":"","sources":["../../src/shared/transport.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/types.d.ts b/front_end/third_party/mcp-sdk/zod/dist/types.d.ts new file mode 100644 index 0000000000..395fcba4ce --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/types.d.ts @@ -0,0 +1,26425 @@ +import { z } from "zod"; +export declare const LATEST_PROTOCOL_VERSION = "2024-11-05"; +export declare const SUPPORTED_PROTOCOL_VERSIONS: string[]; +export declare const JSONRPC_VERSION = "2.0"; +/** + * A progress token, used to associate progress notifications with the original request. + */ +export declare const ProgressTokenSchema: z.ZodUnion<[z.ZodString, z.ZodNumber]>; +/** + * An opaque token used to represent a cursor for pagination. + */ +export declare const CursorSchema: z.ZodString; +export declare const RequestSchema: z.ZodObject<{ + method: z.ZodString; + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, "strip", z.ZodTypeAny, { + method: string; + params?: z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: string; + params?: z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +export declare const NotificationSchema: z.ZodObject<{ + method: z.ZodString; + params: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, "strip", z.ZodTypeAny, { + method: string; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: string; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +export declare const ResultSchema: z.ZodObject<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, z.ZodTypeAny, "passthrough">>; +/** + * A uniquely identifying ID for a request in JSON-RPC. + */ +export declare const RequestIdSchema: z.ZodUnion<[z.ZodString, z.ZodNumber]>; +/** + * A request that expects a response. + */ +export declare const JSONRPCRequestSchema: z.ZodObject; + id: z.ZodUnion<[z.ZodString, z.ZodNumber]>; +}, { + method: z.ZodString; + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}>, "strict", z.ZodTypeAny, { + method: string; + jsonrpc: "2.0"; + id: string | number; + params?: z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: string; + jsonrpc: "2.0"; + id: string | number; + params?: z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * A notification which does not expect a response. + */ +export declare const JSONRPCNotificationSchema: z.ZodObject; +}, { + method: z.ZodString; + params: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}>, "strict", z.ZodTypeAny, { + method: string; + jsonrpc: "2.0"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: string; + jsonrpc: "2.0"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * A successful (non-error) response to a request. + */ +export declare const JSONRPCResponseSchema: z.ZodObject<{ + jsonrpc: z.ZodLiteral<"2.0">; + id: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + result: z.ZodObject<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; +}, "strict", z.ZodTypeAny, { + jsonrpc: "2.0"; + id: string | number; + result: { + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; +}, { + jsonrpc: "2.0"; + id: string | number; + result: { + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; +}>; +/** + * An incomplete set of error codes that may appear in JSON-RPC responses. + */ +export declare enum ErrorCode { + ConnectionClosed = -1, + RequestTimeout = -2, + ParseError = -32700, + InvalidRequest = -32600, + MethodNotFound = -32601, + InvalidParams = -32602, + InternalError = -32603 +} +/** + * A response to a request that indicates an error occurred. + */ +export declare const JSONRPCErrorSchema: z.ZodObject<{ + jsonrpc: z.ZodLiteral<"2.0">; + id: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + error: z.ZodObject<{ + /** + * The error type that occurred. + */ + code: z.ZodNumber; + /** + * A short description of the error. The message SHOULD be limited to a concise single sentence. + */ + message: z.ZodString; + /** + * Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.). + */ + data: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + code: number; + message: string; + data?: unknown; + }, { + code: number; + message: string; + data?: unknown; + }>; +}, "strict", z.ZodTypeAny, { + jsonrpc: "2.0"; + id: string | number; + error: { + code: number; + message: string; + data?: unknown; + }; +}, { + jsonrpc: "2.0"; + id: string | number; + error: { + code: number; + message: string; + data?: unknown; + }; +}>; +export declare const JSONRPCMessageSchema: z.ZodUnion<[z.ZodObject; + id: z.ZodUnion<[z.ZodString, z.ZodNumber]>; +}, { + method: z.ZodString; + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}>, "strict", z.ZodTypeAny, { + method: string; + jsonrpc: "2.0"; + id: string | number; + params?: z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: string; + jsonrpc: "2.0"; + id: string | number; + params?: z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject; +}, { + method: z.ZodString; + params: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}>, "strict", z.ZodTypeAny, { + method: string; + jsonrpc: "2.0"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: string; + jsonrpc: "2.0"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject<{ + jsonrpc: z.ZodLiteral<"2.0">; + id: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + result: z.ZodObject<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; +}, "strict", z.ZodTypeAny, { + jsonrpc: "2.0"; + id: string | number; + result: { + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; +}, { + jsonrpc: "2.0"; + id: string | number; + result: { + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; +}>, z.ZodObject<{ + jsonrpc: z.ZodLiteral<"2.0">; + id: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + error: z.ZodObject<{ + /** + * The error type that occurred. + */ + code: z.ZodNumber; + /** + * A short description of the error. The message SHOULD be limited to a concise single sentence. + */ + message: z.ZodString; + /** + * Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.). + */ + data: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + code: number; + message: string; + data?: unknown; + }, { + code: number; + message: string; + data?: unknown; + }>; +}, "strict", z.ZodTypeAny, { + jsonrpc: "2.0"; + id: string | number; + error: { + code: number; + message: string; + data?: unknown; + }; +}, { + jsonrpc: "2.0"; + id: string | number; + error: { + code: number; + message: string; + data?: unknown; + }; +}>]>; +/** + * A response that indicates success but carries no data. + */ +export declare const EmptyResultSchema: z.ZodObject<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, "strict", z.ZodTypeAny, { + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; +}, { + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * This notification can be sent by either side to indicate that it is cancelling a previously-issued request. + * + * The request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished. + * + * This notification indicates that the result will be unused, so any associated processing SHOULD cease. + * + * A client MUST NOT attempt to cancel its `initialize` request. + */ +export declare const CancelledNotificationSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/cancelled">; + params: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The ID of the request to cancel. + * + * This MUST correspond to the ID of a request previously issued in the same direction. + */ + requestId: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + /** + * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. + */ + reason: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The ID of the request to cancel. + * + * This MUST correspond to the ID of a request previously issued in the same direction. + */ + requestId: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + /** + * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. + */ + reason: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The ID of the request to cancel. + * + * This MUST correspond to the ID of a request previously issued in the same direction. + */ + requestId: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + /** + * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. + */ + reason: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + requestId: string | number; + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + reason?: string | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/cancelled"; +}, { + params: { + requestId: string | number; + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + reason?: string | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/cancelled"; +}>; +/** + * Describes the name and version of an MCP implementation. + */ +export declare const ImplementationSchema: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; +}, z.ZodTypeAny, "passthrough">>; +/** + * Capabilities a client may support. Known capabilities are defined here, in this schema, but this is not a closed set: any client can define its own, additional capabilities. + */ +export declare const ClientCapabilitiesSchema: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; +}, z.ZodTypeAny, "passthrough">>; +/** + * This request is sent from the client to the server when it first connects, asking it to begin initialization. + */ +export declare const InitializeRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"initialize">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + clientInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + clientInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + clientInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + protocolVersion: string; + capabilities: { + experimental?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + sampling?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + roots?: z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + clientInfo: { + name: string; + version: string; + } & { + [k: string]: unknown; + }; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "initialize"; +}, { + params: { + protocolVersion: string; + capabilities: { + experimental?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + sampling?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + roots?: z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + clientInfo: { + name: string; + version: string; + } & { + [k: string]: unknown; + }; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "initialize"; +}>; +/** + * Capabilities that a server may support. Known capabilities are defined here, in this schema, but this is not a closed set: any server can define its own, additional capabilities. + */ +export declare const ServerCapabilitiesSchema: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; +}, z.ZodTypeAny, "passthrough">>; +/** + * After receiving an initialize request from the client, the server sends this response. + */ +export declare const InitializeResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + serverInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + serverInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + serverInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; +}>, z.ZodTypeAny, "passthrough">>; +/** + * This notification is sent from the client to the server after initialization has finished. + */ +export declare const InitializedNotificationSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/initialized">; +}>, "strip", z.ZodTypeAny, { + method: "notifications/initialized"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "notifications/initialized"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * A ping, issued by either the server or the client, to check that the other party is still alive. The receiver must promptly respond, or else may be disconnected. + */ +export declare const PingRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"ping">; +}>, "strip", z.ZodTypeAny, { + method: "ping"; + params?: z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "ping"; + params?: z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +export declare const ProgressSchema: z.ZodObject<{ + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">>; +/** + * An out-of-band notification used to inform the receiver of a progress update for a long-running request. + */ +export declare const ProgressNotificationSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/progress">; + params: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + }>, { + /** + * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. + */ + progressToken: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + }>, { + /** + * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. + */ + progressToken: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + }>, { + /** + * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. + */ + progressToken: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + progressToken: string | number; + progress: number; + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + total?: number | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/progress"; +}, { + params: { + progressToken: string | number; + progress: number; + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + total?: number | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/progress"; +}>; +export declare const PaginatedRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>>; +}>, "strip", z.ZodTypeAny, { + method: string; + params?: z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: string; + params?: z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}>; +export declare const PaginatedResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, z.ZodTypeAny, "passthrough">>; +/** + * The contents of a specific resource or sub-resource. + */ +export declare const ResourceContentsSchema: z.ZodObject<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">>; +export declare const TextResourceContentsSchema: z.ZodObject; +}, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType; +}, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType; +}, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; +}>, z.ZodTypeAny, "passthrough">>; +export declare const BlobResourceContentsSchema: z.ZodObject; +}, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType; +}, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType; +}, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; +}>, z.ZodTypeAny, "passthrough">>; +/** + * A known resource that the server is capable of reading. + */ +export declare const ResourceSchema: z.ZodObject<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">>; +/** + * A template description for resources available on the server. + */ +export declare const ResourceTemplateSchema: z.ZodObject<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">>; +/** + * Sent from the client to request a list of resources the server has. + */ +export declare const ListResourcesRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>>; +}>, { + method: z.ZodLiteral<"resources/list">; +}>, "strip", z.ZodTypeAny, { + method: "resources/list"; + params?: z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "resources/list"; + params?: z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * The server's response to a resources/list request from the client. + */ +export declare const ListResourcesResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resources: z.ZodArray; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resources: z.ZodArray; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resources: z.ZodArray; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>; +/** + * Sent from the client to request a list of resource templates the server has. + */ +export declare const ListResourceTemplatesRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>>; +}>, { + method: z.ZodLiteral<"resources/templates/list">; +}>, "strip", z.ZodTypeAny, { + method: "resources/templates/list"; + params?: z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "resources/templates/list"; + params?: z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * The server's response to a resources/templates/list request from the client. + */ +export declare const ListResourceTemplatesResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resourceTemplates: z.ZodArray; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resourceTemplates: z.ZodArray; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resourceTemplates: z.ZodArray; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>; +/** + * Sent from the client to the server, to read a specific resource URI. + */ +export declare const ReadResourceRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"resources/read">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + uri: string; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/read"; +}, { + params: { + uri: string; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/read"; +}>; +/** + * The server's response to a resources/read request from the client. + */ +export declare const ReadResourceResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + contents: z.ZodArray; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + contents: z.ZodArray; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + contents: z.ZodArray; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>, "many">; +}>, z.ZodTypeAny, "passthrough">>; +/** + * An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This may be issued by servers without any previous subscription from the client. + */ +export declare const ResourceListChangedNotificationSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/resources/list_changed">; +}>, "strip", z.ZodTypeAny, { + method: "notifications/resources/list_changed"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "notifications/resources/list_changed"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * Sent from the client to request resources/updated notifications from the server whenever a particular resource changes. + */ +export declare const SubscribeRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"resources/subscribe">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + uri: string; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/subscribe"; +}, { + params: { + uri: string; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/subscribe"; +}>; +/** + * Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request. + */ +export declare const UnsubscribeRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"resources/unsubscribe">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to unsubscribe from. + */ + uri: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to unsubscribe from. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to unsubscribe from. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + uri: string; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/unsubscribe"; +}, { + params: { + uri: string; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/unsubscribe"; +}>; +/** + * A notification from the server to the client, informing it that a resource has changed and may need to be read again. This should only be sent if the client previously sent a resources/subscribe request. + */ +export declare const ResourceUpdatedNotificationSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/resources/updated">; + params: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to. + */ + uri: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + uri: string; + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/resources/updated"; +}, { + params: { + uri: string; + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/resources/updated"; +}>; +/** + * Describes an argument that a prompt can accept. + */ +export declare const PromptArgumentSchema: z.ZodObject<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">>; +/** + * A prompt or prompt template that the server offers. + */ +export declare const PromptSchema: z.ZodObject<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; +}, z.ZodTypeAny, "passthrough">>; +/** + * Sent from the client to request a list of prompts and prompt templates the server has. + */ +export declare const ListPromptsRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>>; +}>, { + method: z.ZodLiteral<"prompts/list">; +}>, "strip", z.ZodTypeAny, { + method: "prompts/list"; + params?: z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "prompts/list"; + params?: z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * The server's response to a prompts/list request from the client. + */ +export declare const ListPromptsResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + prompts: z.ZodArray; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + prompts: z.ZodArray; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + prompts: z.ZodArray; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>; +/** + * Used by the client to get a prompt provided by the server. + */ +export declare const GetPromptRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"prompts/get">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * Arguments to use for templating the prompt. + */ + arguments: z.ZodOptional>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * Arguments to use for templating the prompt. + */ + arguments: z.ZodOptional>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * Arguments to use for templating the prompt. + */ + arguments: z.ZodOptional>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + name: string; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + arguments?: Record | undefined; + } & { + [k: string]: unknown; + }; + method: "prompts/get"; +}, { + params: { + name: string; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + arguments?: Record | undefined; + } & { + [k: string]: unknown; + }; + method: "prompts/get"; +}>; +/** + * Text provided to or from an LLM. + */ +export declare const TextContentSchema: z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; +}, z.ZodTypeAny, "passthrough">>; +/** + * An image provided to or from an LLM. + */ +export declare const ImageContentSchema: z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; +}, z.ZodTypeAny, "passthrough">>; +/** + * The contents of a resource, embedded into a prompt or tool call result. + */ +export declare const EmbeddedResourceSchema: z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; +}, z.ZodTypeAny, "passthrough">>; +/** + * Describes a message returned as part of a prompt. + */ +export declare const PromptMessageSchema: z.ZodObject<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; +}, z.ZodTypeAny, "passthrough">>; +/** + * The server's response to a prompts/get request from the client. + */ +export declare const GetPromptResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An optional description for the prompt. + */ + description: z.ZodOptional; + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An optional description for the prompt. + */ + description: z.ZodOptional; + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An optional description for the prompt. + */ + description: z.ZodOptional; + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>; +/** + * An optional notification from the server to the client, informing it that the list of prompts it offers has changed. This may be issued by servers without any previous subscription from the client. + */ +export declare const PromptListChangedNotificationSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/prompts/list_changed">; +}>, "strip", z.ZodTypeAny, { + method: "notifications/prompts/list_changed"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "notifications/prompts/list_changed"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * Definition for a tool the client can call. + */ +export declare const ToolSchema: z.ZodObject<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; +}, z.ZodTypeAny, "passthrough">>; +/** + * Sent from the client to request a list of tools the server has. + */ +export declare const ListToolsRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>>; +}>, { + method: z.ZodLiteral<"tools/list">; +}>, "strip", z.ZodTypeAny, { + method: "tools/list"; + params?: z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "tools/list"; + params?: z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * The server's response to a tools/list request from the client. + */ +export declare const ListToolsResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + tools: z.ZodArray; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + tools: z.ZodArray; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + tools: z.ZodArray; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>; +/** + * The server's response to a tool call. + */ +export declare const CallToolResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + content: z.ZodArray; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>, "many">; + isError: z.ZodOptional>; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + content: z.ZodArray; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>, "many">; + isError: z.ZodOptional>; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + content: z.ZodArray; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>, "many">; + isError: z.ZodOptional>; +}>, z.ZodTypeAny, "passthrough">>; +/** + * CallToolResultSchema extended with backwards compatibility to protocol version 2024-10-07. + */ +export declare const CompatibilityCallToolResultSchema: z.ZodUnion<[z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + content: z.ZodArray; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>, "many">; + isError: z.ZodOptional>; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + content: z.ZodArray; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>, "many">; + isError: z.ZodOptional>; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + content: z.ZodArray; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>, "many">; + isError: z.ZodOptional>; +}>, z.ZodTypeAny, "passthrough">>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + toolResult: z.ZodUnknown; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + toolResult: z.ZodUnknown; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + toolResult: z.ZodUnknown; +}>, z.ZodTypeAny, "passthrough">>]>; +/** + * Used by the client to invoke a tool provided by the server. + */ +export declare const CallToolRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"tools/call">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + name: z.ZodString; + arguments: z.ZodOptional>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + name: z.ZodString; + arguments: z.ZodOptional>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + name: z.ZodString; + arguments: z.ZodOptional>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + name: string; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + arguments?: Record | undefined; + } & { + [k: string]: unknown; + }; + method: "tools/call"; +}, { + params: { + name: string; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + arguments?: Record | undefined; + } & { + [k: string]: unknown; + }; + method: "tools/call"; +}>; +/** + * An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client. + */ +export declare const ToolListChangedNotificationSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/tools/list_changed">; +}>, "strip", z.ZodTypeAny, { + method: "notifications/tools/list_changed"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "notifications/tools/list_changed"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * The severity of a log message. + */ +export declare const LoggingLevelSchema: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; +/** + * A request from the client to the server, to enable or adjust logging. + */ +export declare const SetLevelRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"logging/setLevel">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + level: "error" | "debug" | "info" | "notice" | "warning" | "critical" | "alert" | "emergency"; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "logging/setLevel"; +}, { + params: { + level: "error" | "debug" | "info" | "notice" | "warning" | "critical" | "alert" | "emergency"; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "logging/setLevel"; +}>; +/** + * Notification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically. + */ +export declare const LoggingMessageNotificationSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/message">; + params: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The severity of this log message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + /** + * An optional name of the logger issuing this message. + */ + logger: z.ZodOptional; + /** + * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here. + */ + data: z.ZodUnknown; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The severity of this log message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + /** + * An optional name of the logger issuing this message. + */ + logger: z.ZodOptional; + /** + * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here. + */ + data: z.ZodUnknown; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The severity of this log message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + /** + * An optional name of the logger issuing this message. + */ + logger: z.ZodOptional; + /** + * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here. + */ + data: z.ZodUnknown; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + level: "error" | "debug" | "info" | "notice" | "warning" | "critical" | "alert" | "emergency"; + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + data?: unknown; + logger?: string | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/message"; +}, { + params: { + level: "error" | "debug" | "info" | "notice" | "warning" | "critical" | "alert" | "emergency"; + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + data?: unknown; + logger?: string | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/message"; +}>; +/** + * Hints to use for model selection. + */ +export declare const ModelHintSchema: z.ZodObject<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">>; +/** + * The server's preferences for model selection, requested of the client during sampling. + */ +export declare const ModelPreferencesSchema: z.ZodObject<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">>; +/** + * Describes a message issued to or received from an LLM API. + */ +export declare const SamplingMessageSchema: z.ZodObject<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; +}, z.ZodTypeAny, "passthrough">>; +/** + * A request from the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it. + */ +export declare const CreateMessageRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"sampling/createMessage">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; + /** + * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt. + */ + systemPrompt: z.ZodOptional; + /** + * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request. + */ + includeContext: z.ZodOptional>; + temperature: z.ZodOptional; + /** + * The maximum number of tokens to sample, as requested by the server. The client MAY choose to sample fewer tokens than requested. + */ + maxTokens: z.ZodNumber; + stopSequences: z.ZodOptional>; + /** + * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific. + */ + metadata: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * The server's preferences for which model to select. + */ + modelPreferences: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; + /** + * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt. + */ + systemPrompt: z.ZodOptional; + /** + * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request. + */ + includeContext: z.ZodOptional>; + temperature: z.ZodOptional; + /** + * The maximum number of tokens to sample, as requested by the server. The client MAY choose to sample fewer tokens than requested. + */ + maxTokens: z.ZodNumber; + stopSequences: z.ZodOptional>; + /** + * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific. + */ + metadata: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * The server's preferences for which model to select. + */ + modelPreferences: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; + /** + * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt. + */ + systemPrompt: z.ZodOptional; + /** + * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request. + */ + includeContext: z.ZodOptional>; + temperature: z.ZodOptional; + /** + * The maximum number of tokens to sample, as requested by the server. The client MAY choose to sample fewer tokens than requested. + */ + maxTokens: z.ZodNumber; + stopSequences: z.ZodOptional>; + /** + * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific. + */ + metadata: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * The server's preferences for which model to select. + */ + modelPreferences: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + messages: z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">[]; + maxTokens: number; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + systemPrompt?: string | undefined; + includeContext?: "none" | "thisServer" | "allServers" | undefined; + temperature?: number | undefined; + stopSequences?: string[] | undefined; + metadata?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + modelPreferences?: z.objectOutputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "sampling/createMessage"; +}, { + params: { + messages: z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">[]; + maxTokens: number; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + systemPrompt?: string | undefined; + includeContext?: "none" | "thisServer" | "allServers" | undefined; + temperature?: number | undefined; + stopSequences?: string[] | undefined; + metadata?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + modelPreferences?: z.objectInputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "sampling/createMessage"; +}>; +/** + * The client's response to a sampling/create_message request from the server. The client should inform the user before returning the sampled message, to allow them to inspect the response (human in the loop) and decide whether to allow the server to see it. + */ +export declare const CreateMessageResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The name of the model that generated the message. + */ + model: z.ZodString; + /** + * The reason why sampling stopped. + */ + stopReason: z.ZodOptional, z.ZodString]>>; + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The name of the model that generated the message. + */ + model: z.ZodString; + /** + * The reason why sampling stopped. + */ + stopReason: z.ZodOptional, z.ZodString]>>; + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The name of the model that generated the message. + */ + model: z.ZodString; + /** + * The reason why sampling stopped. + */ + stopReason: z.ZodOptional, z.ZodString]>>; + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; +}>, z.ZodTypeAny, "passthrough">>; +/** + * A reference to a resource or resource template definition. + */ +export declare const ResourceReferenceSchema: z.ZodObject<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; +}, z.ZodTypeAny, "passthrough">>; +/** + * Identifies a prompt. + */ +export declare const PromptReferenceSchema: z.ZodObject<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; +}, z.ZodTypeAny, "passthrough">>; +/** + * A request from the client to the server, to ask for completion options. + */ +export declare const CompleteRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"completion/complete">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + ref: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + /** + * The argument's information + */ + argument: z.ZodObject<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + ref: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + /** + * The argument's information + */ + argument: z.ZodObject<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + ref: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + /** + * The argument's information + */ + argument: z.ZodObject<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + ref: z.objectOutputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">; + argument: { + value: string; + name: string; + } & { + [k: string]: unknown; + }; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "completion/complete"; +}, { + params: { + ref: z.objectInputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough"> | z.objectInputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">; + argument: { + value: string; + name: string; + } & { + [k: string]: unknown; + }; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "completion/complete"; +}>; +/** + * The server's response to a completion/complete request + */ +export declare const CompleteResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + completion: z.ZodObject<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + completion: z.ZodObject<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + completion: z.ZodObject<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>; +}>, z.ZodTypeAny, "passthrough">>; +/** + * Represents a root directory or file that the server can operate on. + */ +export declare const RootSchema: z.ZodObject<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; +}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; +}, z.ZodTypeAny, "passthrough">>; +/** + * Sent from the server to request a list of root URIs from the client. + */ +export declare const ListRootsRequestSchema: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"roots/list">; +}>, "strip", z.ZodTypeAny, { + method: "roots/list"; + params?: z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "roots/list"; + params?: z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +/** + * The client's response to a roots/list request from the server. + */ +export declare const ListRootsResultSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + roots: z.ZodArray; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + roots: z.ZodArray; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + roots: z.ZodArray; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>; +/** + * A notification from the client to the server, informing it that the list of roots has changed. + */ +export declare const RootsListChangedNotificationSchema: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/roots/list_changed">; +}>, "strip", z.ZodTypeAny, { + method: "notifications/roots/list_changed"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "notifications/roots/list_changed"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>; +export declare const ClientRequestSchema: z.ZodUnion<[z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"ping">; +}>, "strip", z.ZodTypeAny, { + method: "ping"; + params?: z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "ping"; + params?: z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"initialize">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + clientInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + clientInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the client supports listing roots. + */ + roots: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + clientInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + protocolVersion: string; + capabilities: { + experimental?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + sampling?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + roots?: z.objectOutputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + clientInfo: { + name: string; + version: string; + } & { + [k: string]: unknown; + }; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "initialize"; +}, { + params: { + protocolVersion: string; + capabilities: { + experimental?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + sampling?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + roots?: z.objectInputType<{ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + clientInfo: { + name: string; + version: string; + } & { + [k: string]: unknown; + }; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "initialize"; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"completion/complete">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + ref: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + /** + * The argument's information + */ + argument: z.ZodObject<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + ref: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + /** + * The argument's information + */ + argument: z.ZodObject<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + ref: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + /** + * The argument's information + */ + argument: z.ZodObject<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument + */ + name: z.ZodString; + /** + * The value of the argument to use for completion matching. + */ + value: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + ref: z.objectOutputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">; + argument: { + value: string; + name: string; + } & { + [k: string]: unknown; + }; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "completion/complete"; +}, { + params: { + ref: z.objectInputType<{ + type: z.ZodLiteral<"ref/resource">; + /** + * The URI or URI template of the resource. + */ + uri: z.ZodString; + }, z.ZodTypeAny, "passthrough"> | z.objectInputType<{ + type: z.ZodLiteral<"ref/prompt">; + /** + * The name of the prompt or prompt template + */ + name: z.ZodString; + }, z.ZodTypeAny, "passthrough">; + argument: { + value: string; + name: string; + } & { + [k: string]: unknown; + }; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "completion/complete"; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"logging/setLevel">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + level: "error" | "debug" | "info" | "notice" | "warning" | "critical" | "alert" | "emergency"; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "logging/setLevel"; +}, { + params: { + level: "error" | "debug" | "info" | "notice" | "warning" | "critical" | "alert" | "emergency"; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "logging/setLevel"; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"prompts/get">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * Arguments to use for templating the prompt. + */ + arguments: z.ZodOptional>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * Arguments to use for templating the prompt. + */ + arguments: z.ZodOptional>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * Arguments to use for templating the prompt. + */ + arguments: z.ZodOptional>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + name: string; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + arguments?: Record | undefined; + } & { + [k: string]: unknown; + }; + method: "prompts/get"; +}, { + params: { + name: string; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + arguments?: Record | undefined; + } & { + [k: string]: unknown; + }; + method: "prompts/get"; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>>; +}>, { + method: z.ZodLiteral<"prompts/list">; +}>, "strip", z.ZodTypeAny, { + method: "prompts/list"; + params?: z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "prompts/list"; + params?: z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>>; +}>, { + method: z.ZodLiteral<"resources/list">; +}>, "strip", z.ZodTypeAny, { + method: "resources/list"; + params?: z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "resources/list"; + params?: z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>>; +}>, { + method: z.ZodLiteral<"resources/templates/list">; +}>, "strip", z.ZodTypeAny, { + method: "resources/templates/list"; + params?: z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "resources/templates/list"; + params?: z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"resources/read">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + uri: string; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/read"; +}, { + params: { + uri: string; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/read"; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"resources/subscribe">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + uri: string; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/subscribe"; +}, { + params: { + uri: string; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/subscribe"; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"resources/unsubscribe">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to unsubscribe from. + */ + uri: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to unsubscribe from. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource to unsubscribe from. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + uri: string; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/unsubscribe"; +}, { + params: { + uri: string; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "resources/unsubscribe"; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"tools/call">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + name: z.ZodString; + arguments: z.ZodOptional>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + name: z.ZodString; + arguments: z.ZodOptional>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + name: z.ZodString; + arguments: z.ZodOptional>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + name: string; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + arguments?: Record | undefined; + } & { + [k: string]: unknown; + }; + method: "tools/call"; +}, { + params: { + name: string; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + arguments?: Record | undefined; + } & { + [k: string]: unknown; + }; + method: "tools/call"; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + params: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>>; +}>, { + method: z.ZodLiteral<"tools/list">; +}>, "strip", z.ZodTypeAny, { + method: "tools/list"; + params?: z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "tools/list"; + params?: z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough"> | undefined; +}>]>; +export declare const ClientNotificationSchema: z.ZodUnion<[z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/cancelled">; + params: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The ID of the request to cancel. + * + * This MUST correspond to the ID of a request previously issued in the same direction. + */ + requestId: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + /** + * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. + */ + reason: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The ID of the request to cancel. + * + * This MUST correspond to the ID of a request previously issued in the same direction. + */ + requestId: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + /** + * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. + */ + reason: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The ID of the request to cancel. + * + * This MUST correspond to the ID of a request previously issued in the same direction. + */ + requestId: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + /** + * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. + */ + reason: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + requestId: string | number; + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + reason?: string | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/cancelled"; +}, { + params: { + requestId: string | number; + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + reason?: string | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/cancelled"; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/progress">; + params: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + }>, { + /** + * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. + */ + progressToken: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + }>, { + /** + * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. + */ + progressToken: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + }>, { + /** + * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. + */ + progressToken: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + progressToken: string | number; + progress: number; + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + total?: number | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/progress"; +}, { + params: { + progressToken: string | number; + progress: number; + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + total?: number | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/progress"; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/initialized">; +}>, "strip", z.ZodTypeAny, { + method: "notifications/initialized"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "notifications/initialized"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/roots/list_changed">; +}>, "strip", z.ZodTypeAny, { + method: "notifications/roots/list_changed"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "notifications/roots/list_changed"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>]>; +export declare const ClientResultSchema: z.ZodUnion<[z.ZodObject<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, "strict", z.ZodTypeAny, { + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; +}, { + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The name of the model that generated the message. + */ + model: z.ZodString; + /** + * The reason why sampling stopped. + */ + stopReason: z.ZodOptional, z.ZodString]>>; + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The name of the model that generated the message. + */ + model: z.ZodString; + /** + * The reason why sampling stopped. + */ + stopReason: z.ZodOptional, z.ZodString]>>; + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The name of the model that generated the message. + */ + model: z.ZodString; + /** + * The reason why sampling stopped. + */ + stopReason: z.ZodOptional, z.ZodString]>>; + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; +}>, z.ZodTypeAny, "passthrough">>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + roots: z.ZodArray; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + roots: z.ZodArray; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + roots: z.ZodArray; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.ZodString; + /** + * An optional name for the root. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>]>; +export declare const ServerRequestSchema: z.ZodUnion<[z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"ping">; +}>, "strip", z.ZodTypeAny, { + method: "ping"; + params?: z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "ping"; + params?: z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"sampling/createMessage">; + params: z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; + /** + * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt. + */ + systemPrompt: z.ZodOptional; + /** + * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request. + */ + includeContext: z.ZodOptional>; + temperature: z.ZodOptional; + /** + * The maximum number of tokens to sample, as requested by the server. The client MAY choose to sample fewer tokens than requested. + */ + maxTokens: z.ZodNumber; + stopSequences: z.ZodOptional>; + /** + * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific. + */ + metadata: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * The server's preferences for which model to select. + */ + modelPreferences: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; + /** + * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt. + */ + systemPrompt: z.ZodOptional; + /** + * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request. + */ + includeContext: z.ZodOptional>; + temperature: z.ZodOptional; + /** + * The maximum number of tokens to sample, as requested by the server. The client MAY choose to sample fewer tokens than requested. + */ + maxTokens: z.ZodNumber; + stopSequences: z.ZodOptional>; + /** + * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific. + */ + metadata: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * The server's preferences for which model to select. + */ + modelPreferences: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, { + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; + /** + * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt. + */ + systemPrompt: z.ZodOptional; + /** + * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request. + */ + includeContext: z.ZodOptional>; + temperature: z.ZodOptional; + /** + * The maximum number of tokens to sample, as requested by the server. The client MAY choose to sample fewer tokens than requested. + */ + maxTokens: z.ZodNumber; + stopSequences: z.ZodOptional>; + /** + * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific. + */ + metadata: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * The server's preferences for which model to select. + */ + modelPreferences: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + messages: z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">[]; + maxTokens: number; + _meta?: z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + systemPrompt?: string | undefined; + includeContext?: "none" | "thisServer" | "allServers" | undefined; + temperature?: number | undefined; + stopSequences?: string[] | undefined; + metadata?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + modelPreferences?: z.objectOutputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "sampling/createMessage"; +}, { + params: { + messages: z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">[]; + maxTokens: number; + _meta?: z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough"> | undefined; + systemPrompt?: string | undefined; + includeContext?: "none" | "thisServer" | "allServers" | undefined; + temperature?: number | undefined; + stopSequences?: string[] | undefined; + metadata?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + modelPreferences?: z.objectInputType<{ + /** + * Optional hints to use for model selection. + */ + hints: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A hint for a model name. + */ + name: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.ZodOptional; + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.ZodOptional; + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.ZodOptional; + }, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "sampling/createMessage"; +}>, z.ZodObject>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"roots/list">; +}>, "strip", z.ZodTypeAny, { + method: "roots/list"; + params?: z.objectOutputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "roots/list"; + params?: z.objectInputType<{ + _meta: z.ZodOptional>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.ZodOptional>; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>]>; +export declare const ServerNotificationSchema: z.ZodUnion<[z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/cancelled">; + params: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The ID of the request to cancel. + * + * This MUST correspond to the ID of a request previously issued in the same direction. + */ + requestId: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + /** + * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. + */ + reason: z.ZodOptional; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The ID of the request to cancel. + * + * This MUST correspond to the ID of a request previously issued in the same direction. + */ + requestId: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + /** + * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. + */ + reason: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The ID of the request to cancel. + * + * This MUST correspond to the ID of a request previously issued in the same direction. + */ + requestId: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + /** + * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. + */ + reason: z.ZodOptional; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + requestId: string | number; + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + reason?: string | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/cancelled"; +}, { + params: { + requestId: string | number; + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + reason?: string | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/cancelled"; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/progress">; + params: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + }>, { + /** + * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. + */ + progressToken: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + }>, { + /** + * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. + */ + progressToken: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.ZodNumber; + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.ZodOptional; + }>, { + /** + * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. + */ + progressToken: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + progressToken: string | number; + progress: number; + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + total?: number | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/progress"; +}, { + params: { + progressToken: string | number; + progress: number; + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + total?: number | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/progress"; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/message">; + params: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The severity of this log message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + /** + * An optional name of the logger issuing this message. + */ + logger: z.ZodOptional; + /** + * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here. + */ + data: z.ZodUnknown; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The severity of this log message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + /** + * An optional name of the logger issuing this message. + */ + logger: z.ZodOptional; + /** + * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here. + */ + data: z.ZodUnknown; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The severity of this log message. + */ + level: z.ZodEnum<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>; + /** + * An optional name of the logger issuing this message. + */ + logger: z.ZodOptional; + /** + * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here. + */ + data: z.ZodUnknown; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + level: "error" | "debug" | "info" | "notice" | "warning" | "critical" | "alert" | "emergency"; + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + data?: unknown; + logger?: string | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/message"; +}, { + params: { + level: "error" | "debug" | "info" | "notice" | "warning" | "critical" | "alert" | "emergency"; + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + data?: unknown; + logger?: string | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/message"; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/resources/updated">; + params: z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to. + */ + uri: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, { + /** + * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to. + */ + uri: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>; +}>, "strip", z.ZodTypeAny, { + params: { + uri: string; + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/resources/updated"; +}, { + params: { + uri: string; + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; + } & { + [k: string]: unknown; + }; + method: "notifications/resources/updated"; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/resources/list_changed">; +}>, "strip", z.ZodTypeAny, { + method: "notifications/resources/list_changed"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "notifications/resources/list_changed"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/tools/list_changed">; +}>, "strip", z.ZodTypeAny, { + method: "notifications/tools/list_changed"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "notifications/tools/list_changed"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>>; +}, { + method: z.ZodLiteral<"notifications/prompts/list_changed">; +}>, "strip", z.ZodTypeAny, { + method: "notifications/prompts/list_changed"; + params?: z.objectOutputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}, { + method: "notifications/prompts/list_changed"; + params?: z.objectInputType<{ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough"> | undefined; +}>]>; +export declare const ServerResultSchema: z.ZodUnion<[z.ZodObject<{ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, "strict", z.ZodTypeAny, { + _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; +}, { + _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; +}>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + serverInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + serverInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect. + */ + protocolVersion: z.ZodString; + capabilities: z.ZodObject<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any prompt templates. + */ + prompts: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any resources to read. + */ + resources: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.ZodOptional; + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + /** + * Present if the server offers any tools to call. + */ + tools: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + serverInfo: z.ZodObject<{ + name: z.ZodString; + version: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + name: z.ZodString; + version: z.ZodString; + }, z.ZodTypeAny, "passthrough">>; +}>, z.ZodTypeAny, "passthrough">>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + completion: z.ZodObject<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + completion: z.ZodObject<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + completion: z.ZodObject<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.ZodArray; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.ZodOptional; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>; +}>, z.ZodTypeAny, "passthrough">>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An optional description for the prompt. + */ + description: z.ZodOptional; + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An optional description for the prompt. + */ + description: z.ZodOptional; + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An optional description for the prompt. + */ + description: z.ZodOptional; + messages: z.ZodArray; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + role: z.ZodEnum<["user", "assistant"]>; + content: z.ZodUnion<[z.ZodObject<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + prompts: z.ZodArray; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + prompts: z.ZodArray; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + prompts: z.ZodArray; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the prompt or prompt template. + */ + name: z.ZodString; + /** + * An optional description of what this prompt provides + */ + description: z.ZodOptional; + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the argument. + */ + name: z.ZodString; + /** + * A human-readable description of the argument. + */ + description: z.ZodOptional; + /** + * Whether this argument must be provided. + */ + required: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resources: z.ZodArray; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resources: z.ZodArray; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resources: z.ZodArray; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The URI of this resource. + */ + uri: z.ZodString; + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type of this resource, if known. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resourceTemplates: z.ZodArray; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resourceTemplates: z.ZodArray; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + resourceTemplates: z.ZodArray; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.ZodString; + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.ZodString; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.ZodOptional; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.ZodOptional; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + contents: z.ZodArray; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + contents: z.ZodArray; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + contents: z.ZodArray; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>, "many">; +}>, z.ZodTypeAny, "passthrough">>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + content: z.ZodArray; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>, "many">; + isError: z.ZodOptional>; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + content: z.ZodArray; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>, "many">; + isError: z.ZodOptional>; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + content: z.ZodArray; + /** + * The text content of the message. + */ + text: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"text">; + /** + * The text content of the message. + */ + text: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"image">; + /** + * The base64-encoded image data. + */ + data: z.ZodString; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.ZodString; + }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"resource">; + resource: z.ZodUnion<[z.ZodObject; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>, z.ZodObject; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, "passthrough", z.ZodTypeAny, z.objectOutputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">, z.objectInputType; + }, { + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.ZodString; + }>, z.ZodTypeAny, "passthrough">>]>; + }, z.ZodTypeAny, "passthrough">>]>, "many">; + isError: z.ZodOptional>; +}>, z.ZodTypeAny, "passthrough">>, z.ZodObject, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + tools: z.ZodArray; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, "passthrough", z.ZodTypeAny, z.objectOutputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + tools: z.ZodArray; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">, z.objectInputType, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; +}, { + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.ZodOptional; +}>, { + tools: z.ZodArray; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + /** + * The name of the tool. + */ + name: z.ZodString; + /** + * A human-readable description of the tool. + */ + description: z.ZodOptional; + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z.ZodObject<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ + type: z.ZodLiteral<"object">; + properties: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; + }, z.ZodTypeAny, "passthrough">>; + }, z.ZodTypeAny, "passthrough">>, "many">; +}>, z.ZodTypeAny, "passthrough">>]>; +export declare class McpError extends Error { + readonly code: number; + readonly data?: unknown; + constructor(code: number, message: string, data?: unknown); +} +export type ProgressToken = z.infer; +export type Cursor = z.infer; +export type Request = z.infer; +export type Notification = z.infer; +export type Result = z.infer; +export type RequestId = z.infer; +export type JSONRPCRequest = z.infer; +export type JSONRPCNotification = z.infer; +export type JSONRPCResponse = z.infer; +export type JSONRPCError = z.infer; +export type JSONRPCMessage = z.infer; +export type EmptyResult = z.infer; +export type CancelledNotification = z.infer; +export type Implementation = z.infer; +export type ClientCapabilities = z.infer; +export type InitializeRequest = z.infer; +export type ServerCapabilities = z.infer; +export type InitializeResult = z.infer; +export type InitializedNotification = z.infer; +export type PingRequest = z.infer; +export type Progress = z.infer; +export type ProgressNotification = z.infer; +export type PaginatedRequest = z.infer; +export type PaginatedResult = z.infer; +export type ResourceContents = z.infer; +export type TextResourceContents = z.infer; +export type BlobResourceContents = z.infer; +export type Resource = z.infer; +export type ResourceTemplate = z.infer; +export type ListResourcesRequest = z.infer; +export type ListResourcesResult = z.infer; +export type ListResourceTemplatesRequest = z.infer; +export type ListResourceTemplatesResult = z.infer; +export type ReadResourceRequest = z.infer; +export type ReadResourceResult = z.infer; +export type ResourceListChangedNotification = z.infer; +export type SubscribeRequest = z.infer; +export type UnsubscribeRequest = z.infer; +export type ResourceUpdatedNotification = z.infer; +export type PromptArgument = z.infer; +export type Prompt = z.infer; +export type ListPromptsRequest = z.infer; +export type ListPromptsResult = z.infer; +export type GetPromptRequest = z.infer; +export type TextContent = z.infer; +export type ImageContent = z.infer; +export type EmbeddedResource = z.infer; +export type PromptMessage = z.infer; +export type GetPromptResult = z.infer; +export type PromptListChangedNotification = z.infer; +export type Tool = z.infer; +export type ListToolsRequest = z.infer; +export type ListToolsResult = z.infer; +export type CallToolResult = z.infer; +export type CompatibilityCallToolResult = z.infer; +export type CallToolRequest = z.infer; +export type ToolListChangedNotification = z.infer; +export type LoggingLevel = z.infer; +export type SetLevelRequest = z.infer; +export type LoggingMessageNotification = z.infer; +export type SamplingMessage = z.infer; +export type CreateMessageRequest = z.infer; +export type CreateMessageResult = z.infer; +export type ResourceReference = z.infer; +export type PromptReference = z.infer; +export type CompleteRequest = z.infer; +export type CompleteResult = z.infer; +export type Root = z.infer; +export type ListRootsRequest = z.infer; +export type ListRootsResult = z.infer; +export type RootsListChangedNotification = z.infer; +export type ClientRequest = z.infer; +export type ClientNotification = z.infer; +export type ClientResult = z.infer; +export type ServerRequest = z.infer; +export type ServerNotification = z.infer; +export type ServerResult = z.infer; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/types.d.ts.map b/front_end/third_party/mcp-sdk/zod/dist/types.d.ts.map new file mode 100644 index 0000000000..524fc53c8c --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,uBAAuB,eAAe,CAAC;AACpD,eAAO,MAAM,2BAA2B,UAGvC,CAAC;AAGF,eAAO,MAAM,eAAe,QAAQ,CAAC;AAErC;;GAEG;AACH,eAAO,MAAM,mBAAmB,wCAA0C,CAAC;AAE3E;;GAEG;AACH,eAAO,MAAM,YAAY,aAAa,CAAC;AAiBvC,eAAO,MAAM,aAAa;;;;YAVhB;;eAEG;;;YAFH;;eAEG;;;YAFH;;eAEG;;;;;YAFH;;eAEG;;;YAFH;;eAEG;;;YAFH;;eAEG;;;;;YAFH;;eAEG;;;YAFH;;eAEG;;;YAFH;;eAEG;;;;;;;;YAFH;;eAEG;;;YAFH;;eAEG;;;YAFH;;eAEG;;;;;;;;YAFH;;eAEG;;;YAFH;;eAEG;;;YAFH;;eAEG;;;;EAWX,CAAC;AAWH,eAAO,MAAM,kBAAkB;;;QAP3B;;WAEG;;;QAFH;;WAEG;;;QAFH;;WAEG;;;;;;QAFH;;WAEG;;;;;;QAFH;;WAEG;;;EAQL,CAAC;AAEH,eAAO,MAAM,YAAY;IAErB;;OAEG;;;IAFH;;OAEG;;;IAFH;;OAEG;;gCAGS,CAAC;AAEjB;;GAEG;AACH,eAAO,MAAM,eAAe,wCAA0C,CAAC;AAEvE;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;YA9CvB;;eAEG;;;YAFH;;eAEG;;;YAFH;;eAEG;;;;;YAFH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AC,OAAO,kBAAkB,CAAC,CAAC;AAG9D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/types.js b/front_end/third_party/mcp-sdk/zod/dist/types.js new file mode 100644 index 0000000000..deaf6cce2b --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/types.js @@ -0,0 +1,997 @@ +import { z } from "zod"; +export const LATEST_PROTOCOL_VERSION = "2024-11-05"; +export const SUPPORTED_PROTOCOL_VERSIONS = [ + LATEST_PROTOCOL_VERSION, + "2024-10-07", +]; +/* JSON-RPC types */ +export const JSONRPC_VERSION = "2.0"; +/** + * A progress token, used to associate progress notifications with the original request. + */ +export const ProgressTokenSchema = z.union([z.string(), z.number().int()]); +/** + * An opaque token used to represent a cursor for pagination. + */ +export const CursorSchema = z.string(); +const BaseRequestParamsSchema = z + .object({ + _meta: z.optional(z + .object({ + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. + */ + progressToken: z.optional(ProgressTokenSchema), + }) + .passthrough()), +}) + .passthrough(); +export const RequestSchema = z.object({ + method: z.string(), + params: z.optional(BaseRequestParamsSchema), +}); +const BaseNotificationParamsSchema = z + .object({ + /** + * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. + */ + _meta: z.optional(z.object({}).passthrough()), +}) + .passthrough(); +export const NotificationSchema = z.object({ + method: z.string(), + params: z.optional(BaseNotificationParamsSchema), +}); +export const ResultSchema = z + .object({ + /** + * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. + */ + _meta: z.optional(z.object({}).passthrough()), +}) + .passthrough(); +/** + * A uniquely identifying ID for a request in JSON-RPC. + */ +export const RequestIdSchema = z.union([z.string(), z.number().int()]); +/** + * A request that expects a response. + */ +export const JSONRPCRequestSchema = z + .object({ + jsonrpc: z.literal(JSONRPC_VERSION), + id: RequestIdSchema, +}) + .merge(RequestSchema) + .strict(); +/** + * A notification which does not expect a response. + */ +export const JSONRPCNotificationSchema = z + .object({ + jsonrpc: z.literal(JSONRPC_VERSION), +}) + .merge(NotificationSchema) + .strict(); +/** + * A successful (non-error) response to a request. + */ +export const JSONRPCResponseSchema = z + .object({ + jsonrpc: z.literal(JSONRPC_VERSION), + id: RequestIdSchema, + result: ResultSchema, +}) + .strict(); +/** + * An incomplete set of error codes that may appear in JSON-RPC responses. + */ +export var ErrorCode; +(function (ErrorCode) { + // SDK error codes + ErrorCode[ErrorCode["ConnectionClosed"] = -1] = "ConnectionClosed"; + ErrorCode[ErrorCode["RequestTimeout"] = -2] = "RequestTimeout"; + // Standard JSON-RPC error codes + ErrorCode[ErrorCode["ParseError"] = -32700] = "ParseError"; + ErrorCode[ErrorCode["InvalidRequest"] = -32600] = "InvalidRequest"; + ErrorCode[ErrorCode["MethodNotFound"] = -32601] = "MethodNotFound"; + ErrorCode[ErrorCode["InvalidParams"] = -32602] = "InvalidParams"; + ErrorCode[ErrorCode["InternalError"] = -32603] = "InternalError"; +})(ErrorCode || (ErrorCode = {})); +/** + * A response to a request that indicates an error occurred. + */ +export const JSONRPCErrorSchema = z + .object({ + jsonrpc: z.literal(JSONRPC_VERSION), + id: RequestIdSchema, + error: z.object({ + /** + * The error type that occurred. + */ + code: z.number().int(), + /** + * A short description of the error. The message SHOULD be limited to a concise single sentence. + */ + message: z.string(), + /** + * Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.). + */ + data: z.optional(z.unknown()), + }), +}) + .strict(); +export const JSONRPCMessageSchema = z.union([ + JSONRPCRequestSchema, + JSONRPCNotificationSchema, + JSONRPCResponseSchema, + JSONRPCErrorSchema, +]); +/* Empty result */ +/** + * A response that indicates success but carries no data. + */ +export const EmptyResultSchema = ResultSchema.strict(); +/* Cancellation */ +/** + * This notification can be sent by either side to indicate that it is cancelling a previously-issued request. + * + * The request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished. + * + * This notification indicates that the result will be unused, so any associated processing SHOULD cease. + * + * A client MUST NOT attempt to cancel its `initialize` request. + */ +export const CancelledNotificationSchema = NotificationSchema.extend({ + method: z.literal("notifications/cancelled"), + params: BaseNotificationParamsSchema.extend({ + /** + * The ID of the request to cancel. + * + * This MUST correspond to the ID of a request previously issued in the same direction. + */ + requestId: RequestIdSchema, + /** + * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. + */ + reason: z.string().optional(), + }), +}); +/* Initialization */ +/** + * Describes the name and version of an MCP implementation. + */ +export const ImplementationSchema = z + .object({ + name: z.string(), + version: z.string(), +}) + .passthrough(); +/** + * Capabilities a client may support. Known capabilities are defined here, in this schema, but this is not a closed set: any client can define its own, additional capabilities. + */ +export const ClientCapabilitiesSchema = z + .object({ + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental: z.optional(z.object({}).passthrough()), + /** + * Present if the client supports sampling from an LLM. + */ + sampling: z.optional(z.object({}).passthrough()), + /** + * Present if the client supports listing roots. + */ + roots: z.optional(z + .object({ + /** + * Whether the client supports issuing notifications for changes to the roots list. + */ + listChanged: z.optional(z.boolean()), + }) + .passthrough()), +}) + .passthrough(); +/** + * This request is sent from the client to the server when it first connects, asking it to begin initialization. + */ +export const InitializeRequestSchema = RequestSchema.extend({ + method: z.literal("initialize"), + params: BaseRequestParamsSchema.extend({ + /** + * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well. + */ + protocolVersion: z.string(), + capabilities: ClientCapabilitiesSchema, + clientInfo: ImplementationSchema, + }), +}); +/** + * Capabilities that a server may support. Known capabilities are defined here, in this schema, but this is not a closed set: any server can define its own, additional capabilities. + */ +export const ServerCapabilitiesSchema = z + .object({ + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental: z.optional(z.object({}).passthrough()), + /** + * Present if the server supports sending log messages to the client. + */ + logging: z.optional(z.object({}).passthrough()), + /** + * Present if the server offers any prompt templates. + */ + prompts: z.optional(z + .object({ + /** + * Whether this server supports issuing notifications for changes to the prompt list. + */ + listChanged: z.optional(z.boolean()), + }) + .passthrough()), + /** + * Present if the server offers any resources to read. + */ + resources: z.optional(z + .object({ + /** + * Whether this server supports clients subscribing to resource updates. + */ + subscribe: z.optional(z.boolean()), + /** + * Whether this server supports issuing notifications for changes to the resource list. + */ + listChanged: z.optional(z.boolean()), + }) + .passthrough()), + /** + * Present if the server offers any tools to call. + */ + tools: z.optional(z + .object({ + /** + * Whether this server supports issuing notifications for changes to the tool list. + */ + listChanged: z.optional(z.boolean()), + }) + .passthrough()), +}) + .passthrough(); +/** + * After receiving an initialize request from the client, the server sends this response. + */ +export const InitializeResultSchema = ResultSchema.extend({ + /** + * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect. + */ + protocolVersion: z.string(), + capabilities: ServerCapabilitiesSchema, + serverInfo: ImplementationSchema, +}); +/** + * This notification is sent from the client to the server after initialization has finished. + */ +export const InitializedNotificationSchema = NotificationSchema.extend({ + method: z.literal("notifications/initialized"), +}); +/* Ping */ +/** + * A ping, issued by either the server or the client, to check that the other party is still alive. The receiver must promptly respond, or else may be disconnected. + */ +export const PingRequestSchema = RequestSchema.extend({ + method: z.literal("ping"), +}); +/* Progress notifications */ +export const ProgressSchema = z + .object({ + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + */ + progress: z.number(), + /** + * Total number of items to process (or total progress required), if known. + */ + total: z.optional(z.number()), +}) + .passthrough(); +/** + * An out-of-band notification used to inform the receiver of a progress update for a long-running request. + */ +export const ProgressNotificationSchema = NotificationSchema.extend({ + method: z.literal("notifications/progress"), + params: BaseNotificationParamsSchema.merge(ProgressSchema).extend({ + /** + * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. + */ + progressToken: ProgressTokenSchema, + }), +}); +/* Pagination */ +export const PaginatedRequestSchema = RequestSchema.extend({ + params: BaseRequestParamsSchema.extend({ + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor: z.optional(CursorSchema), + }).optional(), +}); +export const PaginatedResultSchema = ResultSchema.extend({ + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor: z.optional(CursorSchema), +}); +/* Resources */ +/** + * The contents of a specific resource or sub-resource. + */ +export const ResourceContentsSchema = z + .object({ + /** + * The URI of this resource. + */ + uri: z.string(), + /** + * The MIME type of this resource, if known. + */ + mimeType: z.optional(z.string()), +}) + .passthrough(); +export const TextResourceContentsSchema = ResourceContentsSchema.extend({ + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: z.string(), +}); +export const BlobResourceContentsSchema = ResourceContentsSchema.extend({ + /** + * A base64-encoded string representing the binary data of the item. + */ + blob: z.string().base64(), +}); +/** + * A known resource that the server is capable of reading. + */ +export const ResourceSchema = z + .object({ + /** + * The URI of this resource. + */ + uri: z.string(), + /** + * A human-readable name for this resource. + * + * This can be used by clients to populate UI elements. + */ + name: z.string(), + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.optional(z.string()), + /** + * The MIME type of this resource, if known. + */ + mimeType: z.optional(z.string()), +}) + .passthrough(); +/** + * A template description for resources available on the server. + */ +export const ResourceTemplateSchema = z + .object({ + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + */ + uriTemplate: z.string(), + /** + * A human-readable name for the type of resource this template refers to. + * + * This can be used by clients to populate UI elements. + */ + name: z.string(), + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description: z.optional(z.string()), + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType: z.optional(z.string()), +}) + .passthrough(); +/** + * Sent from the client to request a list of resources the server has. + */ +export const ListResourcesRequestSchema = PaginatedRequestSchema.extend({ + method: z.literal("resources/list"), +}); +/** + * The server's response to a resources/list request from the client. + */ +export const ListResourcesResultSchema = PaginatedResultSchema.extend({ + resources: z.array(ResourceSchema), +}); +/** + * Sent from the client to request a list of resource templates the server has. + */ +export const ListResourceTemplatesRequestSchema = PaginatedRequestSchema.extend({ + method: z.literal("resources/templates/list"), +}); +/** + * The server's response to a resources/templates/list request from the client. + */ +export const ListResourceTemplatesResultSchema = PaginatedResultSchema.extend({ + resourceTemplates: z.array(ResourceTemplateSchema), +}); +/** + * Sent from the client to the server, to read a specific resource URI. + */ +export const ReadResourceRequestSchema = RequestSchema.extend({ + method: z.literal("resources/read"), + params: BaseRequestParamsSchema.extend({ + /** + * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.string(), + }), +}); +/** + * The server's response to a resources/read request from the client. + */ +export const ReadResourceResultSchema = ResultSchema.extend({ + contents: z.array(z.union([TextResourceContentsSchema, BlobResourceContentsSchema])), +}); +/** + * An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This may be issued by servers without any previous subscription from the client. + */ +export const ResourceListChangedNotificationSchema = NotificationSchema.extend({ + method: z.literal("notifications/resources/list_changed"), +}); +/** + * Sent from the client to request resources/updated notifications from the server whenever a particular resource changes. + */ +export const SubscribeRequestSchema = RequestSchema.extend({ + method: z.literal("resources/subscribe"), + params: BaseRequestParamsSchema.extend({ + /** + * The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it. + */ + uri: z.string(), + }), +}); +/** + * Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request. + */ +export const UnsubscribeRequestSchema = RequestSchema.extend({ + method: z.literal("resources/unsubscribe"), + params: BaseRequestParamsSchema.extend({ + /** + * The URI of the resource to unsubscribe from. + */ + uri: z.string(), + }), +}); +/** + * A notification from the server to the client, informing it that a resource has changed and may need to be read again. This should only be sent if the client previously sent a resources/subscribe request. + */ +export const ResourceUpdatedNotificationSchema = NotificationSchema.extend({ + method: z.literal("notifications/resources/updated"), + params: BaseNotificationParamsSchema.extend({ + /** + * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to. + */ + uri: z.string(), + }), +}); +/* Prompts */ +/** + * Describes an argument that a prompt can accept. + */ +export const PromptArgumentSchema = z + .object({ + /** + * The name of the argument. + */ + name: z.string(), + /** + * A human-readable description of the argument. + */ + description: z.optional(z.string()), + /** + * Whether this argument must be provided. + */ + required: z.optional(z.boolean()), +}) + .passthrough(); +/** + * A prompt or prompt template that the server offers. + */ +export const PromptSchema = z + .object({ + /** + * The name of the prompt or prompt template. + */ + name: z.string(), + /** + * An optional description of what this prompt provides + */ + description: z.optional(z.string()), + /** + * A list of arguments to use for templating the prompt. + */ + arguments: z.optional(z.array(PromptArgumentSchema)), +}) + .passthrough(); +/** + * Sent from the client to request a list of prompts and prompt templates the server has. + */ +export const ListPromptsRequestSchema = PaginatedRequestSchema.extend({ + method: z.literal("prompts/list"), +}); +/** + * The server's response to a prompts/list request from the client. + */ +export const ListPromptsResultSchema = PaginatedResultSchema.extend({ + prompts: z.array(PromptSchema), +}); +/** + * Used by the client to get a prompt provided by the server. + */ +export const GetPromptRequestSchema = RequestSchema.extend({ + method: z.literal("prompts/get"), + params: BaseRequestParamsSchema.extend({ + /** + * The name of the prompt or prompt template. + */ + name: z.string(), + /** + * Arguments to use for templating the prompt. + */ + arguments: z.optional(z.record(z.string())), + }), +}); +/** + * Text provided to or from an LLM. + */ +export const TextContentSchema = z + .object({ + type: z.literal("text"), + /** + * The text content of the message. + */ + text: z.string(), +}) + .passthrough(); +/** + * An image provided to or from an LLM. + */ +export const ImageContentSchema = z + .object({ + type: z.literal("image"), + /** + * The base64-encoded image data. + */ + data: z.string().base64(), + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: z.string(), +}) + .passthrough(); +/** + * The contents of a resource, embedded into a prompt or tool call result. + */ +export const EmbeddedResourceSchema = z + .object({ + type: z.literal("resource"), + resource: z.union([TextResourceContentsSchema, BlobResourceContentsSchema]), +}) + .passthrough(); +/** + * Describes a message returned as part of a prompt. + */ +export const PromptMessageSchema = z + .object({ + role: z.enum(["user", "assistant"]), + content: z.union([ + TextContentSchema, + ImageContentSchema, + EmbeddedResourceSchema, + ]), +}) + .passthrough(); +/** + * The server's response to a prompts/get request from the client. + */ +export const GetPromptResultSchema = ResultSchema.extend({ + /** + * An optional description for the prompt. + */ + description: z.optional(z.string()), + messages: z.array(PromptMessageSchema), +}); +/** + * An optional notification from the server to the client, informing it that the list of prompts it offers has changed. This may be issued by servers without any previous subscription from the client. + */ +export const PromptListChangedNotificationSchema = NotificationSchema.extend({ + method: z.literal("notifications/prompts/list_changed"), +}); +/* Tools */ +/** + * Definition for a tool the client can call. + */ +export const ToolSchema = z + .object({ + /** + * The name of the tool. + */ + name: z.string(), + /** + * A human-readable description of the tool. + */ + description: z.optional(z.string()), + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: z + .object({ + type: z.literal("object"), + properties: z.optional(z.object({}).passthrough()), + }) + .passthrough(), +}) + .passthrough(); +/** + * Sent from the client to request a list of tools the server has. + */ +export const ListToolsRequestSchema = PaginatedRequestSchema.extend({ + method: z.literal("tools/list"), +}); +/** + * The server's response to a tools/list request from the client. + */ +export const ListToolsResultSchema = PaginatedResultSchema.extend({ + tools: z.array(ToolSchema), +}); +/** + * The server's response to a tool call. + */ +export const CallToolResultSchema = ResultSchema.extend({ + content: z.array(z.union([TextContentSchema, ImageContentSchema, EmbeddedResourceSchema])), + isError: z.boolean().default(false).optional(), +}); +/** + * CallToolResultSchema extended with backwards compatibility to protocol version 2024-10-07. + */ +export const CompatibilityCallToolResultSchema = CallToolResultSchema.or(ResultSchema.extend({ + toolResult: z.unknown(), +})); +/** + * Used by the client to invoke a tool provided by the server. + */ +export const CallToolRequestSchema = RequestSchema.extend({ + method: z.literal("tools/call"), + params: BaseRequestParamsSchema.extend({ + name: z.string(), + arguments: z.optional(z.record(z.unknown())), + }), +}); +/** + * An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client. + */ +export const ToolListChangedNotificationSchema = NotificationSchema.extend({ + method: z.literal("notifications/tools/list_changed"), +}); +/* Logging */ +/** + * The severity of a log message. + */ +export const LoggingLevelSchema = z.enum([ + "debug", + "info", + "notice", + "warning", + "error", + "critical", + "alert", + "emergency", +]); +/** + * A request from the client to the server, to enable or adjust logging. + */ +export const SetLevelRequestSchema = RequestSchema.extend({ + method: z.literal("logging/setLevel"), + params: BaseRequestParamsSchema.extend({ + /** + * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message. + */ + level: LoggingLevelSchema, + }), +}); +/** + * Notification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically. + */ +export const LoggingMessageNotificationSchema = NotificationSchema.extend({ + method: z.literal("notifications/message"), + params: BaseNotificationParamsSchema.extend({ + /** + * The severity of this log message. + */ + level: LoggingLevelSchema, + /** + * An optional name of the logger issuing this message. + */ + logger: z.optional(z.string()), + /** + * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here. + */ + data: z.unknown(), + }), +}); +/* Sampling */ +/** + * Hints to use for model selection. + */ +export const ModelHintSchema = z + .object({ + /** + * A hint for a model name. + */ + name: z.string().optional(), +}) + .passthrough(); +/** + * The server's preferences for model selection, requested of the client during sampling. + */ +export const ModelPreferencesSchema = z + .object({ + /** + * Optional hints to use for model selection. + */ + hints: z.optional(z.array(ModelHintSchema)), + /** + * How much to prioritize cost when selecting a model. + */ + costPriority: z.optional(z.number().min(0).max(1)), + /** + * How much to prioritize sampling speed (latency) when selecting a model. + */ + speedPriority: z.optional(z.number().min(0).max(1)), + /** + * How much to prioritize intelligence and capabilities when selecting a model. + */ + intelligencePriority: z.optional(z.number().min(0).max(1)), +}) + .passthrough(); +/** + * Describes a message issued to or received from an LLM API. + */ +export const SamplingMessageSchema = z + .object({ + role: z.enum(["user", "assistant"]), + content: z.union([TextContentSchema, ImageContentSchema]), +}) + .passthrough(); +/** + * A request from the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it. + */ +export const CreateMessageRequestSchema = RequestSchema.extend({ + method: z.literal("sampling/createMessage"), + params: BaseRequestParamsSchema.extend({ + messages: z.array(SamplingMessageSchema), + /** + * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt. + */ + systemPrompt: z.optional(z.string()), + /** + * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request. + */ + includeContext: z.optional(z.enum(["none", "thisServer", "allServers"])), + temperature: z.optional(z.number()), + /** + * The maximum number of tokens to sample, as requested by the server. The client MAY choose to sample fewer tokens than requested. + */ + maxTokens: z.number().int(), + stopSequences: z.optional(z.array(z.string())), + /** + * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific. + */ + metadata: z.optional(z.object({}).passthrough()), + /** + * The server's preferences for which model to select. + */ + modelPreferences: z.optional(ModelPreferencesSchema), + }), +}); +/** + * The client's response to a sampling/create_message request from the server. The client should inform the user before returning the sampled message, to allow them to inspect the response (human in the loop) and decide whether to allow the server to see it. + */ +export const CreateMessageResultSchema = ResultSchema.extend({ + /** + * The name of the model that generated the message. + */ + model: z.string(), + /** + * The reason why sampling stopped. + */ + stopReason: z.optional(z.enum(["endTurn", "stopSequence", "maxTokens"]).or(z.string())), + role: z.enum(["user", "assistant"]), + content: z.discriminatedUnion("type", [ + TextContentSchema, + ImageContentSchema, + ]), +}); +/* Autocomplete */ +/** + * A reference to a resource or resource template definition. + */ +export const ResourceReferenceSchema = z + .object({ + type: z.literal("ref/resource"), + /** + * The URI or URI template of the resource. + */ + uri: z.string(), +}) + .passthrough(); +/** + * Identifies a prompt. + */ +export const PromptReferenceSchema = z + .object({ + type: z.literal("ref/prompt"), + /** + * The name of the prompt or prompt template + */ + name: z.string(), +}) + .passthrough(); +/** + * A request from the client to the server, to ask for completion options. + */ +export const CompleteRequestSchema = RequestSchema.extend({ + method: z.literal("completion/complete"), + params: BaseRequestParamsSchema.extend({ + ref: z.union([PromptReferenceSchema, ResourceReferenceSchema]), + /** + * The argument's information + */ + argument: z + .object({ + /** + * The name of the argument + */ + name: z.string(), + /** + * The value of the argument to use for completion matching. + */ + value: z.string(), + }) + .passthrough(), + }), +}); +/** + * The server's response to a completion/complete request + */ +export const CompleteResultSchema = ResultSchema.extend({ + completion: z + .object({ + /** + * An array of completion values. Must not exceed 100 items. + */ + values: z.array(z.string()).max(100), + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total: z.optional(z.number().int()), + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore: z.optional(z.boolean()), + }) + .passthrough(), +}); +/* Roots */ +/** + * Represents a root directory or file that the server can operate on. + */ +export const RootSchema = z + .object({ + /** + * The URI identifying the root. This *must* start with file:// for now. + */ + uri: z.string().startsWith("file://"), + /** + * An optional name for the root. + */ + name: z.optional(z.string()), +}) + .passthrough(); +/** + * Sent from the server to request a list of root URIs from the client. + */ +export const ListRootsRequestSchema = RequestSchema.extend({ + method: z.literal("roots/list"), +}); +/** + * The client's response to a roots/list request from the server. + */ +export const ListRootsResultSchema = ResultSchema.extend({ + roots: z.array(RootSchema), +}); +/** + * A notification from the client to the server, informing it that the list of roots has changed. + */ +export const RootsListChangedNotificationSchema = NotificationSchema.extend({ + method: z.literal("notifications/roots/list_changed"), +}); +/* Client messages */ +export const ClientRequestSchema = z.union([ + PingRequestSchema, + InitializeRequestSchema, + CompleteRequestSchema, + SetLevelRequestSchema, + GetPromptRequestSchema, + ListPromptsRequestSchema, + ListResourcesRequestSchema, + ListResourceTemplatesRequestSchema, + ReadResourceRequestSchema, + SubscribeRequestSchema, + UnsubscribeRequestSchema, + CallToolRequestSchema, + ListToolsRequestSchema, +]); +export const ClientNotificationSchema = z.union([ + CancelledNotificationSchema, + ProgressNotificationSchema, + InitializedNotificationSchema, + RootsListChangedNotificationSchema, +]); +export const ClientResultSchema = z.union([ + EmptyResultSchema, + CreateMessageResultSchema, + ListRootsResultSchema, +]); +/* Server messages */ +export const ServerRequestSchema = z.union([ + PingRequestSchema, + CreateMessageRequestSchema, + ListRootsRequestSchema, +]); +export const ServerNotificationSchema = z.union([ + CancelledNotificationSchema, + ProgressNotificationSchema, + LoggingMessageNotificationSchema, + ResourceUpdatedNotificationSchema, + ResourceListChangedNotificationSchema, + ToolListChangedNotificationSchema, + PromptListChangedNotificationSchema, +]); +export const ServerResultSchema = z.union([ + EmptyResultSchema, + InitializeResultSchema, + CompleteResultSchema, + GetPromptResultSchema, + ListPromptsResultSchema, + ListResourcesResultSchema, + ListResourceTemplatesResultSchema, + ReadResourceResultSchema, + CallToolResultSchema, + ListToolsResultSchema, +]); +export class McpError extends Error { + constructor(code, message, data) { + super(`MCP error ${code}: ${message}`); + this.code = code; + this.data = data; + } +} +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/dist/types.js.map b/front_end/third_party/mcp-sdk/zod/dist/types.js.map new file mode 100644 index 0000000000..913f55303e --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/dist/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,uBAAuB,GAAG,YAAY,CAAC;AACpD,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,uBAAuB;IACvB,YAAY;CACb,CAAC;AAEF,oBAAoB;AACpB,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC;AAErC;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,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CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC;IAC9C,2BAA2B;IAC3B,0BAA0B;IAC1B,gCAAgC;IAChC,iCAAiC;IACjC,qCAAqC;IACrC,iCAAiC;IACjC,mCAAmC;CACpC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC;IACxC,iBAAiB;IACjB,sBAAsB;IACtB,oBAAoB;IACpB,qBAAqB;IACrB,uBAAuB;IACvB,yBAAyB;IACzB,iCAAiC;IACjC,wBAAwB;IACxB,oBAAoB;IACpB,qBAAqB;CACtB,CAAC,CAAC;AAEH,MAAM,OAAO,QAAS,SAAQ,KAAK;IACjC,YACkB,IAAY,EAC5B,OAAe,EACC,IAAc;QAE9B,KAAK,CAAC,aAAa,IAAI,KAAK,OAAO,EAAE,CAAC,CAAC;QAJvB,SAAI,GAAJ,IAAI,CAAQ;QAEZ,SAAI,GAAJ,IAAI,CAAU;IAGhC,CAAC;CACF"} \ No newline at end of file diff --git a/front_end/third_party/mcp-sdk/zod/index.d.ts b/front_end/third_party/mcp-sdk/zod/index.d.ts new file mode 100644 index 0000000000..97b0b2272c --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/index.d.ts @@ -0,0 +1,2 @@ +export * from "./lib"; +export as namespace Zod; diff --git a/front_end/third_party/mcp-sdk/zod/lib/ZodError.d.ts b/front_end/third_party/mcp-sdk/zod/lib/ZodError.d.ts new file mode 100644 index 0000000000..7fe2934dde --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/ZodError.d.ts @@ -0,0 +1,164 @@ +import type { TypeOf, ZodType } from "."; +import { Primitive } from "./helpers/typeAliases"; +import { util, ZodParsedType } from "./helpers/util"; +declare type allKeys = T extends any ? keyof T : never; +export declare type inferFlattenedErrors, U = string> = typeToFlattenedError, U>; +export declare type typeToFlattenedError = { + formErrors: U[]; + fieldErrors: { + [P in allKeys]?: U[]; + }; +}; +export declare const ZodIssueCode: { + invalid_type: "invalid_type"; + invalid_literal: "invalid_literal"; + custom: "custom"; + invalid_union: "invalid_union"; + invalid_union_discriminator: "invalid_union_discriminator"; + invalid_enum_value: "invalid_enum_value"; + unrecognized_keys: "unrecognized_keys"; + invalid_arguments: "invalid_arguments"; + invalid_return_type: "invalid_return_type"; + invalid_date: "invalid_date"; + invalid_string: "invalid_string"; + too_small: "too_small"; + too_big: "too_big"; + invalid_intersection_types: "invalid_intersection_types"; + not_multiple_of: "not_multiple_of"; + not_finite: "not_finite"; +}; +export declare type ZodIssueCode = keyof typeof ZodIssueCode; +export declare type ZodIssueBase = { + path: (string | number)[]; + message?: string; +}; +export interface ZodInvalidTypeIssue extends ZodIssueBase { + code: typeof ZodIssueCode.invalid_type; + expected: ZodParsedType; + received: ZodParsedType; +} +export interface ZodInvalidLiteralIssue extends ZodIssueBase { + code: typeof ZodIssueCode.invalid_literal; + expected: unknown; + received: unknown; +} +export interface ZodUnrecognizedKeysIssue extends ZodIssueBase { + code: typeof ZodIssueCode.unrecognized_keys; + keys: string[]; +} +export interface ZodInvalidUnionIssue extends ZodIssueBase { + code: typeof ZodIssueCode.invalid_union; + unionErrors: ZodError[]; +} +export interface ZodInvalidUnionDiscriminatorIssue extends ZodIssueBase { + code: typeof ZodIssueCode.invalid_union_discriminator; + options: Primitive[]; +} +export interface ZodInvalidEnumValueIssue extends ZodIssueBase { + received: string | number; + code: typeof ZodIssueCode.invalid_enum_value; + options: (string | number)[]; +} +export interface ZodInvalidArgumentsIssue extends ZodIssueBase { + code: typeof ZodIssueCode.invalid_arguments; + argumentsError: ZodError; +} +export interface ZodInvalidReturnTypeIssue extends ZodIssueBase { + code: typeof ZodIssueCode.invalid_return_type; + returnTypeError: ZodError; +} +export interface ZodInvalidDateIssue extends ZodIssueBase { + code: typeof ZodIssueCode.invalid_date; +} +export declare type StringValidation = "email" | "url" | "emoji" | "uuid" | "nanoid" | "regex" | "cuid" | "cuid2" | "ulid" | "datetime" | "date" | "time" | "duration" | "ip" | "base64" | { + includes: string; + position?: number; +} | { + startsWith: string; +} | { + endsWith: string; +}; +export interface ZodInvalidStringIssue extends ZodIssueBase { + code: typeof ZodIssueCode.invalid_string; + validation: StringValidation; +} +export interface ZodTooSmallIssue extends ZodIssueBase { + code: typeof ZodIssueCode.too_small; + minimum: number | bigint; + inclusive: boolean; + exact?: boolean; + type: "array" | "string" | "number" | "set" | "date" | "bigint"; +} +export interface ZodTooBigIssue extends ZodIssueBase { + code: typeof ZodIssueCode.too_big; + maximum: number | bigint; + inclusive: boolean; + exact?: boolean; + type: "array" | "string" | "number" | "set" | "date" | "bigint"; +} +export interface ZodInvalidIntersectionTypesIssue extends ZodIssueBase { + code: typeof ZodIssueCode.invalid_intersection_types; +} +export interface ZodNotMultipleOfIssue extends ZodIssueBase { + code: typeof ZodIssueCode.not_multiple_of; + multipleOf: number | bigint; +} +export interface ZodNotFiniteIssue extends ZodIssueBase { + code: typeof ZodIssueCode.not_finite; +} +export interface ZodCustomIssue extends ZodIssueBase { + code: typeof ZodIssueCode.custom; + params?: { + [k: string]: any; + }; +} +export declare type DenormalizedError = { + [k: string]: DenormalizedError | string[]; +}; +export declare type ZodIssueOptionalMessage = ZodInvalidTypeIssue | ZodInvalidLiteralIssue | ZodUnrecognizedKeysIssue | ZodInvalidUnionIssue | ZodInvalidUnionDiscriminatorIssue | ZodInvalidEnumValueIssue | ZodInvalidArgumentsIssue | ZodInvalidReturnTypeIssue | ZodInvalidDateIssue | ZodInvalidStringIssue | ZodTooSmallIssue | ZodTooBigIssue | ZodInvalidIntersectionTypesIssue | ZodNotMultipleOfIssue | ZodNotFiniteIssue | ZodCustomIssue; +export declare type ZodIssue = ZodIssueOptionalMessage & { + fatal?: boolean; + message: string; +}; +export declare const quotelessJson: (obj: any) => string; +declare type recursiveZodFormattedError = T extends [any, ...any[]] ? { + [K in keyof T]?: ZodFormattedError; +} : T extends any[] ? { + [k: number]: ZodFormattedError; +} : T extends object ? { + [K in keyof T]?: ZodFormattedError; +} : unknown; +export declare type ZodFormattedError = { + _errors: U[]; +} & recursiveZodFormattedError>; +export declare type inferFormattedError, U = string> = ZodFormattedError, U>; +export declare class ZodError extends Error { + issues: ZodIssue[]; + get errors(): ZodIssue[]; + constructor(issues: ZodIssue[]); + format(): ZodFormattedError; + format(mapper: (issue: ZodIssue) => U): ZodFormattedError; + static create: (issues: ZodIssue[]) => ZodError; + static assert(value: unknown): asserts value is ZodError; + toString(): string; + get message(): string; + get isEmpty(): boolean; + addIssue: (sub: ZodIssue) => void; + addIssues: (subs?: ZodIssue[]) => void; + flatten(): typeToFlattenedError; + flatten(mapper?: (issue: ZodIssue) => U): typeToFlattenedError; + get formErrors(): typeToFlattenedError; +} +declare type stripPath = T extends any ? util.OmitKeys : never; +export declare type IssueData = stripPath & { + path?: (string | number)[]; + fatal?: boolean; +}; +export declare type ErrorMapCtx = { + defaultError: string; + data: any; +}; +export declare type ZodErrorMap = (issue: ZodIssueOptionalMessage, _ctx: ErrorMapCtx) => { + message: string; +}; +export {}; diff --git a/front_end/third_party/mcp-sdk/zod/lib/ZodError.js b/front_end/third_party/mcp-sdk/zod/lib/ZodError.js new file mode 100644 index 0000000000..0b5c6d781d --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/ZodError.js @@ -0,0 +1,137 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ZodError = exports.quotelessJson = exports.ZodIssueCode = void 0; +const util_1 = require("./helpers/util"); +exports.ZodIssueCode = util_1.util.arrayToEnum([ + "invalid_type", + "invalid_literal", + "custom", + "invalid_union", + "invalid_union_discriminator", + "invalid_enum_value", + "unrecognized_keys", + "invalid_arguments", + "invalid_return_type", + "invalid_date", + "invalid_string", + "too_small", + "too_big", + "invalid_intersection_types", + "not_multiple_of", + "not_finite", +]); +const quotelessJson = (obj) => { + const json = JSON.stringify(obj, null, 2); + return json.replace(/"([^"]+)":/g, "$1:"); +}; +exports.quotelessJson = quotelessJson; +class ZodError extends Error { + constructor(issues) { + super(); + this.issues = []; + this.addIssue = (sub) => { + this.issues = [...this.issues, sub]; + }; + this.addIssues = (subs = []) => { + this.issues = [...this.issues, ...subs]; + }; + const actualProto = new.target.prototype; + if (Object.setPrototypeOf) { + // eslint-disable-next-line ban/ban + Object.setPrototypeOf(this, actualProto); + } + else { + this.__proto__ = actualProto; + } + this.name = "ZodError"; + this.issues = issues; + } + get errors() { + return this.issues; + } + format(_mapper) { + const mapper = _mapper || + function (issue) { + return issue.message; + }; + const fieldErrors = { _errors: [] }; + const processError = (error) => { + for (const issue of error.issues) { + if (issue.code === "invalid_union") { + issue.unionErrors.map(processError); + } + else if (issue.code === "invalid_return_type") { + processError(issue.returnTypeError); + } + else if (issue.code === "invalid_arguments") { + processError(issue.argumentsError); + } + else if (issue.path.length === 0) { + fieldErrors._errors.push(mapper(issue)); + } + else { + let curr = fieldErrors; + let i = 0; + while (i < issue.path.length) { + const el = issue.path[i]; + const terminal = i === issue.path.length - 1; + if (!terminal) { + curr[el] = curr[el] || { _errors: [] }; + // if (typeof el === "string") { + // curr[el] = curr[el] || { _errors: [] }; + // } else if (typeof el === "number") { + // const errorArray: any = []; + // errorArray._errors = []; + // curr[el] = curr[el] || errorArray; + // } + } + else { + curr[el] = curr[el] || { _errors: [] }; + curr[el]._errors.push(mapper(issue)); + } + curr = curr[el]; + i++; + } + } + } + }; + processError(this); + return fieldErrors; + } + static assert(value) { + if (!(value instanceof ZodError)) { + throw new Error(`Not a ZodError: ${value}`); + } + } + toString() { + return this.message; + } + get message() { + return JSON.stringify(this.issues, util_1.util.jsonStringifyReplacer, 2); + } + get isEmpty() { + return this.issues.length === 0; + } + flatten(mapper = (issue) => issue.message) { + const fieldErrors = {}; + const formErrors = []; + for (const sub of this.issues) { + if (sub.path.length > 0) { + fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || []; + fieldErrors[sub.path[0]].push(mapper(sub)); + } + else { + formErrors.push(mapper(sub)); + } + } + return { formErrors, fieldErrors }; + } + get formErrors() { + return this.flatten(); + } +} +exports.ZodError = ZodError; +ZodError.create = (issues) => { + const error = new ZodError(issues); + return error; +}; diff --git a/front_end/third_party/mcp-sdk/zod/lib/__tests__/Mocker.d.ts b/front_end/third_party/mcp-sdk/zod/lib/__tests__/Mocker.d.ts new file mode 100644 index 0000000000..2f605b6cd8 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/__tests__/Mocker.d.ts @@ -0,0 +1,17 @@ +export declare class Mocker { + pick: (...args: any[]) => any; + get string(): string; + get number(): number; + get bigint(): bigint; + get boolean(): boolean; + get date(): Date; + get symbol(): symbol; + get null(): null; + get undefined(): undefined; + get stringOptional(): any; + get stringNullable(): any; + get numberOptional(): any; + get numberNullable(): any; + get booleanOptional(): any; + get booleanNullable(): any; +} diff --git a/front_end/third_party/mcp-sdk/zod/lib/__tests__/Mocker.js b/front_end/third_party/mcp-sdk/zod/lib/__tests__/Mocker.js new file mode 100644 index 0000000000..6a566474eb --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/__tests__/Mocker.js @@ -0,0 +1,57 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Mocker = void 0; +function getRandomInt(max) { + return Math.floor(Math.random() * Math.floor(max)); +} +const testSymbol = Symbol("test"); +class Mocker { + constructor() { + this.pick = (...args) => { + return args[getRandomInt(args.length)]; + }; + } + get string() { + return Math.random().toString(36).substring(7); + } + get number() { + return Math.random() * 100; + } + get bigint() { + return BigInt(Math.floor(Math.random() * 10000)); + } + get boolean() { + return Math.random() < 0.5; + } + get date() { + return new Date(Math.floor(Date.now() * Math.random())); + } + get symbol() { + return testSymbol; + } + get null() { + return null; + } + get undefined() { + return undefined; + } + get stringOptional() { + return this.pick(this.string, this.undefined); + } + get stringNullable() { + return this.pick(this.string, this.null); + } + get numberOptional() { + return this.pick(this.number, this.undefined); + } + get numberNullable() { + return this.pick(this.number, this.null); + } + get booleanOptional() { + return this.pick(this.boolean, this.undefined); + } + get booleanNullable() { + return this.pick(this.boolean, this.null); + } +} +exports.Mocker = Mocker; diff --git a/front_end/third_party/mcp-sdk/zod/lib/benchmarks/datetime.d.ts b/front_end/third_party/mcp-sdk/zod/lib/benchmarks/datetime.d.ts new file mode 100644 index 0000000000..9d2c302029 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/benchmarks/datetime.d.ts @@ -0,0 +1,5 @@ +import Benchmark from "benchmark"; +declare const _default: { + suites: Benchmark.Suite[]; +}; +export default _default; diff --git a/front_end/third_party/mcp-sdk/zod/lib/benchmarks/datetime.js b/front_end/third_party/mcp-sdk/zod/lib/benchmarks/datetime.js new file mode 100644 index 0000000000..29a227b12e --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/benchmarks/datetime.js @@ -0,0 +1,54 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const benchmark_1 = __importDefault(require("benchmark")); +const datetimeValidationSuite = new benchmark_1.default.Suite("datetime"); +const DATA = "2021-01-01"; +const MONTHS_31 = new Set([1, 3, 5, 7, 8, 10, 12]); +const MONTHS_30 = new Set([4, 6, 9, 11]); +const simpleDatetimeRegex = /^(\d{4})-(\d{2})-(\d{2})$/; +const datetimeRegexNoLeapYearValidation = /^\d{4}-((0[13578]|10|12)-31|(0[13-9]|1[0-2])-30|(0[1-9]|1[0-2])-(0[1-9]|1\d|2\d))$/; +const datetimeRegexWithLeapYearValidation = /^((\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\d|3[01])|(0[469]|11)-(0[1-9]|[12]\d|30)|(02)-(0[1-9]|1\d|2[0-8])))$/; +datetimeValidationSuite + .add("new Date()", () => { + return !isNaN(new Date(DATA).getTime()); +}) + .add("regex (no validation)", () => { + return simpleDatetimeRegex.test(DATA); +}) + .add("regex (no leap year)", () => { + return datetimeRegexNoLeapYearValidation.test(DATA); +}) + .add("regex (w/ leap year)", () => { + return datetimeRegexWithLeapYearValidation.test(DATA); +}) + .add("capture groups + code", () => { + const match = DATA.match(simpleDatetimeRegex); + if (!match) + return false; + // Extract year, month, and day from the capture groups + const year = Number.parseInt(match[1], 10); + const month = Number.parseInt(match[2], 10); // month is 0-indexed in JavaScript Date, so subtract 1 + const day = Number.parseInt(match[3], 10); + if (month === 2) { + if ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0) { + return day <= 29; + } + return day <= 28; + } + if (MONTHS_30.has(month)) { + return day <= 30; + } + if (MONTHS_31.has(month)) { + return day <= 31; + } + return false; +}) + .on("cycle", (e) => { + console.log(`${datetimeValidationSuite.name}: ${e.target}`); +}); +exports.default = { + suites: [datetimeValidationSuite], +}; diff --git a/front_end/third_party/mcp-sdk/zod/lib/benchmarks/discriminatedUnion.d.ts b/front_end/third_party/mcp-sdk/zod/lib/benchmarks/discriminatedUnion.d.ts new file mode 100644 index 0000000000..9d2c302029 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/benchmarks/discriminatedUnion.d.ts @@ -0,0 +1,5 @@ +import Benchmark from "benchmark"; +declare const _default: { + suites: Benchmark.Suite[]; +}; +export default _default; diff --git a/front_end/third_party/mcp-sdk/zod/lib/benchmarks/discriminatedUnion.js b/front_end/third_party/mcp-sdk/zod/lib/benchmarks/discriminatedUnion.js new file mode 100644 index 0000000000..ea148f6510 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/benchmarks/discriminatedUnion.js @@ -0,0 +1,79 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const benchmark_1 = __importDefault(require("benchmark")); +const index_1 = require("../index"); +const doubleSuite = new benchmark_1.default.Suite("z.discriminatedUnion: double"); +const manySuite = new benchmark_1.default.Suite("z.discriminatedUnion: many"); +const aSchema = index_1.z.object({ + type: index_1.z.literal("a"), +}); +const objA = { + type: "a", +}; +const bSchema = index_1.z.object({ + type: index_1.z.literal("b"), +}); +const objB = { + type: "b", +}; +const cSchema = index_1.z.object({ + type: index_1.z.literal("c"), +}); +const objC = { + type: "c", +}; +const dSchema = index_1.z.object({ + type: index_1.z.literal("d"), +}); +const double = index_1.z.discriminatedUnion("type", [aSchema, bSchema]); +const many = index_1.z.discriminatedUnion("type", [aSchema, bSchema, cSchema, dSchema]); +doubleSuite + .add("valid: a", () => { + double.parse(objA); +}) + .add("valid: b", () => { + double.parse(objB); +}) + .add("invalid: null", () => { + try { + double.parse(null); + } + catch (err) { } +}) + .add("invalid: wrong shape", () => { + try { + double.parse(objC); + } + catch (err) { } +}) + .on("cycle", (e) => { + console.log(`${doubleSuite.name}: ${e.target}`); +}); +manySuite + .add("valid: a", () => { + many.parse(objA); +}) + .add("valid: c", () => { + many.parse(objC); +}) + .add("invalid: null", () => { + try { + many.parse(null); + } + catch (err) { } +}) + .add("invalid: wrong shape", () => { + try { + many.parse({ type: "unknown" }); + } + catch (err) { } +}) + .on("cycle", (e) => { + console.log(`${manySuite.name}: ${e.target}`); +}); +exports.default = { + suites: [doubleSuite, manySuite], +}; diff --git a/front_end/third_party/mcp-sdk/zod/lib/benchmarks/index.d.ts b/front_end/third_party/mcp-sdk/zod/lib/benchmarks/index.d.ts new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/benchmarks/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/front_end/third_party/mcp-sdk/zod/lib/benchmarks/index.js b/front_end/third_party/mcp-sdk/zod/lib/benchmarks/index.js new file mode 100644 index 0000000000..03766eacc9 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/benchmarks/index.js @@ -0,0 +1,59 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const datetime_1 = __importDefault(require("./datetime")); +const discriminatedUnion_1 = __importDefault(require("./discriminatedUnion")); +const ipv4_1 = __importDefault(require("./ipv4")); +const object_1 = __importDefault(require("./object")); +const primitives_1 = __importDefault(require("./primitives")); +const realworld_1 = __importDefault(require("./realworld")); +const string_1 = __importDefault(require("./string")); +const union_1 = __importDefault(require("./union")); +const argv = process.argv.slice(2); +let suites = []; +if (!argv.length) { + suites = [ + ...realworld_1.default.suites, + ...primitives_1.default.suites, + ...string_1.default.suites, + ...object_1.default.suites, + ...union_1.default.suites, + ...discriminatedUnion_1.default.suites, + ]; +} +else { + if (argv.includes("--realworld")) { + suites.push(...realworld_1.default.suites); + } + if (argv.includes("--primitives")) { + suites.push(...primitives_1.default.suites); + } + if (argv.includes("--string")) { + suites.push(...string_1.default.suites); + } + if (argv.includes("--object")) { + suites.push(...object_1.default.suites); + } + if (argv.includes("--union")) { + suites.push(...union_1.default.suites); + } + if (argv.includes("--discriminatedUnion")) { + suites.push(...datetime_1.default.suites); + } + if (argv.includes("--datetime")) { + suites.push(...datetime_1.default.suites); + } + if (argv.includes("--ipv4")) { + suites.push(...ipv4_1.default.suites); + } +} +for (const suite of suites) { + suite.run({}); +} +// exit on Ctrl-C +process.on("SIGINT", function () { + console.log("Exiting..."); + process.exit(); +}); diff --git a/front_end/third_party/mcp-sdk/zod/lib/benchmarks/ipv4.d.ts b/front_end/third_party/mcp-sdk/zod/lib/benchmarks/ipv4.d.ts new file mode 100644 index 0000000000..9d2c302029 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/benchmarks/ipv4.d.ts @@ -0,0 +1,5 @@ +import Benchmark from "benchmark"; +declare const _default: { + suites: Benchmark.Suite[]; +}; +export default _default; diff --git a/front_end/third_party/mcp-sdk/zod/lib/benchmarks/ipv4.js b/front_end/third_party/mcp-sdk/zod/lib/benchmarks/ipv4.js new file mode 100644 index 0000000000..70f1e3c9d6 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/benchmarks/ipv4.js @@ -0,0 +1,54 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const benchmark_1 = __importDefault(require("benchmark")); +const suite = new benchmark_1.default.Suite("ipv4"); +const DATA = "127.0.0.1"; +const ipv4RegexA = /^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/; +const ipv4RegexB = /^(?:(?:(?=(25[0-5]))\1|(?=(2[0-4][0-9]))\2|(?=(1[0-9]{2}))\3|(?=([0-9]{1,2}))\4)\.){3}(?:(?=(25[0-5]))\5|(?=(2[0-4][0-9]))\6|(?=(1[0-9]{2}))\7|(?=([0-9]{1,2}))\8)$/; +const ipv4RegexC = /^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/; +const ipv4RegexD = /^(\b25[0-5]|\b2[0-4][0-9]|\b[01]?[0-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/; +const ipv4RegexE = /^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.){3}(25[0-5]|(2[0-4]|1\d|[1-9]|)\d)$/; +const ipv4RegexF = /^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}$/; +const ipv4RegexG = /^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}$/; +const ipv4RegexH = /^((25[0-5]|(2[0-4]|1[0-9]|[1-9]|)[0-9])(\.(?!$)|$)){4}$/; +const ipv4RegexI = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/; +suite + .add("A", () => { + return ipv4RegexA.test(DATA); +}) + .add("B", () => { + return ipv4RegexB.test(DATA); +}) + .add("C", () => { + return ipv4RegexC.test(DATA); +}) + .add("D", () => { + return ipv4RegexD.test(DATA); +}) + .add("E", () => { + return ipv4RegexE.test(DATA); +}) + .add("F", () => { + return ipv4RegexF.test(DATA); +}) + .add("G", () => { + return ipv4RegexG.test(DATA); +}) + .add("H", () => { + return ipv4RegexH.test(DATA); +}) + .add("I", () => { + return ipv4RegexI.test(DATA); +}) + .on("cycle", (e) => { + console.log(`${suite.name}: ${e.target}`); +}); +exports.default = { + suites: [suite], +}; +if (require.main === module) { + suite.run(); +} diff --git a/front_end/third_party/mcp-sdk/zod/lib/benchmarks/object.d.ts b/front_end/third_party/mcp-sdk/zod/lib/benchmarks/object.d.ts new file mode 100644 index 0000000000..9d2c302029 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/benchmarks/object.d.ts @@ -0,0 +1,5 @@ +import Benchmark from "benchmark"; +declare const _default: { + suites: Benchmark.Suite[]; +}; +export default _default; diff --git a/front_end/third_party/mcp-sdk/zod/lib/benchmarks/object.js b/front_end/third_party/mcp-sdk/zod/lib/benchmarks/object.js new file mode 100644 index 0000000000..02f26c56ff --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/benchmarks/object.js @@ -0,0 +1,70 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const benchmark_1 = __importDefault(require("benchmark")); +const index_1 = require("../index"); +const emptySuite = new benchmark_1.default.Suite("z.object: empty"); +const shortSuite = new benchmark_1.default.Suite("z.object: short"); +const longSuite = new benchmark_1.default.Suite("z.object: long"); +const empty = index_1.z.object({}); +const short = index_1.z.object({ + string: index_1.z.string(), +}); +const long = index_1.z.object({ + string: index_1.z.string(), + number: index_1.z.number(), + boolean: index_1.z.boolean(), +}); +emptySuite + .add("valid", () => { + empty.parse({}); +}) + .add("valid: extra keys", () => { + empty.parse({ string: "string" }); +}) + .add("invalid: null", () => { + try { + empty.parse(null); + } + catch (err) { } +}) + .on("cycle", (e) => { + console.log(`${emptySuite.name}: ${e.target}`); +}); +shortSuite + .add("valid", () => { + short.parse({ string: "string" }); +}) + .add("valid: extra keys", () => { + short.parse({ string: "string", number: 42 }); +}) + .add("invalid: null", () => { + try { + short.parse(null); + } + catch (err) { } +}) + .on("cycle", (e) => { + console.log(`${shortSuite.name}: ${e.target}`); +}); +longSuite + .add("valid", () => { + long.parse({ string: "string", number: 42, boolean: true }); +}) + .add("valid: extra keys", () => { + long.parse({ string: "string", number: 42, boolean: true, list: [] }); +}) + .add("invalid: null", () => { + try { + long.parse(null); + } + catch (err) { } +}) + .on("cycle", (e) => { + console.log(`${longSuite.name}: ${e.target}`); +}); +exports.default = { + suites: [emptySuite, shortSuite, longSuite], +}; diff --git a/front_end/third_party/mcp-sdk/zod/lib/benchmarks/primitives.d.ts b/front_end/third_party/mcp-sdk/zod/lib/benchmarks/primitives.d.ts new file mode 100644 index 0000000000..9d2c302029 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/benchmarks/primitives.d.ts @@ -0,0 +1,5 @@ +import Benchmark from "benchmark"; +declare const _default: { + suites: Benchmark.Suite[]; +}; +export default _default; diff --git a/front_end/third_party/mcp-sdk/zod/lib/benchmarks/primitives.js b/front_end/third_party/mcp-sdk/zod/lib/benchmarks/primitives.js new file mode 100644 index 0000000000..6274f910f6 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/benchmarks/primitives.js @@ -0,0 +1,170 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const benchmark_1 = __importDefault(require("benchmark")); +const Mocker_1 = require("../__tests__/Mocker"); +const index_1 = require("../index"); +const val = new Mocker_1.Mocker(); +const enumSuite = new benchmark_1.default.Suite("z.enum"); +const enumSchema = index_1.z.enum(["a", "b", "c"]); +enumSuite + .add("valid", () => { + enumSchema.parse("a"); +}) + .add("invalid", () => { + try { + enumSchema.parse("x"); + } + catch (e) { } +}) + .on("cycle", (e) => { + console.log(`z.enum: ${e.target}`); +}); +const longEnumSuite = new benchmark_1.default.Suite("long z.enum"); +const longEnumSchema = index_1.z.enum([ + "one", + "two", + "three", + "four", + "five", + "six", + "seven", + "eight", + "nine", + "ten", + "eleven", + "twelve", + "thirteen", + "fourteen", + "fifteen", + "sixteen", + "seventeen", +]); +longEnumSuite + .add("valid", () => { + longEnumSchema.parse("five"); +}) + .add("invalid", () => { + try { + longEnumSchema.parse("invalid"); + } + catch (e) { } +}) + .on("cycle", (e) => { + console.log(`long z.enum: ${e.target}`); +}); +const undefinedSuite = new benchmark_1.default.Suite("z.undefined"); +const undefinedSchema = index_1.z.undefined(); +undefinedSuite + .add("valid", () => { + undefinedSchema.parse(undefined); +}) + .add("invalid", () => { + try { + undefinedSchema.parse(1); + } + catch (e) { } +}) + .on("cycle", (e) => { + console.log(`z.undefined: ${e.target}`); +}); +const literalSuite = new benchmark_1.default.Suite("z.literal"); +const short = "short"; +const bad = "bad"; +const literalSchema = index_1.z.literal("short"); +literalSuite + .add("valid", () => { + literalSchema.parse(short); +}) + .add("invalid", () => { + try { + literalSchema.parse(bad); + } + catch (e) { } +}) + .on("cycle", (e) => { + console.log(`z.literal: ${e.target}`); +}); +const numberSuite = new benchmark_1.default.Suite("z.number"); +const numberSchema = index_1.z.number().int(); +numberSuite + .add("valid", () => { + numberSchema.parse(1); +}) + .add("invalid type", () => { + try { + numberSchema.parse("bad"); + } + catch (e) { } +}) + .add("invalid number", () => { + try { + numberSchema.parse(0.5); + } + catch (e) { } +}) + .on("cycle", (e) => { + console.log(`z.number: ${e.target}`); +}); +const dateSuite = new benchmark_1.default.Suite("z.date"); +const plainDate = index_1.z.date(); +const minMaxDate = index_1.z + .date() + .min(new Date("2021-01-01")) + .max(new Date("2030-01-01")); +dateSuite + .add("valid", () => { + plainDate.parse(new Date()); +}) + .add("invalid", () => { + try { + plainDate.parse(1); + } + catch (e) { } +}) + .add("valid min and max", () => { + minMaxDate.parse(new Date("2023-01-01")); +}) + .add("invalid min", () => { + try { + minMaxDate.parse(new Date("2019-01-01")); + } + catch (e) { } +}) + .add("invalid max", () => { + try { + minMaxDate.parse(new Date("2031-01-01")); + } + catch (e) { } +}) + .on("cycle", (e) => { + console.log(`z.date: ${e.target}`); +}); +const symbolSuite = new benchmark_1.default.Suite("z.symbol"); +const symbolSchema = index_1.z.symbol(); +symbolSuite + .add("valid", () => { + symbolSchema.parse(val.symbol); +}) + .add("invalid", () => { + try { + symbolSchema.parse(1); + } + catch (e) { } +}) + .on("cycle", (e) => { + console.log(`z.symbol: ${e.target}`); +}); +exports.default = { + suites: [ + enumSuite, + longEnumSuite, + undefinedSuite, + literalSuite, + numberSuite, + dateSuite, + symbolSuite, + ], +}; diff --git a/front_end/third_party/mcp-sdk/zod/lib/benchmarks/realworld.d.ts b/front_end/third_party/mcp-sdk/zod/lib/benchmarks/realworld.d.ts new file mode 100644 index 0000000000..9d2c302029 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/benchmarks/realworld.d.ts @@ -0,0 +1,5 @@ +import Benchmark from "benchmark"; +declare const _default: { + suites: Benchmark.Suite[]; +}; +export default _default; diff --git a/front_end/third_party/mcp-sdk/zod/lib/benchmarks/realworld.js b/front_end/third_party/mcp-sdk/zod/lib/benchmarks/realworld.js new file mode 100644 index 0000000000..06f67ab1c8 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/benchmarks/realworld.js @@ -0,0 +1,56 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const benchmark_1 = __importDefault(require("benchmark")); +const index_1 = require("../index"); +const shortSuite = new benchmark_1.default.Suite("realworld"); +const People = index_1.z.array(index_1.z.object({ + type: index_1.z.literal("person"), + hair: index_1.z.enum(["blue", "brown"]), + active: index_1.z.boolean(), + name: index_1.z.string(), + age: index_1.z.number().int(), + hobbies: index_1.z.array(index_1.z.string()), + address: index_1.z.object({ + street: index_1.z.string(), + zip: index_1.z.string(), + country: index_1.z.string(), + }), +})); +let i = 0; +function num() { + return ++i; +} +function str() { + return (++i % 100).toString(16); +} +function array(fn) { + return Array.from({ length: ++i % 10 }, () => fn()); +} +const people = Array.from({ length: 100 }, () => { + return { + type: "person", + hair: i % 2 ? "blue" : "brown", + active: !!(i % 2), + name: str(), + age: num(), + hobbies: array(str), + address: { + street: str(), + zip: str(), + country: str(), + }, + }; +}); +shortSuite + .add("valid", () => { + People.parse(people); +}) + .on("cycle", (e) => { + console.log(`${shortSuite.name}: ${e.target}`); +}); +exports.default = { + suites: [shortSuite], +}; diff --git a/front_end/third_party/mcp-sdk/zod/lib/benchmarks/string.d.ts b/front_end/third_party/mcp-sdk/zod/lib/benchmarks/string.d.ts new file mode 100644 index 0000000000..9d2c302029 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/benchmarks/string.d.ts @@ -0,0 +1,5 @@ +import Benchmark from "benchmark"; +declare const _default: { + suites: Benchmark.Suite[]; +}; +export default _default; diff --git a/front_end/third_party/mcp-sdk/zod/lib/benchmarks/string.js b/front_end/third_party/mcp-sdk/zod/lib/benchmarks/string.js new file mode 100644 index 0000000000..14248d58e7 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/benchmarks/string.js @@ -0,0 +1,55 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const benchmark_1 = __importDefault(require("benchmark")); +const index_1 = require("../index"); +const SUITE_NAME = "z.string"; +const suite = new benchmark_1.default.Suite(SUITE_NAME); +const empty = ""; +const short = "short"; +const long = "long".repeat(256); +const manual = (str) => { + if (typeof str !== "string") { + throw new Error("Not a string"); + } + return str; +}; +const stringSchema = index_1.z.string(); +const optionalStringSchema = index_1.z.string().optional(); +const optionalNullableStringSchema = index_1.z.string().optional().nullable(); +suite + .add("empty string", () => { + stringSchema.parse(empty); +}) + .add("short string", () => { + stringSchema.parse(short); +}) + .add("long string", () => { + stringSchema.parse(long); +}) + .add("optional string", () => { + optionalStringSchema.parse(long); +}) + .add("nullable string", () => { + optionalNullableStringSchema.parse(long); +}) + .add("nullable (null) string", () => { + optionalNullableStringSchema.parse(null); +}) + .add("invalid: null", () => { + try { + stringSchema.parse(null); + } + catch (err) { } +}) + .add("manual parser: long", () => { + manual(long); +}) + .on("cycle", (e) => { + console.log(`${SUITE_NAME}: ${e.target}`); +}); +exports.default = { + suites: [suite], +}; diff --git a/front_end/third_party/mcp-sdk/zod/lib/benchmarks/union.d.ts b/front_end/third_party/mcp-sdk/zod/lib/benchmarks/union.d.ts new file mode 100644 index 0000000000..9d2c302029 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/benchmarks/union.d.ts @@ -0,0 +1,5 @@ +import Benchmark from "benchmark"; +declare const _default: { + suites: Benchmark.Suite[]; +}; +export default _default; diff --git a/front_end/third_party/mcp-sdk/zod/lib/benchmarks/union.js b/front_end/third_party/mcp-sdk/zod/lib/benchmarks/union.js new file mode 100644 index 0000000000..0639e21482 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/benchmarks/union.js @@ -0,0 +1,79 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const benchmark_1 = __importDefault(require("benchmark")); +const index_1 = require("../index"); +const doubleSuite = new benchmark_1.default.Suite("z.union: double"); +const manySuite = new benchmark_1.default.Suite("z.union: many"); +const aSchema = index_1.z.object({ + type: index_1.z.literal("a"), +}); +const objA = { + type: "a", +}; +const bSchema = index_1.z.object({ + type: index_1.z.literal("b"), +}); +const objB = { + type: "b", +}; +const cSchema = index_1.z.object({ + type: index_1.z.literal("c"), +}); +const objC = { + type: "c", +}; +const dSchema = index_1.z.object({ + type: index_1.z.literal("d"), +}); +const double = index_1.z.union([aSchema, bSchema]); +const many = index_1.z.union([aSchema, bSchema, cSchema, dSchema]); +doubleSuite + .add("valid: a", () => { + double.parse(objA); +}) + .add("valid: b", () => { + double.parse(objB); +}) + .add("invalid: null", () => { + try { + double.parse(null); + } + catch (err) { } +}) + .add("invalid: wrong shape", () => { + try { + double.parse(objC); + } + catch (err) { } +}) + .on("cycle", (e) => { + console.log(`${doubleSuite.name}: ${e.target}`); +}); +manySuite + .add("valid: a", () => { + many.parse(objA); +}) + .add("valid: c", () => { + many.parse(objC); +}) + .add("invalid: null", () => { + try { + many.parse(null); + } + catch (err) { } +}) + .add("invalid: wrong shape", () => { + try { + many.parse({ type: "unknown" }); + } + catch (err) { } +}) + .on("cycle", (e) => { + console.log(`${manySuite.name}: ${e.target}`); +}); +exports.default = { + suites: [doubleSuite, manySuite], +}; diff --git a/front_end/third_party/mcp-sdk/zod/lib/errors.d.ts b/front_end/third_party/mcp-sdk/zod/lib/errors.d.ts new file mode 100644 index 0000000000..ebf6b0f345 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/errors.d.ts @@ -0,0 +1,5 @@ +import defaultErrorMap from "./locales/en"; +import type { ZodErrorMap } from "./ZodError"; +export { defaultErrorMap }; +export declare function setErrorMap(map: ZodErrorMap): void; +export declare function getErrorMap(): ZodErrorMap; diff --git a/front_end/third_party/mcp-sdk/zod/lib/errors.js b/front_end/third_party/mcp-sdk/zod/lib/errors.js new file mode 100644 index 0000000000..93c6bc14fb --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/errors.js @@ -0,0 +1,17 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getErrorMap = exports.setErrorMap = exports.defaultErrorMap = void 0; +const en_1 = __importDefault(require("./locales/en")); +exports.defaultErrorMap = en_1.default; +let overrideErrorMap = en_1.default; +function setErrorMap(map) { + overrideErrorMap = map; +} +exports.setErrorMap = setErrorMap; +function getErrorMap() { + return overrideErrorMap; +} +exports.getErrorMap = getErrorMap; diff --git a/front_end/third_party/mcp-sdk/zod/lib/external.d.ts b/front_end/third_party/mcp-sdk/zod/lib/external.d.ts new file mode 100644 index 0000000000..002e17d9c0 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/external.d.ts @@ -0,0 +1,6 @@ +export * from "./errors"; +export * from "./helpers/parseUtil"; +export * from "./helpers/typeAliases"; +export * from "./helpers/util"; +export * from "./types"; +export * from "./ZodError"; diff --git a/front_end/third_party/mcp-sdk/zod/lib/external.js b/front_end/third_party/mcp-sdk/zod/lib/external.js new file mode 100644 index 0000000000..48e6db23a5 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/external.js @@ -0,0 +1,18 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./errors"), exports); +__exportStar(require("./helpers/parseUtil"), exports); +__exportStar(require("./helpers/typeAliases"), exports); +__exportStar(require("./helpers/util"), exports); +__exportStar(require("./types"), exports); +__exportStar(require("./ZodError"), exports); diff --git a/front_end/third_party/mcp-sdk/zod/lib/helpers/enumUtil.d.ts b/front_end/third_party/mcp-sdk/zod/lib/helpers/enumUtil.d.ts new file mode 100644 index 0000000000..fad28a7110 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/helpers/enumUtil.d.ts @@ -0,0 +1,8 @@ +export declare namespace enumUtil { + type UnionToIntersectionFn = (T extends unknown ? (k: () => T) => void : never) extends (k: infer Intersection) => void ? Intersection : never; + type GetUnionLast = UnionToIntersectionFn extends () => infer Last ? Last : never; + type UnionToTuple = [T] extends [never] ? Tuple : UnionToTuple>, [GetUnionLast, ...Tuple]>; + type CastToStringTuple = T extends [string, ...string[]] ? T : never; + export type UnionToTupleString = CastToStringTuple>; + export {}; +} diff --git a/front_end/third_party/mcp-sdk/zod/lib/helpers/enumUtil.js b/front_end/third_party/mcp-sdk/zod/lib/helpers/enumUtil.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/helpers/enumUtil.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/front_end/third_party/mcp-sdk/zod/lib/helpers/errorUtil.d.ts b/front_end/third_party/mcp-sdk/zod/lib/helpers/errorUtil.d.ts new file mode 100644 index 0000000000..5346d72ea9 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/helpers/errorUtil.d.ts @@ -0,0 +1,9 @@ +export declare namespace errorUtil { + type ErrMessage = string | { + message?: string; + }; + const errToObj: (message?: ErrMessage | undefined) => { + message?: string | undefined; + }; + const toString: (message?: ErrMessage | undefined) => string | undefined; +} diff --git a/front_end/third_party/mcp-sdk/zod/lib/helpers/errorUtil.js b/front_end/third_party/mcp-sdk/zod/lib/helpers/errorUtil.js new file mode 100644 index 0000000000..7fa2797750 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/helpers/errorUtil.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.errorUtil = void 0; +var errorUtil; +(function (errorUtil) { + errorUtil.errToObj = (message) => typeof message === "string" ? { message } : message || {}; + errorUtil.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message; +})(errorUtil = exports.errorUtil || (exports.errorUtil = {})); diff --git a/front_end/third_party/mcp-sdk/zod/lib/helpers/parseUtil.d.ts b/front_end/third_party/mcp-sdk/zod/lib/helpers/parseUtil.d.ts new file mode 100644 index 0000000000..24ea4909ac --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/helpers/parseUtil.d.ts @@ -0,0 +1,78 @@ +import type { IssueData, ZodErrorMap, ZodIssue } from "../ZodError"; +import type { ZodParsedType } from "./util"; +export declare const makeIssue: (params: { + data: any; + path: (string | number)[]; + errorMaps: ZodErrorMap[]; + issueData: IssueData; +}) => ZodIssue; +export declare type ParseParams = { + path: (string | number)[]; + errorMap: ZodErrorMap; + async: boolean; +}; +export declare type ParsePathComponent = string | number; +export declare type ParsePath = ParsePathComponent[]; +export declare const EMPTY_PATH: ParsePath; +export interface ParseContext { + readonly common: { + readonly issues: ZodIssue[]; + readonly contextualErrorMap?: ZodErrorMap; + readonly async: boolean; + }; + readonly path: ParsePath; + readonly schemaErrorMap?: ZodErrorMap; + readonly parent: ParseContext | null; + readonly data: any; + readonly parsedType: ZodParsedType; +} +export declare type ParseInput = { + data: any; + path: (string | number)[]; + parent: ParseContext; +}; +export declare function addIssueToContext(ctx: ParseContext, issueData: IssueData): void; +export declare type ObjectPair = { + key: SyncParseReturnType; + value: SyncParseReturnType; +}; +export declare class ParseStatus { + value: "aborted" | "dirty" | "valid"; + dirty(): void; + abort(): void; + static mergeArray(status: ParseStatus, results: SyncParseReturnType[]): SyncParseReturnType; + static mergeObjectAsync(status: ParseStatus, pairs: { + key: ParseReturnType; + value: ParseReturnType; + }[]): Promise>; + static mergeObjectSync(status: ParseStatus, pairs: { + key: SyncParseReturnType; + value: SyncParseReturnType; + alwaysSet?: boolean; + }[]): SyncParseReturnType; +} +export interface ParseResult { + status: "aborted" | "dirty" | "valid"; + data: any; +} +export declare type INVALID = { + status: "aborted"; +}; +export declare const INVALID: INVALID; +export declare type DIRTY = { + status: "dirty"; + value: T; +}; +export declare const DIRTY: (value: T) => DIRTY; +export declare type OK = { + status: "valid"; + value: T; +}; +export declare const OK: (value: T) => OK; +export declare type SyncParseReturnType = OK | DIRTY | INVALID; +export declare type AsyncParseReturnType = Promise>; +export declare type ParseReturnType = SyncParseReturnType | AsyncParseReturnType; +export declare const isAborted: (x: ParseReturnType) => x is INVALID; +export declare const isDirty: (x: ParseReturnType) => x is OK | DIRTY; +export declare const isValid: (x: ParseReturnType) => x is OK; +export declare const isAsync: (x: ParseReturnType) => x is AsyncParseReturnType; diff --git a/front_end/third_party/mcp-sdk/zod/lib/helpers/parseUtil.js b/front_end/third_party/mcp-sdk/zod/lib/helpers/parseUtil.js new file mode 100644 index 0000000000..8746348060 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/helpers/parseUtil.js @@ -0,0 +1,125 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isAsync = exports.isValid = exports.isDirty = exports.isAborted = exports.OK = exports.DIRTY = exports.INVALID = exports.ParseStatus = exports.addIssueToContext = exports.EMPTY_PATH = exports.makeIssue = void 0; +const errors_1 = require("../errors"); +const en_1 = __importDefault(require("../locales/en")); +const makeIssue = (params) => { + const { data, path, errorMaps, issueData } = params; + const fullPath = [...path, ...(issueData.path || [])]; + const fullIssue = { + ...issueData, + path: fullPath, + }; + if (issueData.message !== undefined) { + return { + ...issueData, + path: fullPath, + message: issueData.message, + }; + } + let errorMessage = ""; + const maps = errorMaps + .filter((m) => !!m) + .slice() + .reverse(); + for (const map of maps) { + errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message; + } + return { + ...issueData, + path: fullPath, + message: errorMessage, + }; +}; +exports.makeIssue = makeIssue; +exports.EMPTY_PATH = []; +function addIssueToContext(ctx, issueData) { + const overrideMap = (0, errors_1.getErrorMap)(); + const issue = (0, exports.makeIssue)({ + issueData: issueData, + data: ctx.data, + path: ctx.path, + errorMaps: [ + ctx.common.contextualErrorMap, + ctx.schemaErrorMap, + overrideMap, + overrideMap === en_1.default ? undefined : en_1.default, // then global default map + ].filter((x) => !!x), + }); + ctx.common.issues.push(issue); +} +exports.addIssueToContext = addIssueToContext; +class ParseStatus { + constructor() { + this.value = "valid"; + } + dirty() { + if (this.value === "valid") + this.value = "dirty"; + } + abort() { + if (this.value !== "aborted") + this.value = "aborted"; + } + static mergeArray(status, results) { + const arrayValue = []; + for (const s of results) { + if (s.status === "aborted") + return exports.INVALID; + if (s.status === "dirty") + status.dirty(); + arrayValue.push(s.value); + } + return { status: status.value, value: arrayValue }; + } + static async mergeObjectAsync(status, pairs) { + const syncPairs = []; + for (const pair of pairs) { + const key = await pair.key; + const value = await pair.value; + syncPairs.push({ + key, + value, + }); + } + return ParseStatus.mergeObjectSync(status, syncPairs); + } + static mergeObjectSync(status, pairs) { + const finalObject = {}; + for (const pair of pairs) { + const { key, value } = pair; + if (key.status === "aborted") + return exports.INVALID; + if (value.status === "aborted") + return exports.INVALID; + if (key.status === "dirty") + status.dirty(); + if (value.status === "dirty") + status.dirty(); + if (key.value !== "__proto__" && + (typeof value.value !== "undefined" || pair.alwaysSet)) { + finalObject[key.value] = value.value; + } + } + return { status: status.value, value: finalObject }; + } +} +exports.ParseStatus = ParseStatus; +exports.INVALID = Object.freeze({ + status: "aborted", +}); +const DIRTY = (value) => ({ status: "dirty", value }); +exports.DIRTY = DIRTY; +const OK = (value) => ({ status: "valid", value }); +exports.OK = OK; +const isAborted = (x) => x.status === "aborted"; +exports.isAborted = isAborted; +const isDirty = (x) => x.status === "dirty"; +exports.isDirty = isDirty; +const isValid = (x) => x.status === "valid"; +exports.isValid = isValid; +const isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise; +exports.isAsync = isAsync; diff --git a/front_end/third_party/mcp-sdk/zod/lib/helpers/partialUtil.d.ts b/front_end/third_party/mcp-sdk/zod/lib/helpers/partialUtil.d.ts new file mode 100644 index 0000000000..dd56a9d87f --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/helpers/partialUtil.d.ts @@ -0,0 +1,8 @@ +import type { ZodArray, ZodNullable, ZodObject, ZodOptional, ZodRawShape, ZodTuple, ZodTupleItems, ZodTypeAny } from "../index"; +export declare namespace partialUtil { + type DeepPartial = T extends ZodObject ? ZodObject<{ + [k in keyof T["shape"]]: ZodOptional>; + }, T["_def"]["unknownKeys"], T["_def"]["catchall"]> : T extends ZodArray ? ZodArray, Card> : T extends ZodOptional ? ZodOptional> : T extends ZodNullable ? ZodNullable> : T extends ZodTuple ? { + [k in keyof Items]: Items[k] extends ZodTypeAny ? DeepPartial : never; + } extends infer PI ? PI extends ZodTupleItems ? ZodTuple : never : never : T; +} diff --git a/front_end/third_party/mcp-sdk/zod/lib/helpers/partialUtil.js b/front_end/third_party/mcp-sdk/zod/lib/helpers/partialUtil.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/helpers/partialUtil.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/front_end/third_party/mcp-sdk/zod/lib/helpers/typeAliases.d.ts b/front_end/third_party/mcp-sdk/zod/lib/helpers/typeAliases.d.ts new file mode 100644 index 0000000000..aba4b3a1c5 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/helpers/typeAliases.d.ts @@ -0,0 +1,2 @@ +export declare type Primitive = string | number | symbol | bigint | boolean | null | undefined; +export declare type Scalars = Primitive | Primitive[]; diff --git a/front_end/third_party/mcp-sdk/zod/lib/helpers/typeAliases.js b/front_end/third_party/mcp-sdk/zod/lib/helpers/typeAliases.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/helpers/typeAliases.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/front_end/third_party/mcp-sdk/zod/lib/helpers/util.d.ts b/front_end/third_party/mcp-sdk/zod/lib/helpers/util.d.ts new file mode 100644 index 0000000000..b83dee3fbd --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/helpers/util.d.ts @@ -0,0 +1,82 @@ +export declare namespace util { + type AssertEqual = (() => V extends T ? 1 : 2) extends () => V extends U ? 1 : 2 ? true : false; + export type isAny = 0 extends 1 & T ? true : false; + export const assertEqual: (val: AssertEqual) => AssertEqual; + export function assertIs(_arg: T): void; + export function assertNever(_x: never): never; + export type Omit = Pick>; + export type OmitKeys = Pick>; + export type MakePartial = Omit & Partial>; + export type Exactly = T & Record, never>; + export const arrayToEnum: (items: U) => { [k in U[number]]: k; }; + export const getValidEnumValues: (obj: any) => any[]; + export const objectValues: (obj: any) => any[]; + export const objectKeys: ObjectConstructor["keys"]; + export const find: (arr: T[], checker: (arg: T) => any) => T | undefined; + export type identity = objectUtil.identity; + export type flatten = objectUtil.flatten; + export type noUndefined = T extends undefined ? never : T; + export const isInteger: NumberConstructor["isInteger"]; + export function joinValues(array: T, separator?: string): string; + export const jsonStringifyReplacer: (_: string, value: any) => any; + export {}; +} +export declare namespace objectUtil { + export type MergeShapes = { + [k in Exclude]: U[k]; + } & V; + type optionalKeys = { + [k in keyof T]: undefined extends T[k] ? k : never; + }[keyof T]; + type requiredKeys = { + [k in keyof T]: undefined extends T[k] ? never : k; + }[keyof T]; + export type addQuestionMarks = { + [K in requiredKeys]: T[K]; + } & { + [K in optionalKeys]?: T[K]; + } & { + [k in keyof T]?: unknown; + }; + export type identity = T; + export type flatten = identity<{ + [k in keyof T]: T[k]; + }>; + export type noNeverKeys = { + [k in keyof T]: [T[k]] extends [never] ? never : k; + }[keyof T]; + export type noNever = identity<{ + [k in noNeverKeys]: k extends keyof T ? T[k] : never; + }>; + export const mergeShapes: (first: U, second: T) => T & U; + export type extendShape = { + [K in keyof A as K extends keyof B ? never : K]: A[K]; + } & { + [K in keyof B]: B[K]; + }; + export {}; +} +export declare const ZodParsedType: { + function: "function"; + number: "number"; + string: "string"; + nan: "nan"; + integer: "integer"; + float: "float"; + boolean: "boolean"; + date: "date"; + bigint: "bigint"; + symbol: "symbol"; + undefined: "undefined"; + null: "null"; + array: "array"; + object: "object"; + unknown: "unknown"; + promise: "promise"; + void: "void"; + never: "never"; + map: "map"; + set: "set"; +}; +export declare type ZodParsedType = keyof typeof ZodParsedType; +export declare const getParsedType: (data: any) => ZodParsedType; diff --git a/front_end/third_party/mcp-sdk/zod/lib/helpers/util.js b/front_end/third_party/mcp-sdk/zod/lib/helpers/util.js new file mode 100644 index 0000000000..e60141ad4d --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/helpers/util.js @@ -0,0 +1,142 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getParsedType = exports.ZodParsedType = exports.objectUtil = exports.util = void 0; +var util; +(function (util) { + util.assertEqual = (val) => val; + function assertIs(_arg) { } + util.assertIs = assertIs; + function assertNever(_x) { + throw new Error(); + } + util.assertNever = assertNever; + util.arrayToEnum = (items) => { + const obj = {}; + for (const item of items) { + obj[item] = item; + } + return obj; + }; + util.getValidEnumValues = (obj) => { + const validKeys = util.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number"); + const filtered = {}; + for (const k of validKeys) { + filtered[k] = obj[k]; + } + return util.objectValues(filtered); + }; + util.objectValues = (obj) => { + return util.objectKeys(obj).map(function (e) { + return obj[e]; + }); + }; + util.objectKeys = typeof Object.keys === "function" // eslint-disable-line ban/ban + ? (obj) => Object.keys(obj) // eslint-disable-line ban/ban + : (object) => { + const keys = []; + for (const key in object) { + if (Object.prototype.hasOwnProperty.call(object, key)) { + keys.push(key); + } + } + return keys; + }; + util.find = (arr, checker) => { + for (const item of arr) { + if (checker(item)) + return item; + } + return undefined; + }; + util.isInteger = typeof Number.isInteger === "function" + ? (val) => Number.isInteger(val) // eslint-disable-line ban/ban + : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val; + function joinValues(array, separator = " | ") { + return array + .map((val) => (typeof val === "string" ? `'${val}'` : val)) + .join(separator); + } + util.joinValues = joinValues; + util.jsonStringifyReplacer = (_, value) => { + if (typeof value === "bigint") { + return value.toString(); + } + return value; + }; +})(util = exports.util || (exports.util = {})); +var objectUtil; +(function (objectUtil) { + objectUtil.mergeShapes = (first, second) => { + return { + ...first, + ...second, // second overwrites first + }; + }; +})(objectUtil = exports.objectUtil || (exports.objectUtil = {})); +exports.ZodParsedType = util.arrayToEnum([ + "string", + "nan", + "number", + "integer", + "float", + "boolean", + "date", + "bigint", + "symbol", + "function", + "undefined", + "null", + "array", + "object", + "unknown", + "promise", + "void", + "never", + "map", + "set", +]); +const getParsedType = (data) => { + const t = typeof data; + switch (t) { + case "undefined": + return exports.ZodParsedType.undefined; + case "string": + return exports.ZodParsedType.string; + case "number": + return isNaN(data) ? exports.ZodParsedType.nan : exports.ZodParsedType.number; + case "boolean": + return exports.ZodParsedType.boolean; + case "function": + return exports.ZodParsedType.function; + case "bigint": + return exports.ZodParsedType.bigint; + case "symbol": + return exports.ZodParsedType.symbol; + case "object": + if (Array.isArray(data)) { + return exports.ZodParsedType.array; + } + if (data === null) { + return exports.ZodParsedType.null; + } + if (data.then && + typeof data.then === "function" && + data.catch && + typeof data.catch === "function") { + return exports.ZodParsedType.promise; + } + if (typeof Map !== "undefined" && data instanceof Map) { + return exports.ZodParsedType.map; + } + if (typeof Set !== "undefined" && data instanceof Set) { + return exports.ZodParsedType.set; + } + if (typeof Date !== "undefined" && data instanceof Date) { + return exports.ZodParsedType.date; + } + return exports.ZodParsedType.object; + default: + return exports.ZodParsedType.unknown; + } +}; +exports.getParsedType = getParsedType; diff --git a/front_end/third_party/mcp-sdk/zod/lib/index.d.ts b/front_end/third_party/mcp-sdk/zod/lib/index.d.ts new file mode 100644 index 0000000000..e6a2db6291 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/index.d.ts @@ -0,0 +1,4 @@ +import * as z from "./external"; +export * from "./external"; +export { z }; +export default z; diff --git a/front_end/third_party/mcp-sdk/zod/lib/index.js b/front_end/third_party/mcp-sdk/zod/lib/index.js new file mode 100644 index 0000000000..1875b397e3 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/index.js @@ -0,0 +1,29 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.z = void 0; +const z = __importStar(require("./external")); +exports.z = z; +__exportStar(require("./external"), exports); +exports.default = z; diff --git a/front_end/third_party/mcp-sdk/zod/lib/index.mjs b/front_end/third_party/mcp-sdk/zod/lib/index.mjs new file mode 100644 index 0000000000..709bab8f43 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/index.mjs @@ -0,0 +1,4236 @@ +var util; +(function (util) { + util.assertEqual = (val) => val; + function assertIs(_arg) { } + util.assertIs = assertIs; + function assertNever(_x) { + throw new Error(); + } + util.assertNever = assertNever; + util.arrayToEnum = (items) => { + const obj = {}; + for (const item of items) { + obj[item] = item; + } + return obj; + }; + util.getValidEnumValues = (obj) => { + const validKeys = util.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number"); + const filtered = {}; + for (const k of validKeys) { + filtered[k] = obj[k]; + } + return util.objectValues(filtered); + }; + util.objectValues = (obj) => { + return util.objectKeys(obj).map(function (e) { + return obj[e]; + }); + }; + util.objectKeys = typeof Object.keys === "function" // eslint-disable-line ban/ban + ? (obj) => Object.keys(obj) // eslint-disable-line ban/ban + : (object) => { + const keys = []; + for (const key in object) { + if (Object.prototype.hasOwnProperty.call(object, key)) { + keys.push(key); + } + } + return keys; + }; + util.find = (arr, checker) => { + for (const item of arr) { + if (checker(item)) + return item; + } + return undefined; + }; + util.isInteger = typeof Number.isInteger === "function" + ? (val) => Number.isInteger(val) // eslint-disable-line ban/ban + : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val; + function joinValues(array, separator = " | ") { + return array + .map((val) => (typeof val === "string" ? `'${val}'` : val)) + .join(separator); + } + util.joinValues = joinValues; + util.jsonStringifyReplacer = (_, value) => { + if (typeof value === "bigint") { + return value.toString(); + } + return value; + }; +})(util || (util = {})); +var objectUtil; +(function (objectUtil) { + objectUtil.mergeShapes = (first, second) => { + return { + ...first, + ...second, // second overwrites first + }; + }; +})(objectUtil || (objectUtil = {})); +const ZodParsedType = util.arrayToEnum([ + "string", + "nan", + "number", + "integer", + "float", + "boolean", + "date", + "bigint", + "symbol", + "function", + "undefined", + "null", + "array", + "object", + "unknown", + "promise", + "void", + "never", + "map", + "set", +]); +const getParsedType = (data) => { + const t = typeof data; + switch (t) { + case "undefined": + return ZodParsedType.undefined; + case "string": + return ZodParsedType.string; + case "number": + return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number; + case "boolean": + return ZodParsedType.boolean; + case "function": + return ZodParsedType.function; + case "bigint": + return ZodParsedType.bigint; + case "symbol": + return ZodParsedType.symbol; + case "object": + if (Array.isArray(data)) { + return ZodParsedType.array; + } + if (data === null) { + return ZodParsedType.null; + } + if (data.then && + typeof data.then === "function" && + data.catch && + typeof data.catch === "function") { + return ZodParsedType.promise; + } + if (typeof Map !== "undefined" && data instanceof Map) { + return ZodParsedType.map; + } + if (typeof Set !== "undefined" && data instanceof Set) { + return ZodParsedType.set; + } + if (typeof Date !== "undefined" && data instanceof Date) { + return ZodParsedType.date; + } + return ZodParsedType.object; + default: + return ZodParsedType.unknown; + } +}; + +const ZodIssueCode = util.arrayToEnum([ + "invalid_type", + "invalid_literal", + "custom", + "invalid_union", + "invalid_union_discriminator", + "invalid_enum_value", + "unrecognized_keys", + "invalid_arguments", + "invalid_return_type", + "invalid_date", + "invalid_string", + "too_small", + "too_big", + "invalid_intersection_types", + "not_multiple_of", + "not_finite", +]); +const quotelessJson = (obj) => { + const json = JSON.stringify(obj, null, 2); + return json.replace(/"([^"]+)":/g, "$1:"); +}; +class ZodError extends Error { + constructor(issues) { + super(); + this.issues = []; + this.addIssue = (sub) => { + this.issues = [...this.issues, sub]; + }; + this.addIssues = (subs = []) => { + this.issues = [...this.issues, ...subs]; + }; + const actualProto = new.target.prototype; + if (Object.setPrototypeOf) { + // eslint-disable-next-line ban/ban + Object.setPrototypeOf(this, actualProto); + } + else { + this.__proto__ = actualProto; + } + this.name = "ZodError"; + this.issues = issues; + } + get errors() { + return this.issues; + } + format(_mapper) { + const mapper = _mapper || + function (issue) { + return issue.message; + }; + const fieldErrors = { _errors: [] }; + const processError = (error) => { + for (const issue of error.issues) { + if (issue.code === "invalid_union") { + issue.unionErrors.map(processError); + } + else if (issue.code === "invalid_return_type") { + processError(issue.returnTypeError); + } + else if (issue.code === "invalid_arguments") { + processError(issue.argumentsError); + } + else if (issue.path.length === 0) { + fieldErrors._errors.push(mapper(issue)); + } + else { + let curr = fieldErrors; + let i = 0; + while (i < issue.path.length) { + const el = issue.path[i]; + const terminal = i === issue.path.length - 1; + if (!terminal) { + curr[el] = curr[el] || { _errors: [] }; + // if (typeof el === "string") { + // curr[el] = curr[el] || { _errors: [] }; + // } else if (typeof el === "number") { + // const errorArray: any = []; + // errorArray._errors = []; + // curr[el] = curr[el] || errorArray; + // } + } + else { + curr[el] = curr[el] || { _errors: [] }; + curr[el]._errors.push(mapper(issue)); + } + curr = curr[el]; + i++; + } + } + } + }; + processError(this); + return fieldErrors; + } + static assert(value) { + if (!(value instanceof ZodError)) { + throw new Error(`Not a ZodError: ${value}`); + } + } + toString() { + return this.message; + } + get message() { + return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2); + } + get isEmpty() { + return this.issues.length === 0; + } + flatten(mapper = (issue) => issue.message) { + const fieldErrors = {}; + const formErrors = []; + for (const sub of this.issues) { + if (sub.path.length > 0) { + fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || []; + fieldErrors[sub.path[0]].push(mapper(sub)); + } + else { + formErrors.push(mapper(sub)); + } + } + return { formErrors, fieldErrors }; + } + get formErrors() { + return this.flatten(); + } +} +ZodError.create = (issues) => { + const error = new ZodError(issues); + return error; +}; + +const errorMap = (issue, _ctx) => { + let message; + switch (issue.code) { + case ZodIssueCode.invalid_type: + if (issue.received === ZodParsedType.undefined) { + message = "Required"; + } + else { + message = `Expected ${issue.expected}, received ${issue.received}`; + } + break; + case ZodIssueCode.invalid_literal: + message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`; + break; + case ZodIssueCode.unrecognized_keys: + message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, ", ")}`; + break; + case ZodIssueCode.invalid_union: + message = `Invalid input`; + break; + case ZodIssueCode.invalid_union_discriminator: + message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`; + break; + case ZodIssueCode.invalid_enum_value: + message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`; + break; + case ZodIssueCode.invalid_arguments: + message = `Invalid function arguments`; + break; + case ZodIssueCode.invalid_return_type: + message = `Invalid function return type`; + break; + case ZodIssueCode.invalid_date: + message = `Invalid date`; + break; + case ZodIssueCode.invalid_string: + if (typeof issue.validation === "object") { + if ("includes" in issue.validation) { + message = `Invalid input: must include "${issue.validation.includes}"`; + if (typeof issue.validation.position === "number") { + message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`; + } + } + else if ("startsWith" in issue.validation) { + message = `Invalid input: must start with "${issue.validation.startsWith}"`; + } + else if ("endsWith" in issue.validation) { + message = `Invalid input: must end with "${issue.validation.endsWith}"`; + } + else { + util.assertNever(issue.validation); + } + } + else if (issue.validation !== "regex") { + message = `Invalid ${issue.validation}`; + } + else { + message = "Invalid"; + } + break; + case ZodIssueCode.too_small: + if (issue.type === "array") + message = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`; + else if (issue.type === "string") + message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`; + else if (issue.type === "number") + message = `Number must be ${issue.exact + ? `exactly equal to ` + : issue.inclusive + ? `greater than or equal to ` + : `greater than `}${issue.minimum}`; + else if (issue.type === "date") + message = `Date must be ${issue.exact + ? `exactly equal to ` + : issue.inclusive + ? `greater than or equal to ` + : `greater than `}${new Date(Number(issue.minimum))}`; + else + message = "Invalid input"; + break; + case ZodIssueCode.too_big: + if (issue.type === "array") + message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`; + else if (issue.type === "string") + message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`; + else if (issue.type === "number") + message = `Number must be ${issue.exact + ? `exactly` + : issue.inclusive + ? `less than or equal to` + : `less than`} ${issue.maximum}`; + else if (issue.type === "bigint") + message = `BigInt must be ${issue.exact + ? `exactly` + : issue.inclusive + ? `less than or equal to` + : `less than`} ${issue.maximum}`; + else if (issue.type === "date") + message = `Date must be ${issue.exact + ? `exactly` + : issue.inclusive + ? `smaller than or equal to` + : `smaller than`} ${new Date(Number(issue.maximum))}`; + else + message = "Invalid input"; + break; + case ZodIssueCode.custom: + message = `Invalid input`; + break; + case ZodIssueCode.invalid_intersection_types: + message = `Intersection results could not be merged`; + break; + case ZodIssueCode.not_multiple_of: + message = `Number must be a multiple of ${issue.multipleOf}`; + break; + case ZodIssueCode.not_finite: + message = "Number must be finite"; + break; + default: + message = _ctx.defaultError; + util.assertNever(issue); + } + return { message }; +}; + +let overrideErrorMap = errorMap; +function setErrorMap(map) { + overrideErrorMap = map; +} +function getErrorMap() { + return overrideErrorMap; +} + +const makeIssue = (params) => { + const { data, path, errorMaps, issueData } = params; + const fullPath = [...path, ...(issueData.path || [])]; + const fullIssue = { + ...issueData, + path: fullPath, + }; + if (issueData.message !== undefined) { + return { + ...issueData, + path: fullPath, + message: issueData.message, + }; + } + let errorMessage = ""; + const maps = errorMaps + .filter((m) => !!m) + .slice() + .reverse(); + for (const map of maps) { + errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message; + } + return { + ...issueData, + path: fullPath, + message: errorMessage, + }; +}; +const EMPTY_PATH = []; +function addIssueToContext(ctx, issueData) { + const overrideMap = getErrorMap(); + const issue = makeIssue({ + issueData: issueData, + data: ctx.data, + path: ctx.path, + errorMaps: [ + ctx.common.contextualErrorMap, + ctx.schemaErrorMap, + overrideMap, + overrideMap === errorMap ? undefined : errorMap, // then global default map + ].filter((x) => !!x), + }); + ctx.common.issues.push(issue); +} +class ParseStatus { + constructor() { + this.value = "valid"; + } + dirty() { + if (this.value === "valid") + this.value = "dirty"; + } + abort() { + if (this.value !== "aborted") + this.value = "aborted"; + } + static mergeArray(status, results) { + const arrayValue = []; + for (const s of results) { + if (s.status === "aborted") + return INVALID; + if (s.status === "dirty") + status.dirty(); + arrayValue.push(s.value); + } + return { status: status.value, value: arrayValue }; + } + static async mergeObjectAsync(status, pairs) { + const syncPairs = []; + for (const pair of pairs) { + const key = await pair.key; + const value = await pair.value; + syncPairs.push({ + key, + value, + }); + } + return ParseStatus.mergeObjectSync(status, syncPairs); + } + static mergeObjectSync(status, pairs) { + const finalObject = {}; + for (const pair of pairs) { + const { key, value } = pair; + if (key.status === "aborted") + return INVALID; + if (value.status === "aborted") + return INVALID; + if (key.status === "dirty") + status.dirty(); + if (value.status === "dirty") + status.dirty(); + if (key.value !== "__proto__" && + (typeof value.value !== "undefined" || pair.alwaysSet)) { + finalObject[key.value] = value.value; + } + } + return { status: status.value, value: finalObject }; + } +} +const INVALID = Object.freeze({ + status: "aborted", +}); +const DIRTY = (value) => ({ status: "dirty", value }); +const OK = (value) => ({ status: "valid", value }); +const isAborted = (x) => x.status === "aborted"; +const isDirty = (x) => x.status === "dirty"; +const isValid = (x) => x.status === "valid"; +const isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise; + +/****************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ + +function __classPrivateFieldGet(receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); +} + +function __classPrivateFieldSet(receiver, state, value, kind, f) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; +} + +typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { + var e = new Error(message); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; +}; + +var errorUtil; +(function (errorUtil) { + errorUtil.errToObj = (message) => typeof message === "string" ? { message } : message || {}; + errorUtil.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message; +})(errorUtil || (errorUtil = {})); + +var _ZodEnum_cache, _ZodNativeEnum_cache; +class ParseInputLazyPath { + constructor(parent, value, path, key) { + this._cachedPath = []; + this.parent = parent; + this.data = value; + this._path = path; + this._key = key; + } + get path() { + if (!this._cachedPath.length) { + if (this._key instanceof Array) { + this._cachedPath.push(...this._path, ...this._key); + } + else { + this._cachedPath.push(...this._path, this._key); + } + } + return this._cachedPath; + } +} +const handleResult = (ctx, result) => { + if (isValid(result)) { + return { success: true, data: result.value }; + } + else { + if (!ctx.common.issues.length) { + throw new Error("Validation failed but no issues detected."); + } + return { + success: false, + get error() { + if (this._error) + return this._error; + const error = new ZodError(ctx.common.issues); + this._error = error; + return this._error; + }, + }; + } +}; +function processCreateParams(params) { + if (!params) + return {}; + const { errorMap, invalid_type_error, required_error, description } = params; + if (errorMap && (invalid_type_error || required_error)) { + throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`); + } + if (errorMap) + return { errorMap: errorMap, description }; + const customMap = (iss, ctx) => { + var _a, _b; + const { message } = params; + if (iss.code === "invalid_enum_value") { + return { message: message !== null && message !== void 0 ? message : ctx.defaultError }; + } + if (typeof ctx.data === "undefined") { + return { message: (_a = message !== null && message !== void 0 ? message : required_error) !== null && _a !== void 0 ? _a : ctx.defaultError }; + } + if (iss.code !== "invalid_type") + return { message: ctx.defaultError }; + return { message: (_b = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _b !== void 0 ? _b : ctx.defaultError }; + }; + return { errorMap: customMap, description }; +} +class ZodType { + constructor(def) { + /** Alias of safeParseAsync */ + this.spa = this.safeParseAsync; + this._def = def; + this.parse = this.parse.bind(this); + this.safeParse = this.safeParse.bind(this); + this.parseAsync = this.parseAsync.bind(this); + this.safeParseAsync = this.safeParseAsync.bind(this); + this.spa = this.spa.bind(this); + this.refine = this.refine.bind(this); + this.refinement = this.refinement.bind(this); + this.superRefine = this.superRefine.bind(this); + this.optional = this.optional.bind(this); + this.nullable = this.nullable.bind(this); + this.nullish = this.nullish.bind(this); + this.array = this.array.bind(this); + this.promise = this.promise.bind(this); + this.or = this.or.bind(this); + this.and = this.and.bind(this); + this.transform = this.transform.bind(this); + this.brand = this.brand.bind(this); + this.default = this.default.bind(this); + this.catch = this.catch.bind(this); + this.describe = this.describe.bind(this); + this.pipe = this.pipe.bind(this); + this.readonly = this.readonly.bind(this); + this.isNullable = this.isNullable.bind(this); + this.isOptional = this.isOptional.bind(this); + } + get description() { + return this._def.description; + } + _getType(input) { + return getParsedType(input.data); + } + _getOrReturnCtx(input, ctx) { + return (ctx || { + common: input.parent.common, + data: input.data, + parsedType: getParsedType(input.data), + schemaErrorMap: this._def.errorMap, + path: input.path, + parent: input.parent, + }); + } + _processInputParams(input) { + return { + status: new ParseStatus(), + ctx: { + common: input.parent.common, + data: input.data, + parsedType: getParsedType(input.data), + schemaErrorMap: this._def.errorMap, + path: input.path, + parent: input.parent, + }, + }; + } + _parseSync(input) { + const result = this._parse(input); + if (isAsync(result)) { + throw new Error("Synchronous parse encountered promise."); + } + return result; + } + _parseAsync(input) { + const result = this._parse(input); + return Promise.resolve(result); + } + parse(data, params) { + const result = this.safeParse(data, params); + if (result.success) + return result.data; + throw result.error; + } + safeParse(data, params) { + var _a; + const ctx = { + common: { + issues: [], + async: (_a = params === null || params === void 0 ? void 0 : params.async) !== null && _a !== void 0 ? _a : false, + contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap, + }, + path: (params === null || params === void 0 ? void 0 : params.path) || [], + schemaErrorMap: this._def.errorMap, + parent: null, + data, + parsedType: getParsedType(data), + }; + const result = this._parseSync({ data, path: ctx.path, parent: ctx }); + return handleResult(ctx, result); + } + async parseAsync(data, params) { + const result = await this.safeParseAsync(data, params); + if (result.success) + return result.data; + throw result.error; + } + async safeParseAsync(data, params) { + const ctx = { + common: { + issues: [], + contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap, + async: true, + }, + path: (params === null || params === void 0 ? void 0 : params.path) || [], + schemaErrorMap: this._def.errorMap, + parent: null, + data, + parsedType: getParsedType(data), + }; + const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx }); + const result = await (isAsync(maybeAsyncResult) + ? maybeAsyncResult + : Promise.resolve(maybeAsyncResult)); + return handleResult(ctx, result); + } + refine(check, message) { + const getIssueProperties = (val) => { + if (typeof message === "string" || typeof message === "undefined") { + return { message }; + } + else if (typeof message === "function") { + return message(val); + } + else { + return message; + } + }; + return this._refinement((val, ctx) => { + const result = check(val); + const setError = () => ctx.addIssue({ + code: ZodIssueCode.custom, + ...getIssueProperties(val), + }); + if (typeof Promise !== "undefined" && result instanceof Promise) { + return result.then((data) => { + if (!data) { + setError(); + return false; + } + else { + return true; + } + }); + } + if (!result) { + setError(); + return false; + } + else { + return true; + } + }); + } + refinement(check, refinementData) { + return this._refinement((val, ctx) => { + if (!check(val)) { + ctx.addIssue(typeof refinementData === "function" + ? refinementData(val, ctx) + : refinementData); + return false; + } + else { + return true; + } + }); + } + _refinement(refinement) { + return new ZodEffects({ + schema: this, + typeName: ZodFirstPartyTypeKind.ZodEffects, + effect: { type: "refinement", refinement }, + }); + } + superRefine(refinement) { + return this._refinement(refinement); + } + optional() { + return ZodOptional.create(this, this._def); + } + nullable() { + return ZodNullable.create(this, this._def); + } + nullish() { + return this.nullable().optional(); + } + array() { + return ZodArray.create(this, this._def); + } + promise() { + return ZodPromise.create(this, this._def); + } + or(option) { + return ZodUnion.create([this, option], this._def); + } + and(incoming) { + return ZodIntersection.create(this, incoming, this._def); + } + transform(transform) { + return new ZodEffects({ + ...processCreateParams(this._def), + schema: this, + typeName: ZodFirstPartyTypeKind.ZodEffects, + effect: { type: "transform", transform }, + }); + } + default(def) { + const defaultValueFunc = typeof def === "function" ? def : () => def; + return new ZodDefault({ + ...processCreateParams(this._def), + innerType: this, + defaultValue: defaultValueFunc, + typeName: ZodFirstPartyTypeKind.ZodDefault, + }); + } + brand() { + return new ZodBranded({ + typeName: ZodFirstPartyTypeKind.ZodBranded, + type: this, + ...processCreateParams(this._def), + }); + } + catch(def) { + const catchValueFunc = typeof def === "function" ? def : () => def; + return new ZodCatch({ + ...processCreateParams(this._def), + innerType: this, + catchValue: catchValueFunc, + typeName: ZodFirstPartyTypeKind.ZodCatch, + }); + } + describe(description) { + const This = this.constructor; + return new This({ + ...this._def, + description, + }); + } + pipe(target) { + return ZodPipeline.create(this, target); + } + readonly() { + return ZodReadonly.create(this); + } + isOptional() { + return this.safeParse(undefined).success; + } + isNullable() { + return this.safeParse(null).success; + } +} +const cuidRegex = /^c[^\s-]{8,}$/i; +const cuid2Regex = /^[0-9a-z]+$/; +const ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/; +// const uuidRegex = +// /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i; +const uuidRegex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i; +const nanoidRegex = /^[a-z0-9_-]{21}$/i; +const durationRegex = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/; +// from https://stackoverflow.com/a/46181/1550155 +// old version: too slow, didn't support unicode +// const emailRegex = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i; +//old email regex +// const emailRegex = /^(([^<>()[\].,;:\s@"]+(\.[^<>()[\].,;:\s@"]+)*)|(".+"))@((?!-)([^<>()[\].,;:\s@"]+\.)+[^<>()[\].,;:\s@"]{1,})[^-<>()[\].,;:\s@"]$/i; +// eslint-disable-next-line +// const emailRegex = +// /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\])|(\[IPv6:(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\.[A-Za-z]{2,})+))$/; +// const emailRegex = +// /^[a-zA-Z0-9\.\!\#\$\%\&\'\*\+\/\=\?\^\_\`\{\|\}\~\-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/; +// const emailRegex = +// /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i; +const emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i; +// const emailRegex = +// /^[a-z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-z0-9-]+(?:\.[a-z0-9\-]+)*$/i; +// from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression +const _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`; +let emojiRegex; +// faster, simpler, safer +const ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/; +const ipv6Regex = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/; +// https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript +const base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/; +// simple +// const dateRegexSource = `\\d{4}-\\d{2}-\\d{2}`; +// no leap year validation +// const dateRegexSource = `\\d{4}-((0[13578]|10|12)-31|(0[13-9]|1[0-2])-30|(0[1-9]|1[0-2])-(0[1-9]|1\\d|2\\d))`; +// with leap year validation +const dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`; +const dateRegex = new RegExp(`^${dateRegexSource}$`); +function timeRegexSource(args) { + // let regex = `\\d{2}:\\d{2}:\\d{2}`; + let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`; + if (args.precision) { + regex = `${regex}\\.\\d{${args.precision}}`; + } + else if (args.precision == null) { + regex = `${regex}(\\.\\d+)?`; + } + return regex; +} +function timeRegex(args) { + return new RegExp(`^${timeRegexSource(args)}$`); +} +// Adapted from https://stackoverflow.com/a/3143231 +function datetimeRegex(args) { + let regex = `${dateRegexSource}T${timeRegexSource(args)}`; + const opts = []; + opts.push(args.local ? `Z?` : `Z`); + if (args.offset) + opts.push(`([+-]\\d{2}:?\\d{2})`); + regex = `${regex}(${opts.join("|")})`; + return new RegExp(`^${regex}$`); +} +function isValidIP(ip, version) { + if ((version === "v4" || !version) && ipv4Regex.test(ip)) { + return true; + } + if ((version === "v6" || !version) && ipv6Regex.test(ip)) { + return true; + } + return false; +} +class ZodString extends ZodType { + _parse(input) { + if (this._def.coerce) { + input.data = String(input.data); + } + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.string) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.string, + received: ctx.parsedType, + }); + return INVALID; + } + const status = new ParseStatus(); + let ctx = undefined; + for (const check of this._def.checks) { + if (check.kind === "min") { + if (input.data.length < check.value) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.too_small, + minimum: check.value, + type: "string", + inclusive: true, + exact: false, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "max") { + if (input.data.length > check.value) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.too_big, + maximum: check.value, + type: "string", + inclusive: true, + exact: false, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "length") { + const tooBig = input.data.length > check.value; + const tooSmall = input.data.length < check.value; + if (tooBig || tooSmall) { + ctx = this._getOrReturnCtx(input, ctx); + if (tooBig) { + addIssueToContext(ctx, { + code: ZodIssueCode.too_big, + maximum: check.value, + type: "string", + inclusive: true, + exact: true, + message: check.message, + }); + } + else if (tooSmall) { + addIssueToContext(ctx, { + code: ZodIssueCode.too_small, + minimum: check.value, + type: "string", + inclusive: true, + exact: true, + message: check.message, + }); + } + status.dirty(); + } + } + else if (check.kind === "email") { + if (!emailRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "email", + code: ZodIssueCode.invalid_string, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "emoji") { + if (!emojiRegex) { + emojiRegex = new RegExp(_emojiRegex, "u"); + } + if (!emojiRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "emoji", + code: ZodIssueCode.invalid_string, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "uuid") { + if (!uuidRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "uuid", + code: ZodIssueCode.invalid_string, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "nanoid") { + if (!nanoidRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "nanoid", + code: ZodIssueCode.invalid_string, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "cuid") { + if (!cuidRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "cuid", + code: ZodIssueCode.invalid_string, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "cuid2") { + if (!cuid2Regex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "cuid2", + code: ZodIssueCode.invalid_string, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "ulid") { + if (!ulidRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "ulid", + code: ZodIssueCode.invalid_string, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "url") { + try { + new URL(input.data); + } + catch (_a) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "url", + code: ZodIssueCode.invalid_string, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "regex") { + check.regex.lastIndex = 0; + const testResult = check.regex.test(input.data); + if (!testResult) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "regex", + code: ZodIssueCode.invalid_string, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "trim") { + input.data = input.data.trim(); + } + else if (check.kind === "includes") { + if (!input.data.includes(check.value, check.position)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_string, + validation: { includes: check.value, position: check.position }, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "toLowerCase") { + input.data = input.data.toLowerCase(); + } + else if (check.kind === "toUpperCase") { + input.data = input.data.toUpperCase(); + } + else if (check.kind === "startsWith") { + if (!input.data.startsWith(check.value)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_string, + validation: { startsWith: check.value }, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "endsWith") { + if (!input.data.endsWith(check.value)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_string, + validation: { endsWith: check.value }, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "datetime") { + const regex = datetimeRegex(check); + if (!regex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_string, + validation: "datetime", + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "date") { + const regex = dateRegex; + if (!regex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_string, + validation: "date", + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "time") { + const regex = timeRegex(check); + if (!regex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_string, + validation: "time", + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "duration") { + if (!durationRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "duration", + code: ZodIssueCode.invalid_string, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "ip") { + if (!isValidIP(input.data, check.version)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "ip", + code: ZodIssueCode.invalid_string, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "base64") { + if (!base64Regex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "base64", + code: ZodIssueCode.invalid_string, + message: check.message, + }); + status.dirty(); + } + } + else { + util.assertNever(check); + } + } + return { status: status.value, value: input.data }; + } + _regex(regex, validation, message) { + return this.refinement((data) => regex.test(data), { + validation, + code: ZodIssueCode.invalid_string, + ...errorUtil.errToObj(message), + }); + } + _addCheck(check) { + return new ZodString({ + ...this._def, + checks: [...this._def.checks, check], + }); + } + email(message) { + return this._addCheck({ kind: "email", ...errorUtil.errToObj(message) }); + } + url(message) { + return this._addCheck({ kind: "url", ...errorUtil.errToObj(message) }); + } + emoji(message) { + return this._addCheck({ kind: "emoji", ...errorUtil.errToObj(message) }); + } + uuid(message) { + return this._addCheck({ kind: "uuid", ...errorUtil.errToObj(message) }); + } + nanoid(message) { + return this._addCheck({ kind: "nanoid", ...errorUtil.errToObj(message) }); + } + cuid(message) { + return this._addCheck({ kind: "cuid", ...errorUtil.errToObj(message) }); + } + cuid2(message) { + return this._addCheck({ kind: "cuid2", ...errorUtil.errToObj(message) }); + } + ulid(message) { + return this._addCheck({ kind: "ulid", ...errorUtil.errToObj(message) }); + } + base64(message) { + return this._addCheck({ kind: "base64", ...errorUtil.errToObj(message) }); + } + ip(options) { + return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) }); + } + datetime(options) { + var _a, _b; + if (typeof options === "string") { + return this._addCheck({ + kind: "datetime", + precision: null, + offset: false, + local: false, + message: options, + }); + } + return this._addCheck({ + kind: "datetime", + precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision, + offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false, + local: (_b = options === null || options === void 0 ? void 0 : options.local) !== null && _b !== void 0 ? _b : false, + ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message), + }); + } + date(message) { + return this._addCheck({ kind: "date", message }); + } + time(options) { + if (typeof options === "string") { + return this._addCheck({ + kind: "time", + precision: null, + message: options, + }); + } + return this._addCheck({ + kind: "time", + precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision, + ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message), + }); + } + duration(message) { + return this._addCheck({ kind: "duration", ...errorUtil.errToObj(message) }); + } + regex(regex, message) { + return this._addCheck({ + kind: "regex", + regex: regex, + ...errorUtil.errToObj(message), + }); + } + includes(value, options) { + return this._addCheck({ + kind: "includes", + value: value, + position: options === null || options === void 0 ? void 0 : options.position, + ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message), + }); + } + startsWith(value, message) { + return this._addCheck({ + kind: "startsWith", + value: value, + ...errorUtil.errToObj(message), + }); + } + endsWith(value, message) { + return this._addCheck({ + kind: "endsWith", + value: value, + ...errorUtil.errToObj(message), + }); + } + min(minLength, message) { + return this._addCheck({ + kind: "min", + value: minLength, + ...errorUtil.errToObj(message), + }); + } + max(maxLength, message) { + return this._addCheck({ + kind: "max", + value: maxLength, + ...errorUtil.errToObj(message), + }); + } + length(len, message) { + return this._addCheck({ + kind: "length", + value: len, + ...errorUtil.errToObj(message), + }); + } + /** + * @deprecated Use z.string().min(1) instead. + * @see {@link ZodString.min} + */ + nonempty(message) { + return this.min(1, errorUtil.errToObj(message)); + } + trim() { + return new ZodString({ + ...this._def, + checks: [...this._def.checks, { kind: "trim" }], + }); + } + toLowerCase() { + return new ZodString({ + ...this._def, + checks: [...this._def.checks, { kind: "toLowerCase" }], + }); + } + toUpperCase() { + return new ZodString({ + ...this._def, + checks: [...this._def.checks, { kind: "toUpperCase" }], + }); + } + get isDatetime() { + return !!this._def.checks.find((ch) => ch.kind === "datetime"); + } + get isDate() { + return !!this._def.checks.find((ch) => ch.kind === "date"); + } + get isTime() { + return !!this._def.checks.find((ch) => ch.kind === "time"); + } + get isDuration() { + return !!this._def.checks.find((ch) => ch.kind === "duration"); + } + get isEmail() { + return !!this._def.checks.find((ch) => ch.kind === "email"); + } + get isURL() { + return !!this._def.checks.find((ch) => ch.kind === "url"); + } + get isEmoji() { + return !!this._def.checks.find((ch) => ch.kind === "emoji"); + } + get isUUID() { + return !!this._def.checks.find((ch) => ch.kind === "uuid"); + } + get isNANOID() { + return !!this._def.checks.find((ch) => ch.kind === "nanoid"); + } + get isCUID() { + return !!this._def.checks.find((ch) => ch.kind === "cuid"); + } + get isCUID2() { + return !!this._def.checks.find((ch) => ch.kind === "cuid2"); + } + get isULID() { + return !!this._def.checks.find((ch) => ch.kind === "ulid"); + } + get isIP() { + return !!this._def.checks.find((ch) => ch.kind === "ip"); + } + get isBase64() { + return !!this._def.checks.find((ch) => ch.kind === "base64"); + } + get minLength() { + let min = null; + for (const ch of this._def.checks) { + if (ch.kind === "min") { + if (min === null || ch.value > min) + min = ch.value; + } + } + return min; + } + get maxLength() { + let max = null; + for (const ch of this._def.checks) { + if (ch.kind === "max") { + if (max === null || ch.value < max) + max = ch.value; + } + } + return max; + } +} +ZodString.create = (params) => { + var _a; + return new ZodString({ + checks: [], + typeName: ZodFirstPartyTypeKind.ZodString, + coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false, + ...processCreateParams(params), + }); +}; +// https://stackoverflow.com/questions/3966484/why-does-modulus-operator-return-fractional-number-in-javascript/31711034#31711034 +function floatSafeRemainder(val, step) { + const valDecCount = (val.toString().split(".")[1] || "").length; + const stepDecCount = (step.toString().split(".")[1] || "").length; + const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount; + const valInt = parseInt(val.toFixed(decCount).replace(".", "")); + const stepInt = parseInt(step.toFixed(decCount).replace(".", "")); + return (valInt % stepInt) / Math.pow(10, decCount); +} +class ZodNumber extends ZodType { + constructor() { + super(...arguments); + this.min = this.gte; + this.max = this.lte; + this.step = this.multipleOf; + } + _parse(input) { + if (this._def.coerce) { + input.data = Number(input.data); + } + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.number) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.number, + received: ctx.parsedType, + }); + return INVALID; + } + let ctx = undefined; + const status = new ParseStatus(); + for (const check of this._def.checks) { + if (check.kind === "int") { + if (!util.isInteger(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: "integer", + received: "float", + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "min") { + const tooSmall = check.inclusive + ? input.data < check.value + : input.data <= check.value; + if (tooSmall) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.too_small, + minimum: check.value, + type: "number", + inclusive: check.inclusive, + exact: false, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "max") { + const tooBig = check.inclusive + ? input.data > check.value + : input.data >= check.value; + if (tooBig) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.too_big, + maximum: check.value, + type: "number", + inclusive: check.inclusive, + exact: false, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "multipleOf") { + if (floatSafeRemainder(input.data, check.value) !== 0) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.not_multiple_of, + multipleOf: check.value, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "finite") { + if (!Number.isFinite(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.not_finite, + message: check.message, + }); + status.dirty(); + } + } + else { + util.assertNever(check); + } + } + return { status: status.value, value: input.data }; + } + gte(value, message) { + return this.setLimit("min", value, true, errorUtil.toString(message)); + } + gt(value, message) { + return this.setLimit("min", value, false, errorUtil.toString(message)); + } + lte(value, message) { + return this.setLimit("max", value, true, errorUtil.toString(message)); + } + lt(value, message) { + return this.setLimit("max", value, false, errorUtil.toString(message)); + } + setLimit(kind, value, inclusive, message) { + return new ZodNumber({ + ...this._def, + checks: [ + ...this._def.checks, + { + kind, + value, + inclusive, + message: errorUtil.toString(message), + }, + ], + }); + } + _addCheck(check) { + return new ZodNumber({ + ...this._def, + checks: [...this._def.checks, check], + }); + } + int(message) { + return this._addCheck({ + kind: "int", + message: errorUtil.toString(message), + }); + } + positive(message) { + return this._addCheck({ + kind: "min", + value: 0, + inclusive: false, + message: errorUtil.toString(message), + }); + } + negative(message) { + return this._addCheck({ + kind: "max", + value: 0, + inclusive: false, + message: errorUtil.toString(message), + }); + } + nonpositive(message) { + return this._addCheck({ + kind: "max", + value: 0, + inclusive: true, + message: errorUtil.toString(message), + }); + } + nonnegative(message) { + return this._addCheck({ + kind: "min", + value: 0, + inclusive: true, + message: errorUtil.toString(message), + }); + } + multipleOf(value, message) { + return this._addCheck({ + kind: "multipleOf", + value: value, + message: errorUtil.toString(message), + }); + } + finite(message) { + return this._addCheck({ + kind: "finite", + message: errorUtil.toString(message), + }); + } + safe(message) { + return this._addCheck({ + kind: "min", + inclusive: true, + value: Number.MIN_SAFE_INTEGER, + message: errorUtil.toString(message), + })._addCheck({ + kind: "max", + inclusive: true, + value: Number.MAX_SAFE_INTEGER, + message: errorUtil.toString(message), + }); + } + get minValue() { + let min = null; + for (const ch of this._def.checks) { + if (ch.kind === "min") { + if (min === null || ch.value > min) + min = ch.value; + } + } + return min; + } + get maxValue() { + let max = null; + for (const ch of this._def.checks) { + if (ch.kind === "max") { + if (max === null || ch.value < max) + max = ch.value; + } + } + return max; + } + get isInt() { + return !!this._def.checks.find((ch) => ch.kind === "int" || + (ch.kind === "multipleOf" && util.isInteger(ch.value))); + } + get isFinite() { + let max = null, min = null; + for (const ch of this._def.checks) { + if (ch.kind === "finite" || + ch.kind === "int" || + ch.kind === "multipleOf") { + return true; + } + else if (ch.kind === "min") { + if (min === null || ch.value > min) + min = ch.value; + } + else if (ch.kind === "max") { + if (max === null || ch.value < max) + max = ch.value; + } + } + return Number.isFinite(min) && Number.isFinite(max); + } +} +ZodNumber.create = (params) => { + return new ZodNumber({ + checks: [], + typeName: ZodFirstPartyTypeKind.ZodNumber, + coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false, + ...processCreateParams(params), + }); +}; +class ZodBigInt extends ZodType { + constructor() { + super(...arguments); + this.min = this.gte; + this.max = this.lte; + } + _parse(input) { + if (this._def.coerce) { + input.data = BigInt(input.data); + } + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.bigint) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.bigint, + received: ctx.parsedType, + }); + return INVALID; + } + let ctx = undefined; + const status = new ParseStatus(); + for (const check of this._def.checks) { + if (check.kind === "min") { + const tooSmall = check.inclusive + ? input.data < check.value + : input.data <= check.value; + if (tooSmall) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.too_small, + type: "bigint", + minimum: check.value, + inclusive: check.inclusive, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "max") { + const tooBig = check.inclusive + ? input.data > check.value + : input.data >= check.value; + if (tooBig) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.too_big, + type: "bigint", + maximum: check.value, + inclusive: check.inclusive, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "multipleOf") { + if (input.data % check.value !== BigInt(0)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.not_multiple_of, + multipleOf: check.value, + message: check.message, + }); + status.dirty(); + } + } + else { + util.assertNever(check); + } + } + return { status: status.value, value: input.data }; + } + gte(value, message) { + return this.setLimit("min", value, true, errorUtil.toString(message)); + } + gt(value, message) { + return this.setLimit("min", value, false, errorUtil.toString(message)); + } + lte(value, message) { + return this.setLimit("max", value, true, errorUtil.toString(message)); + } + lt(value, message) { + return this.setLimit("max", value, false, errorUtil.toString(message)); + } + setLimit(kind, value, inclusive, message) { + return new ZodBigInt({ + ...this._def, + checks: [ + ...this._def.checks, + { + kind, + value, + inclusive, + message: errorUtil.toString(message), + }, + ], + }); + } + _addCheck(check) { + return new ZodBigInt({ + ...this._def, + checks: [...this._def.checks, check], + }); + } + positive(message) { + return this._addCheck({ + kind: "min", + value: BigInt(0), + inclusive: false, + message: errorUtil.toString(message), + }); + } + negative(message) { + return this._addCheck({ + kind: "max", + value: BigInt(0), + inclusive: false, + message: errorUtil.toString(message), + }); + } + nonpositive(message) { + return this._addCheck({ + kind: "max", + value: BigInt(0), + inclusive: true, + message: errorUtil.toString(message), + }); + } + nonnegative(message) { + return this._addCheck({ + kind: "min", + value: BigInt(0), + inclusive: true, + message: errorUtil.toString(message), + }); + } + multipleOf(value, message) { + return this._addCheck({ + kind: "multipleOf", + value, + message: errorUtil.toString(message), + }); + } + get minValue() { + let min = null; + for (const ch of this._def.checks) { + if (ch.kind === "min") { + if (min === null || ch.value > min) + min = ch.value; + } + } + return min; + } + get maxValue() { + let max = null; + for (const ch of this._def.checks) { + if (ch.kind === "max") { + if (max === null || ch.value < max) + max = ch.value; + } + } + return max; + } +} +ZodBigInt.create = (params) => { + var _a; + return new ZodBigInt({ + checks: [], + typeName: ZodFirstPartyTypeKind.ZodBigInt, + coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false, + ...processCreateParams(params), + }); +}; +class ZodBoolean extends ZodType { + _parse(input) { + if (this._def.coerce) { + input.data = Boolean(input.data); + } + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.boolean) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.boolean, + received: ctx.parsedType, + }); + return INVALID; + } + return OK(input.data); + } +} +ZodBoolean.create = (params) => { + return new ZodBoolean({ + typeName: ZodFirstPartyTypeKind.ZodBoolean, + coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false, + ...processCreateParams(params), + }); +}; +class ZodDate extends ZodType { + _parse(input) { + if (this._def.coerce) { + input.data = new Date(input.data); + } + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.date) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.date, + received: ctx.parsedType, + }); + return INVALID; + } + if (isNaN(input.data.getTime())) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_date, + }); + return INVALID; + } + const status = new ParseStatus(); + let ctx = undefined; + for (const check of this._def.checks) { + if (check.kind === "min") { + if (input.data.getTime() < check.value) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.too_small, + message: check.message, + inclusive: true, + exact: false, + minimum: check.value, + type: "date", + }); + status.dirty(); + } + } + else if (check.kind === "max") { + if (input.data.getTime() > check.value) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.too_big, + message: check.message, + inclusive: true, + exact: false, + maximum: check.value, + type: "date", + }); + status.dirty(); + } + } + else { + util.assertNever(check); + } + } + return { + status: status.value, + value: new Date(input.data.getTime()), + }; + } + _addCheck(check) { + return new ZodDate({ + ...this._def, + checks: [...this._def.checks, check], + }); + } + min(minDate, message) { + return this._addCheck({ + kind: "min", + value: minDate.getTime(), + message: errorUtil.toString(message), + }); + } + max(maxDate, message) { + return this._addCheck({ + kind: "max", + value: maxDate.getTime(), + message: errorUtil.toString(message), + }); + } + get minDate() { + let min = null; + for (const ch of this._def.checks) { + if (ch.kind === "min") { + if (min === null || ch.value > min) + min = ch.value; + } + } + return min != null ? new Date(min) : null; + } + get maxDate() { + let max = null; + for (const ch of this._def.checks) { + if (ch.kind === "max") { + if (max === null || ch.value < max) + max = ch.value; + } + } + return max != null ? new Date(max) : null; + } +} +ZodDate.create = (params) => { + return new ZodDate({ + checks: [], + coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false, + typeName: ZodFirstPartyTypeKind.ZodDate, + ...processCreateParams(params), + }); +}; +class ZodSymbol extends ZodType { + _parse(input) { + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.symbol) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.symbol, + received: ctx.parsedType, + }); + return INVALID; + } + return OK(input.data); + } +} +ZodSymbol.create = (params) => { + return new ZodSymbol({ + typeName: ZodFirstPartyTypeKind.ZodSymbol, + ...processCreateParams(params), + }); +}; +class ZodUndefined extends ZodType { + _parse(input) { + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.undefined) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.undefined, + received: ctx.parsedType, + }); + return INVALID; + } + return OK(input.data); + } +} +ZodUndefined.create = (params) => { + return new ZodUndefined({ + typeName: ZodFirstPartyTypeKind.ZodUndefined, + ...processCreateParams(params), + }); +}; +class ZodNull extends ZodType { + _parse(input) { + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.null) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.null, + received: ctx.parsedType, + }); + return INVALID; + } + return OK(input.data); + } +} +ZodNull.create = (params) => { + return new ZodNull({ + typeName: ZodFirstPartyTypeKind.ZodNull, + ...processCreateParams(params), + }); +}; +class ZodAny extends ZodType { + constructor() { + super(...arguments); + // to prevent instances of other classes from extending ZodAny. this causes issues with catchall in ZodObject. + this._any = true; + } + _parse(input) { + return OK(input.data); + } +} +ZodAny.create = (params) => { + return new ZodAny({ + typeName: ZodFirstPartyTypeKind.ZodAny, + ...processCreateParams(params), + }); +}; +class ZodUnknown extends ZodType { + constructor() { + super(...arguments); + // required + this._unknown = true; + } + _parse(input) { + return OK(input.data); + } +} +ZodUnknown.create = (params) => { + return new ZodUnknown({ + typeName: ZodFirstPartyTypeKind.ZodUnknown, + ...processCreateParams(params), + }); +}; +class ZodNever extends ZodType { + _parse(input) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.never, + received: ctx.parsedType, + }); + return INVALID; + } +} +ZodNever.create = (params) => { + return new ZodNever({ + typeName: ZodFirstPartyTypeKind.ZodNever, + ...processCreateParams(params), + }); +}; +class ZodVoid extends ZodType { + _parse(input) { + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.undefined) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.void, + received: ctx.parsedType, + }); + return INVALID; + } + return OK(input.data); + } +} +ZodVoid.create = (params) => { + return new ZodVoid({ + typeName: ZodFirstPartyTypeKind.ZodVoid, + ...processCreateParams(params), + }); +}; +class ZodArray extends ZodType { + _parse(input) { + const { ctx, status } = this._processInputParams(input); + const def = this._def; + if (ctx.parsedType !== ZodParsedType.array) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.array, + received: ctx.parsedType, + }); + return INVALID; + } + if (def.exactLength !== null) { + const tooBig = ctx.data.length > def.exactLength.value; + const tooSmall = ctx.data.length < def.exactLength.value; + if (tooBig || tooSmall) { + addIssueToContext(ctx, { + code: tooBig ? ZodIssueCode.too_big : ZodIssueCode.too_small, + minimum: (tooSmall ? def.exactLength.value : undefined), + maximum: (tooBig ? def.exactLength.value : undefined), + type: "array", + inclusive: true, + exact: true, + message: def.exactLength.message, + }); + status.dirty(); + } + } + if (def.minLength !== null) { + if (ctx.data.length < def.minLength.value) { + addIssueToContext(ctx, { + code: ZodIssueCode.too_small, + minimum: def.minLength.value, + type: "array", + inclusive: true, + exact: false, + message: def.minLength.message, + }); + status.dirty(); + } + } + if (def.maxLength !== null) { + if (ctx.data.length > def.maxLength.value) { + addIssueToContext(ctx, { + code: ZodIssueCode.too_big, + maximum: def.maxLength.value, + type: "array", + inclusive: true, + exact: false, + message: def.maxLength.message, + }); + status.dirty(); + } + } + if (ctx.common.async) { + return Promise.all([...ctx.data].map((item, i) => { + return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i)); + })).then((result) => { + return ParseStatus.mergeArray(status, result); + }); + } + const result = [...ctx.data].map((item, i) => { + return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i)); + }); + return ParseStatus.mergeArray(status, result); + } + get element() { + return this._def.type; + } + min(minLength, message) { + return new ZodArray({ + ...this._def, + minLength: { value: minLength, message: errorUtil.toString(message) }, + }); + } + max(maxLength, message) { + return new ZodArray({ + ...this._def, + maxLength: { value: maxLength, message: errorUtil.toString(message) }, + }); + } + length(len, message) { + return new ZodArray({ + ...this._def, + exactLength: { value: len, message: errorUtil.toString(message) }, + }); + } + nonempty(message) { + return this.min(1, message); + } +} +ZodArray.create = (schema, params) => { + return new ZodArray({ + type: schema, + minLength: null, + maxLength: null, + exactLength: null, + typeName: ZodFirstPartyTypeKind.ZodArray, + ...processCreateParams(params), + }); +}; +function deepPartialify(schema) { + if (schema instanceof ZodObject) { + const newShape = {}; + for (const key in schema.shape) { + const fieldSchema = schema.shape[key]; + newShape[key] = ZodOptional.create(deepPartialify(fieldSchema)); + } + return new ZodObject({ + ...schema._def, + shape: () => newShape, + }); + } + else if (schema instanceof ZodArray) { + return new ZodArray({ + ...schema._def, + type: deepPartialify(schema.element), + }); + } + else if (schema instanceof ZodOptional) { + return ZodOptional.create(deepPartialify(schema.unwrap())); + } + else if (schema instanceof ZodNullable) { + return ZodNullable.create(deepPartialify(schema.unwrap())); + } + else if (schema instanceof ZodTuple) { + return ZodTuple.create(schema.items.map((item) => deepPartialify(item))); + } + else { + return schema; + } +} +class ZodObject extends ZodType { + constructor() { + super(...arguments); + this._cached = null; + /** + * @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped. + * If you want to pass through unknown properties, use `.passthrough()` instead. + */ + this.nonstrict = this.passthrough; + // extend< + // Augmentation extends ZodRawShape, + // NewOutput extends util.flatten<{ + // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation + // ? Augmentation[k]["_output"] + // : k extends keyof Output + // ? Output[k] + // : never; + // }>, + // NewInput extends util.flatten<{ + // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation + // ? Augmentation[k]["_input"] + // : k extends keyof Input + // ? Input[k] + // : never; + // }> + // >( + // augmentation: Augmentation + // ): ZodObject< + // extendShape, + // UnknownKeys, + // Catchall, + // NewOutput, + // NewInput + // > { + // return new ZodObject({ + // ...this._def, + // shape: () => ({ + // ...this._def.shape(), + // ...augmentation, + // }), + // }) as any; + // } + /** + * @deprecated Use `.extend` instead + * */ + this.augment = this.extend; + } + _getCached() { + if (this._cached !== null) + return this._cached; + const shape = this._def.shape(); + const keys = util.objectKeys(shape); + return (this._cached = { shape, keys }); + } + _parse(input) { + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.object) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.object, + received: ctx.parsedType, + }); + return INVALID; + } + const { status, ctx } = this._processInputParams(input); + const { shape, keys: shapeKeys } = this._getCached(); + const extraKeys = []; + if (!(this._def.catchall instanceof ZodNever && + this._def.unknownKeys === "strip")) { + for (const key in ctx.data) { + if (!shapeKeys.includes(key)) { + extraKeys.push(key); + } + } + } + const pairs = []; + for (const key of shapeKeys) { + const keyValidator = shape[key]; + const value = ctx.data[key]; + pairs.push({ + key: { status: "valid", value: key }, + value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)), + alwaysSet: key in ctx.data, + }); + } + if (this._def.catchall instanceof ZodNever) { + const unknownKeys = this._def.unknownKeys; + if (unknownKeys === "passthrough") { + for (const key of extraKeys) { + pairs.push({ + key: { status: "valid", value: key }, + value: { status: "valid", value: ctx.data[key] }, + }); + } + } + else if (unknownKeys === "strict") { + if (extraKeys.length > 0) { + addIssueToContext(ctx, { + code: ZodIssueCode.unrecognized_keys, + keys: extraKeys, + }); + status.dirty(); + } + } + else if (unknownKeys === "strip") ; + else { + throw new Error(`Internal ZodObject error: invalid unknownKeys value.`); + } + } + else { + // run catchall validation + const catchall = this._def.catchall; + for (const key of extraKeys) { + const value = ctx.data[key]; + pairs.push({ + key: { status: "valid", value: key }, + value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key) //, ctx.child(key), value, getParsedType(value) + ), + alwaysSet: key in ctx.data, + }); + } + } + if (ctx.common.async) { + return Promise.resolve() + .then(async () => { + const syncPairs = []; + for (const pair of pairs) { + const key = await pair.key; + const value = await pair.value; + syncPairs.push({ + key, + value, + alwaysSet: pair.alwaysSet, + }); + } + return syncPairs; + }) + .then((syncPairs) => { + return ParseStatus.mergeObjectSync(status, syncPairs); + }); + } + else { + return ParseStatus.mergeObjectSync(status, pairs); + } + } + get shape() { + return this._def.shape(); + } + strict(message) { + errorUtil.errToObj; + return new ZodObject({ + ...this._def, + unknownKeys: "strict", + ...(message !== undefined + ? { + errorMap: (issue, ctx) => { + var _a, _b, _c, _d; + const defaultError = (_c = (_b = (_a = this._def).errorMap) === null || _b === void 0 ? void 0 : _b.call(_a, issue, ctx).message) !== null && _c !== void 0 ? _c : ctx.defaultError; + if (issue.code === "unrecognized_keys") + return { + message: (_d = errorUtil.errToObj(message).message) !== null && _d !== void 0 ? _d : defaultError, + }; + return { + message: defaultError, + }; + }, + } + : {}), + }); + } + strip() { + return new ZodObject({ + ...this._def, + unknownKeys: "strip", + }); + } + passthrough() { + return new ZodObject({ + ...this._def, + unknownKeys: "passthrough", + }); + } + // const AugmentFactory = + // (def: Def) => + // ( + // augmentation: Augmentation + // ): ZodObject< + // extendShape, Augmentation>, + // Def["unknownKeys"], + // Def["catchall"] + // > => { + // return new ZodObject({ + // ...def, + // shape: () => ({ + // ...def.shape(), + // ...augmentation, + // }), + // }) as any; + // }; + extend(augmentation) { + return new ZodObject({ + ...this._def, + shape: () => ({ + ...this._def.shape(), + ...augmentation, + }), + }); + } + /** + * Prior to zod@1.0.12 there was a bug in the + * inferred type of merged objects. Please + * upgrade if you are experiencing issues. + */ + merge(merging) { + const merged = new ZodObject({ + unknownKeys: merging._def.unknownKeys, + catchall: merging._def.catchall, + shape: () => ({ + ...this._def.shape(), + ...merging._def.shape(), + }), + typeName: ZodFirstPartyTypeKind.ZodObject, + }); + return merged; + } + // merge< + // Incoming extends AnyZodObject, + // Augmentation extends Incoming["shape"], + // NewOutput extends { + // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation + // ? Augmentation[k]["_output"] + // : k extends keyof Output + // ? Output[k] + // : never; + // }, + // NewInput extends { + // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation + // ? Augmentation[k]["_input"] + // : k extends keyof Input + // ? Input[k] + // : never; + // } + // >( + // merging: Incoming + // ): ZodObject< + // extendShape>, + // Incoming["_def"]["unknownKeys"], + // Incoming["_def"]["catchall"], + // NewOutput, + // NewInput + // > { + // const merged: any = new ZodObject({ + // unknownKeys: merging._def.unknownKeys, + // catchall: merging._def.catchall, + // shape: () => + // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()), + // typeName: ZodFirstPartyTypeKind.ZodObject, + // }) as any; + // return merged; + // } + setKey(key, schema) { + return this.augment({ [key]: schema }); + } + // merge( + // merging: Incoming + // ): //ZodObject = (merging) => { + // ZodObject< + // extendShape>, + // Incoming["_def"]["unknownKeys"], + // Incoming["_def"]["catchall"] + // > { + // // const mergedShape = objectUtil.mergeShapes( + // // this._def.shape(), + // // merging._def.shape() + // // ); + // const merged: any = new ZodObject({ + // unknownKeys: merging._def.unknownKeys, + // catchall: merging._def.catchall, + // shape: () => + // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()), + // typeName: ZodFirstPartyTypeKind.ZodObject, + // }) as any; + // return merged; + // } + catchall(index) { + return new ZodObject({ + ...this._def, + catchall: index, + }); + } + pick(mask) { + const shape = {}; + util.objectKeys(mask).forEach((key) => { + if (mask[key] && this.shape[key]) { + shape[key] = this.shape[key]; + } + }); + return new ZodObject({ + ...this._def, + shape: () => shape, + }); + } + omit(mask) { + const shape = {}; + util.objectKeys(this.shape).forEach((key) => { + if (!mask[key]) { + shape[key] = this.shape[key]; + } + }); + return new ZodObject({ + ...this._def, + shape: () => shape, + }); + } + /** + * @deprecated + */ + deepPartial() { + return deepPartialify(this); + } + partial(mask) { + const newShape = {}; + util.objectKeys(this.shape).forEach((key) => { + const fieldSchema = this.shape[key]; + if (mask && !mask[key]) { + newShape[key] = fieldSchema; + } + else { + newShape[key] = fieldSchema.optional(); + } + }); + return new ZodObject({ + ...this._def, + shape: () => newShape, + }); + } + required(mask) { + const newShape = {}; + util.objectKeys(this.shape).forEach((key) => { + if (mask && !mask[key]) { + newShape[key] = this.shape[key]; + } + else { + const fieldSchema = this.shape[key]; + let newField = fieldSchema; + while (newField instanceof ZodOptional) { + newField = newField._def.innerType; + } + newShape[key] = newField; + } + }); + return new ZodObject({ + ...this._def, + shape: () => newShape, + }); + } + keyof() { + return createZodEnum(util.objectKeys(this.shape)); + } +} +ZodObject.create = (shape, params) => { + return new ZodObject({ + shape: () => shape, + unknownKeys: "strip", + catchall: ZodNever.create(), + typeName: ZodFirstPartyTypeKind.ZodObject, + ...processCreateParams(params), + }); +}; +ZodObject.strictCreate = (shape, params) => { + return new ZodObject({ + shape: () => shape, + unknownKeys: "strict", + catchall: ZodNever.create(), + typeName: ZodFirstPartyTypeKind.ZodObject, + ...processCreateParams(params), + }); +}; +ZodObject.lazycreate = (shape, params) => { + return new ZodObject({ + shape, + unknownKeys: "strip", + catchall: ZodNever.create(), + typeName: ZodFirstPartyTypeKind.ZodObject, + ...processCreateParams(params), + }); +}; +class ZodUnion extends ZodType { + _parse(input) { + const { ctx } = this._processInputParams(input); + const options = this._def.options; + function handleResults(results) { + // return first issue-free validation if it exists + for (const result of results) { + if (result.result.status === "valid") { + return result.result; + } + } + for (const result of results) { + if (result.result.status === "dirty") { + // add issues from dirty option + ctx.common.issues.push(...result.ctx.common.issues); + return result.result; + } + } + // return invalid + const unionErrors = results.map((result) => new ZodError(result.ctx.common.issues)); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_union, + unionErrors, + }); + return INVALID; + } + if (ctx.common.async) { + return Promise.all(options.map(async (option) => { + const childCtx = { + ...ctx, + common: { + ...ctx.common, + issues: [], + }, + parent: null, + }; + return { + result: await option._parseAsync({ + data: ctx.data, + path: ctx.path, + parent: childCtx, + }), + ctx: childCtx, + }; + })).then(handleResults); + } + else { + let dirty = undefined; + const issues = []; + for (const option of options) { + const childCtx = { + ...ctx, + common: { + ...ctx.common, + issues: [], + }, + parent: null, + }; + const result = option._parseSync({ + data: ctx.data, + path: ctx.path, + parent: childCtx, + }); + if (result.status === "valid") { + return result; + } + else if (result.status === "dirty" && !dirty) { + dirty = { result, ctx: childCtx }; + } + if (childCtx.common.issues.length) { + issues.push(childCtx.common.issues); + } + } + if (dirty) { + ctx.common.issues.push(...dirty.ctx.common.issues); + return dirty.result; + } + const unionErrors = issues.map((issues) => new ZodError(issues)); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_union, + unionErrors, + }); + return INVALID; + } + } + get options() { + return this._def.options; + } +} +ZodUnion.create = (types, params) => { + return new ZodUnion({ + options: types, + typeName: ZodFirstPartyTypeKind.ZodUnion, + ...processCreateParams(params), + }); +}; +///////////////////////////////////////////////////// +///////////////////////////////////////////////////// +////////// ////////// +////////// ZodDiscriminatedUnion ////////// +////////// ////////// +///////////////////////////////////////////////////// +///////////////////////////////////////////////////// +const getDiscriminator = (type) => { + if (type instanceof ZodLazy) { + return getDiscriminator(type.schema); + } + else if (type instanceof ZodEffects) { + return getDiscriminator(type.innerType()); + } + else if (type instanceof ZodLiteral) { + return [type.value]; + } + else if (type instanceof ZodEnum) { + return type.options; + } + else if (type instanceof ZodNativeEnum) { + // eslint-disable-next-line ban/ban + return util.objectValues(type.enum); + } + else if (type instanceof ZodDefault) { + return getDiscriminator(type._def.innerType); + } + else if (type instanceof ZodUndefined) { + return [undefined]; + } + else if (type instanceof ZodNull) { + return [null]; + } + else if (type instanceof ZodOptional) { + return [undefined, ...getDiscriminator(type.unwrap())]; + } + else if (type instanceof ZodNullable) { + return [null, ...getDiscriminator(type.unwrap())]; + } + else if (type instanceof ZodBranded) { + return getDiscriminator(type.unwrap()); + } + else if (type instanceof ZodReadonly) { + return getDiscriminator(type.unwrap()); + } + else if (type instanceof ZodCatch) { + return getDiscriminator(type._def.innerType); + } + else { + return []; + } +}; +class ZodDiscriminatedUnion extends ZodType { + _parse(input) { + const { ctx } = this._processInputParams(input); + if (ctx.parsedType !== ZodParsedType.object) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.object, + received: ctx.parsedType, + }); + return INVALID; + } + const discriminator = this.discriminator; + const discriminatorValue = ctx.data[discriminator]; + const option = this.optionsMap.get(discriminatorValue); + if (!option) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_union_discriminator, + options: Array.from(this.optionsMap.keys()), + path: [discriminator], + }); + return INVALID; + } + if (ctx.common.async) { + return option._parseAsync({ + data: ctx.data, + path: ctx.path, + parent: ctx, + }); + } + else { + return option._parseSync({ + data: ctx.data, + path: ctx.path, + parent: ctx, + }); + } + } + get discriminator() { + return this._def.discriminator; + } + get options() { + return this._def.options; + } + get optionsMap() { + return this._def.optionsMap; + } + /** + * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor. + * However, it only allows a union of objects, all of which need to share a discriminator property. This property must + * have a different value for each object in the union. + * @param discriminator the name of the discriminator property + * @param types an array of object schemas + * @param params + */ + static create(discriminator, options, params) { + // Get all the valid discriminator values + const optionsMap = new Map(); + // try { + for (const type of options) { + const discriminatorValues = getDiscriminator(type.shape[discriminator]); + if (!discriminatorValues.length) { + throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`); + } + for (const value of discriminatorValues) { + if (optionsMap.has(value)) { + throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`); + } + optionsMap.set(value, type); + } + } + return new ZodDiscriminatedUnion({ + typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion, + discriminator, + options, + optionsMap, + ...processCreateParams(params), + }); + } +} +function mergeValues(a, b) { + const aType = getParsedType(a); + const bType = getParsedType(b); + if (a === b) { + return { valid: true, data: a }; + } + else if (aType === ZodParsedType.object && bType === ZodParsedType.object) { + const bKeys = util.objectKeys(b); + const sharedKeys = util + .objectKeys(a) + .filter((key) => bKeys.indexOf(key) !== -1); + const newObj = { ...a, ...b }; + for (const key of sharedKeys) { + const sharedValue = mergeValues(a[key], b[key]); + if (!sharedValue.valid) { + return { valid: false }; + } + newObj[key] = sharedValue.data; + } + return { valid: true, data: newObj }; + } + else if (aType === ZodParsedType.array && bType === ZodParsedType.array) { + if (a.length !== b.length) { + return { valid: false }; + } + const newArray = []; + for (let index = 0; index < a.length; index++) { + const itemA = a[index]; + const itemB = b[index]; + const sharedValue = mergeValues(itemA, itemB); + if (!sharedValue.valid) { + return { valid: false }; + } + newArray.push(sharedValue.data); + } + return { valid: true, data: newArray }; + } + else if (aType === ZodParsedType.date && + bType === ZodParsedType.date && + +a === +b) { + return { valid: true, data: a }; + } + else { + return { valid: false }; + } +} +class ZodIntersection extends ZodType { + _parse(input) { + const { status, ctx } = this._processInputParams(input); + const handleParsed = (parsedLeft, parsedRight) => { + if (isAborted(parsedLeft) || isAborted(parsedRight)) { + return INVALID; + } + const merged = mergeValues(parsedLeft.value, parsedRight.value); + if (!merged.valid) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_intersection_types, + }); + return INVALID; + } + if (isDirty(parsedLeft) || isDirty(parsedRight)) { + status.dirty(); + } + return { status: status.value, value: merged.data }; + }; + if (ctx.common.async) { + return Promise.all([ + this._def.left._parseAsync({ + data: ctx.data, + path: ctx.path, + parent: ctx, + }), + this._def.right._parseAsync({ + data: ctx.data, + path: ctx.path, + parent: ctx, + }), + ]).then(([left, right]) => handleParsed(left, right)); + } + else { + return handleParsed(this._def.left._parseSync({ + data: ctx.data, + path: ctx.path, + parent: ctx, + }), this._def.right._parseSync({ + data: ctx.data, + path: ctx.path, + parent: ctx, + })); + } + } +} +ZodIntersection.create = (left, right, params) => { + return new ZodIntersection({ + left: left, + right: right, + typeName: ZodFirstPartyTypeKind.ZodIntersection, + ...processCreateParams(params), + }); +}; +class ZodTuple extends ZodType { + _parse(input) { + const { status, ctx } = this._processInputParams(input); + if (ctx.parsedType !== ZodParsedType.array) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.array, + received: ctx.parsedType, + }); + return INVALID; + } + if (ctx.data.length < this._def.items.length) { + addIssueToContext(ctx, { + code: ZodIssueCode.too_small, + minimum: this._def.items.length, + inclusive: true, + exact: false, + type: "array", + }); + return INVALID; + } + const rest = this._def.rest; + if (!rest && ctx.data.length > this._def.items.length) { + addIssueToContext(ctx, { + code: ZodIssueCode.too_big, + maximum: this._def.items.length, + inclusive: true, + exact: false, + type: "array", + }); + status.dirty(); + } + const items = [...ctx.data] + .map((item, itemIndex) => { + const schema = this._def.items[itemIndex] || this._def.rest; + if (!schema) + return null; + return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex)); + }) + .filter((x) => !!x); // filter nulls + if (ctx.common.async) { + return Promise.all(items).then((results) => { + return ParseStatus.mergeArray(status, results); + }); + } + else { + return ParseStatus.mergeArray(status, items); + } + } + get items() { + return this._def.items; + } + rest(rest) { + return new ZodTuple({ + ...this._def, + rest, + }); + } +} +ZodTuple.create = (schemas, params) => { + if (!Array.isArray(schemas)) { + throw new Error("You must pass an array of schemas to z.tuple([ ... ])"); + } + return new ZodTuple({ + items: schemas, + typeName: ZodFirstPartyTypeKind.ZodTuple, + rest: null, + ...processCreateParams(params), + }); +}; +class ZodRecord extends ZodType { + get keySchema() { + return this._def.keyType; + } + get valueSchema() { + return this._def.valueType; + } + _parse(input) { + const { status, ctx } = this._processInputParams(input); + if (ctx.parsedType !== ZodParsedType.object) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.object, + received: ctx.parsedType, + }); + return INVALID; + } + const pairs = []; + const keyType = this._def.keyType; + const valueType = this._def.valueType; + for (const key in ctx.data) { + pairs.push({ + key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)), + value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)), + alwaysSet: key in ctx.data, + }); + } + if (ctx.common.async) { + return ParseStatus.mergeObjectAsync(status, pairs); + } + else { + return ParseStatus.mergeObjectSync(status, pairs); + } + } + get element() { + return this._def.valueType; + } + static create(first, second, third) { + if (second instanceof ZodType) { + return new ZodRecord({ + keyType: first, + valueType: second, + typeName: ZodFirstPartyTypeKind.ZodRecord, + ...processCreateParams(third), + }); + } + return new ZodRecord({ + keyType: ZodString.create(), + valueType: first, + typeName: ZodFirstPartyTypeKind.ZodRecord, + ...processCreateParams(second), + }); + } +} +class ZodMap extends ZodType { + get keySchema() { + return this._def.keyType; + } + get valueSchema() { + return this._def.valueType; + } + _parse(input) { + const { status, ctx } = this._processInputParams(input); + if (ctx.parsedType !== ZodParsedType.map) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.map, + received: ctx.parsedType, + }); + return INVALID; + } + const keyType = this._def.keyType; + const valueType = this._def.valueType; + const pairs = [...ctx.data.entries()].map(([key, value], index) => { + return { + key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index, "key"])), + value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, "value"])), + }; + }); + if (ctx.common.async) { + const finalMap = new Map(); + return Promise.resolve().then(async () => { + for (const pair of pairs) { + const key = await pair.key; + const value = await pair.value; + if (key.status === "aborted" || value.status === "aborted") { + return INVALID; + } + if (key.status === "dirty" || value.status === "dirty") { + status.dirty(); + } + finalMap.set(key.value, value.value); + } + return { status: status.value, value: finalMap }; + }); + } + else { + const finalMap = new Map(); + for (const pair of pairs) { + const key = pair.key; + const value = pair.value; + if (key.status === "aborted" || value.status === "aborted") { + return INVALID; + } + if (key.status === "dirty" || value.status === "dirty") { + status.dirty(); + } + finalMap.set(key.value, value.value); + } + return { status: status.value, value: finalMap }; + } + } +} +ZodMap.create = (keyType, valueType, params) => { + return new ZodMap({ + valueType, + keyType, + typeName: ZodFirstPartyTypeKind.ZodMap, + ...processCreateParams(params), + }); +}; +class ZodSet extends ZodType { + _parse(input) { + const { status, ctx } = this._processInputParams(input); + if (ctx.parsedType !== ZodParsedType.set) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.set, + received: ctx.parsedType, + }); + return INVALID; + } + const def = this._def; + if (def.minSize !== null) { + if (ctx.data.size < def.minSize.value) { + addIssueToContext(ctx, { + code: ZodIssueCode.too_small, + minimum: def.minSize.value, + type: "set", + inclusive: true, + exact: false, + message: def.minSize.message, + }); + status.dirty(); + } + } + if (def.maxSize !== null) { + if (ctx.data.size > def.maxSize.value) { + addIssueToContext(ctx, { + code: ZodIssueCode.too_big, + maximum: def.maxSize.value, + type: "set", + inclusive: true, + exact: false, + message: def.maxSize.message, + }); + status.dirty(); + } + } + const valueType = this._def.valueType; + function finalizeSet(elements) { + const parsedSet = new Set(); + for (const element of elements) { + if (element.status === "aborted") + return INVALID; + if (element.status === "dirty") + status.dirty(); + parsedSet.add(element.value); + } + return { status: status.value, value: parsedSet }; + } + const elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i))); + if (ctx.common.async) { + return Promise.all(elements).then((elements) => finalizeSet(elements)); + } + else { + return finalizeSet(elements); + } + } + min(minSize, message) { + return new ZodSet({ + ...this._def, + minSize: { value: minSize, message: errorUtil.toString(message) }, + }); + } + max(maxSize, message) { + return new ZodSet({ + ...this._def, + maxSize: { value: maxSize, message: errorUtil.toString(message) }, + }); + } + size(size, message) { + return this.min(size, message).max(size, message); + } + nonempty(message) { + return this.min(1, message); + } +} +ZodSet.create = (valueType, params) => { + return new ZodSet({ + valueType, + minSize: null, + maxSize: null, + typeName: ZodFirstPartyTypeKind.ZodSet, + ...processCreateParams(params), + }); +}; +class ZodFunction extends ZodType { + constructor() { + super(...arguments); + this.validate = this.implement; + } + _parse(input) { + const { ctx } = this._processInputParams(input); + if (ctx.parsedType !== ZodParsedType.function) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.function, + received: ctx.parsedType, + }); + return INVALID; + } + function makeArgsIssue(args, error) { + return makeIssue({ + data: args, + path: ctx.path, + errorMaps: [ + ctx.common.contextualErrorMap, + ctx.schemaErrorMap, + getErrorMap(), + errorMap, + ].filter((x) => !!x), + issueData: { + code: ZodIssueCode.invalid_arguments, + argumentsError: error, + }, + }); + } + function makeReturnsIssue(returns, error) { + return makeIssue({ + data: returns, + path: ctx.path, + errorMaps: [ + ctx.common.contextualErrorMap, + ctx.schemaErrorMap, + getErrorMap(), + errorMap, + ].filter((x) => !!x), + issueData: { + code: ZodIssueCode.invalid_return_type, + returnTypeError: error, + }, + }); + } + const params = { errorMap: ctx.common.contextualErrorMap }; + const fn = ctx.data; + if (this._def.returns instanceof ZodPromise) { + // Would love a way to avoid disabling this rule, but we need + // an alias (using an arrow function was what caused 2651). + // eslint-disable-next-line @typescript-eslint/no-this-alias + const me = this; + return OK(async function (...args) { + const error = new ZodError([]); + const parsedArgs = await me._def.args + .parseAsync(args, params) + .catch((e) => { + error.addIssue(makeArgsIssue(args, e)); + throw error; + }); + const result = await Reflect.apply(fn, this, parsedArgs); + const parsedReturns = await me._def.returns._def.type + .parseAsync(result, params) + .catch((e) => { + error.addIssue(makeReturnsIssue(result, e)); + throw error; + }); + return parsedReturns; + }); + } + else { + // Would love a way to avoid disabling this rule, but we need + // an alias (using an arrow function was what caused 2651). + // eslint-disable-next-line @typescript-eslint/no-this-alias + const me = this; + return OK(function (...args) { + const parsedArgs = me._def.args.safeParse(args, params); + if (!parsedArgs.success) { + throw new ZodError([makeArgsIssue(args, parsedArgs.error)]); + } + const result = Reflect.apply(fn, this, parsedArgs.data); + const parsedReturns = me._def.returns.safeParse(result, params); + if (!parsedReturns.success) { + throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]); + } + return parsedReturns.data; + }); + } + } + parameters() { + return this._def.args; + } + returnType() { + return this._def.returns; + } + args(...items) { + return new ZodFunction({ + ...this._def, + args: ZodTuple.create(items).rest(ZodUnknown.create()), + }); + } + returns(returnType) { + return new ZodFunction({ + ...this._def, + returns: returnType, + }); + } + implement(func) { + const validatedFunc = this.parse(func); + return validatedFunc; + } + strictImplement(func) { + const validatedFunc = this.parse(func); + return validatedFunc; + } + static create(args, returns, params) { + return new ZodFunction({ + args: (args + ? args + : ZodTuple.create([]).rest(ZodUnknown.create())), + returns: returns || ZodUnknown.create(), + typeName: ZodFirstPartyTypeKind.ZodFunction, + ...processCreateParams(params), + }); + } +} +class ZodLazy extends ZodType { + get schema() { + return this._def.getter(); + } + _parse(input) { + const { ctx } = this._processInputParams(input); + const lazySchema = this._def.getter(); + return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx }); + } +} +ZodLazy.create = (getter, params) => { + return new ZodLazy({ + getter: getter, + typeName: ZodFirstPartyTypeKind.ZodLazy, + ...processCreateParams(params), + }); +}; +class ZodLiteral extends ZodType { + _parse(input) { + if (input.data !== this._def.value) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + received: ctx.data, + code: ZodIssueCode.invalid_literal, + expected: this._def.value, + }); + return INVALID; + } + return { status: "valid", value: input.data }; + } + get value() { + return this._def.value; + } +} +ZodLiteral.create = (value, params) => { + return new ZodLiteral({ + value: value, + typeName: ZodFirstPartyTypeKind.ZodLiteral, + ...processCreateParams(params), + }); +}; +function createZodEnum(values, params) { + return new ZodEnum({ + values, + typeName: ZodFirstPartyTypeKind.ZodEnum, + ...processCreateParams(params), + }); +} +class ZodEnum extends ZodType { + constructor() { + super(...arguments); + _ZodEnum_cache.set(this, void 0); + } + _parse(input) { + if (typeof input.data !== "string") { + const ctx = this._getOrReturnCtx(input); + const expectedValues = this._def.values; + addIssueToContext(ctx, { + expected: util.joinValues(expectedValues), + received: ctx.parsedType, + code: ZodIssueCode.invalid_type, + }); + return INVALID; + } + if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f")) { + __classPrivateFieldSet(this, _ZodEnum_cache, new Set(this._def.values), "f"); + } + if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f").has(input.data)) { + const ctx = this._getOrReturnCtx(input); + const expectedValues = this._def.values; + addIssueToContext(ctx, { + received: ctx.data, + code: ZodIssueCode.invalid_enum_value, + options: expectedValues, + }); + return INVALID; + } + return OK(input.data); + } + get options() { + return this._def.values; + } + get enum() { + const enumValues = {}; + for (const val of this._def.values) { + enumValues[val] = val; + } + return enumValues; + } + get Values() { + const enumValues = {}; + for (const val of this._def.values) { + enumValues[val] = val; + } + return enumValues; + } + get Enum() { + const enumValues = {}; + for (const val of this._def.values) { + enumValues[val] = val; + } + return enumValues; + } + extract(values, newDef = this._def) { + return ZodEnum.create(values, { + ...this._def, + ...newDef, + }); + } + exclude(values, newDef = this._def) { + return ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), { + ...this._def, + ...newDef, + }); + } +} +_ZodEnum_cache = new WeakMap(); +ZodEnum.create = createZodEnum; +class ZodNativeEnum extends ZodType { + constructor() { + super(...arguments); + _ZodNativeEnum_cache.set(this, void 0); + } + _parse(input) { + const nativeEnumValues = util.getValidEnumValues(this._def.values); + const ctx = this._getOrReturnCtx(input); + if (ctx.parsedType !== ZodParsedType.string && + ctx.parsedType !== ZodParsedType.number) { + const expectedValues = util.objectValues(nativeEnumValues); + addIssueToContext(ctx, { + expected: util.joinValues(expectedValues), + received: ctx.parsedType, + code: ZodIssueCode.invalid_type, + }); + return INVALID; + } + if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f")) { + __classPrivateFieldSet(this, _ZodNativeEnum_cache, new Set(util.getValidEnumValues(this._def.values)), "f"); + } + if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f").has(input.data)) { + const expectedValues = util.objectValues(nativeEnumValues); + addIssueToContext(ctx, { + received: ctx.data, + code: ZodIssueCode.invalid_enum_value, + options: expectedValues, + }); + return INVALID; + } + return OK(input.data); + } + get enum() { + return this._def.values; + } +} +_ZodNativeEnum_cache = new WeakMap(); +ZodNativeEnum.create = (values, params) => { + return new ZodNativeEnum({ + values: values, + typeName: ZodFirstPartyTypeKind.ZodNativeEnum, + ...processCreateParams(params), + }); +}; +class ZodPromise extends ZodType { + unwrap() { + return this._def.type; + } + _parse(input) { + const { ctx } = this._processInputParams(input); + if (ctx.parsedType !== ZodParsedType.promise && + ctx.common.async === false) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.promise, + received: ctx.parsedType, + }); + return INVALID; + } + const promisified = ctx.parsedType === ZodParsedType.promise + ? ctx.data + : Promise.resolve(ctx.data); + return OK(promisified.then((data) => { + return this._def.type.parseAsync(data, { + path: ctx.path, + errorMap: ctx.common.contextualErrorMap, + }); + })); + } +} +ZodPromise.create = (schema, params) => { + return new ZodPromise({ + type: schema, + typeName: ZodFirstPartyTypeKind.ZodPromise, + ...processCreateParams(params), + }); +}; +class ZodEffects extends ZodType { + innerType() { + return this._def.schema; + } + sourceType() { + return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects + ? this._def.schema.sourceType() + : this._def.schema; + } + _parse(input) { + const { status, ctx } = this._processInputParams(input); + const effect = this._def.effect || null; + const checkCtx = { + addIssue: (arg) => { + addIssueToContext(ctx, arg); + if (arg.fatal) { + status.abort(); + } + else { + status.dirty(); + } + }, + get path() { + return ctx.path; + }, + }; + checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx); + if (effect.type === "preprocess") { + const processed = effect.transform(ctx.data, checkCtx); + if (ctx.common.async) { + return Promise.resolve(processed).then(async (processed) => { + if (status.value === "aborted") + return INVALID; + const result = await this._def.schema._parseAsync({ + data: processed, + path: ctx.path, + parent: ctx, + }); + if (result.status === "aborted") + return INVALID; + if (result.status === "dirty") + return DIRTY(result.value); + if (status.value === "dirty") + return DIRTY(result.value); + return result; + }); + } + else { + if (status.value === "aborted") + return INVALID; + const result = this._def.schema._parseSync({ + data: processed, + path: ctx.path, + parent: ctx, + }); + if (result.status === "aborted") + return INVALID; + if (result.status === "dirty") + return DIRTY(result.value); + if (status.value === "dirty") + return DIRTY(result.value); + return result; + } + } + if (effect.type === "refinement") { + const executeRefinement = (acc) => { + const result = effect.refinement(acc, checkCtx); + if (ctx.common.async) { + return Promise.resolve(result); + } + if (result instanceof Promise) { + throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead."); + } + return acc; + }; + if (ctx.common.async === false) { + const inner = this._def.schema._parseSync({ + data: ctx.data, + path: ctx.path, + parent: ctx, + }); + if (inner.status === "aborted") + return INVALID; + if (inner.status === "dirty") + status.dirty(); + // return value is ignored + executeRefinement(inner.value); + return { status: status.value, value: inner.value }; + } + else { + return this._def.schema + ._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }) + .then((inner) => { + if (inner.status === "aborted") + return INVALID; + if (inner.status === "dirty") + status.dirty(); + return executeRefinement(inner.value).then(() => { + return { status: status.value, value: inner.value }; + }); + }); + } + } + if (effect.type === "transform") { + if (ctx.common.async === false) { + const base = this._def.schema._parseSync({ + data: ctx.data, + path: ctx.path, + parent: ctx, + }); + if (!isValid(base)) + return base; + const result = effect.transform(base.value, checkCtx); + if (result instanceof Promise) { + throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`); + } + return { status: status.value, value: result }; + } + else { + return this._def.schema + ._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }) + .then((base) => { + if (!isValid(base)) + return base; + return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({ status: status.value, value: result })); + }); + } + } + util.assertNever(effect); + } +} +ZodEffects.create = (schema, effect, params) => { + return new ZodEffects({ + schema, + typeName: ZodFirstPartyTypeKind.ZodEffects, + effect, + ...processCreateParams(params), + }); +}; +ZodEffects.createWithPreprocess = (preprocess, schema, params) => { + return new ZodEffects({ + schema, + effect: { type: "preprocess", transform: preprocess }, + typeName: ZodFirstPartyTypeKind.ZodEffects, + ...processCreateParams(params), + }); +}; +class ZodOptional extends ZodType { + _parse(input) { + const parsedType = this._getType(input); + if (parsedType === ZodParsedType.undefined) { + return OK(undefined); + } + return this._def.innerType._parse(input); + } + unwrap() { + return this._def.innerType; + } +} +ZodOptional.create = (type, params) => { + return new ZodOptional({ + innerType: type, + typeName: ZodFirstPartyTypeKind.ZodOptional, + ...processCreateParams(params), + }); +}; +class ZodNullable extends ZodType { + _parse(input) { + const parsedType = this._getType(input); + if (parsedType === ZodParsedType.null) { + return OK(null); + } + return this._def.innerType._parse(input); + } + unwrap() { + return this._def.innerType; + } +} +ZodNullable.create = (type, params) => { + return new ZodNullable({ + innerType: type, + typeName: ZodFirstPartyTypeKind.ZodNullable, + ...processCreateParams(params), + }); +}; +class ZodDefault extends ZodType { + _parse(input) { + const { ctx } = this._processInputParams(input); + let data = ctx.data; + if (ctx.parsedType === ZodParsedType.undefined) { + data = this._def.defaultValue(); + } + return this._def.innerType._parse({ + data, + path: ctx.path, + parent: ctx, + }); + } + removeDefault() { + return this._def.innerType; + } +} +ZodDefault.create = (type, params) => { + return new ZodDefault({ + innerType: type, + typeName: ZodFirstPartyTypeKind.ZodDefault, + defaultValue: typeof params.default === "function" + ? params.default + : () => params.default, + ...processCreateParams(params), + }); +}; +class ZodCatch extends ZodType { + _parse(input) { + const { ctx } = this._processInputParams(input); + // newCtx is used to not collect issues from inner types in ctx + const newCtx = { + ...ctx, + common: { + ...ctx.common, + issues: [], + }, + }; + const result = this._def.innerType._parse({ + data: newCtx.data, + path: newCtx.path, + parent: { + ...newCtx, + }, + }); + if (isAsync(result)) { + return result.then((result) => { + return { + status: "valid", + value: result.status === "valid" + ? result.value + : this._def.catchValue({ + get error() { + return new ZodError(newCtx.common.issues); + }, + input: newCtx.data, + }), + }; + }); + } + else { + return { + status: "valid", + value: result.status === "valid" + ? result.value + : this._def.catchValue({ + get error() { + return new ZodError(newCtx.common.issues); + }, + input: newCtx.data, + }), + }; + } + } + removeCatch() { + return this._def.innerType; + } +} +ZodCatch.create = (type, params) => { + return new ZodCatch({ + innerType: type, + typeName: ZodFirstPartyTypeKind.ZodCatch, + catchValue: typeof params.catch === "function" ? params.catch : () => params.catch, + ...processCreateParams(params), + }); +}; +class ZodNaN extends ZodType { + _parse(input) { + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.nan) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.nan, + received: ctx.parsedType, + }); + return INVALID; + } + return { status: "valid", value: input.data }; + } +} +ZodNaN.create = (params) => { + return new ZodNaN({ + typeName: ZodFirstPartyTypeKind.ZodNaN, + ...processCreateParams(params), + }); +}; +const BRAND = Symbol("zod_brand"); +class ZodBranded extends ZodType { + _parse(input) { + const { ctx } = this._processInputParams(input); + const data = ctx.data; + return this._def.type._parse({ + data, + path: ctx.path, + parent: ctx, + }); + } + unwrap() { + return this._def.type; + } +} +class ZodPipeline extends ZodType { + _parse(input) { + const { status, ctx } = this._processInputParams(input); + if (ctx.common.async) { + const handleAsync = async () => { + const inResult = await this._def.in._parseAsync({ + data: ctx.data, + path: ctx.path, + parent: ctx, + }); + if (inResult.status === "aborted") + return INVALID; + if (inResult.status === "dirty") { + status.dirty(); + return DIRTY(inResult.value); + } + else { + return this._def.out._parseAsync({ + data: inResult.value, + path: ctx.path, + parent: ctx, + }); + } + }; + return handleAsync(); + } + else { + const inResult = this._def.in._parseSync({ + data: ctx.data, + path: ctx.path, + parent: ctx, + }); + if (inResult.status === "aborted") + return INVALID; + if (inResult.status === "dirty") { + status.dirty(); + return { + status: "dirty", + value: inResult.value, + }; + } + else { + return this._def.out._parseSync({ + data: inResult.value, + path: ctx.path, + parent: ctx, + }); + } + } + } + static create(a, b) { + return new ZodPipeline({ + in: a, + out: b, + typeName: ZodFirstPartyTypeKind.ZodPipeline, + }); + } +} +class ZodReadonly extends ZodType { + _parse(input) { + const result = this._def.innerType._parse(input); + const freeze = (data) => { + if (isValid(data)) { + data.value = Object.freeze(data.value); + } + return data; + }; + return isAsync(result) + ? result.then((data) => freeze(data)) + : freeze(result); + } + unwrap() { + return this._def.innerType; + } +} +ZodReadonly.create = (type, params) => { + return new ZodReadonly({ + innerType: type, + typeName: ZodFirstPartyTypeKind.ZodReadonly, + ...processCreateParams(params), + }); +}; +function custom(check, params = {}, +/** + * @deprecated + * + * Pass `fatal` into the params object instead: + * + * ```ts + * z.string().custom((val) => val.length > 5, { fatal: false }) + * ``` + * + */ +fatal) { + if (check) + return ZodAny.create().superRefine((data, ctx) => { + var _a, _b; + if (!check(data)) { + const p = typeof params === "function" + ? params(data) + : typeof params === "string" + ? { message: params } + : params; + const _fatal = (_b = (_a = p.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true; + const p2 = typeof p === "string" ? { message: p } : p; + ctx.addIssue({ code: "custom", ...p2, fatal: _fatal }); + } + }); + return ZodAny.create(); +} +const late = { + object: ZodObject.lazycreate, +}; +var ZodFirstPartyTypeKind; +(function (ZodFirstPartyTypeKind) { + ZodFirstPartyTypeKind["ZodString"] = "ZodString"; + ZodFirstPartyTypeKind["ZodNumber"] = "ZodNumber"; + ZodFirstPartyTypeKind["ZodNaN"] = "ZodNaN"; + ZodFirstPartyTypeKind["ZodBigInt"] = "ZodBigInt"; + ZodFirstPartyTypeKind["ZodBoolean"] = "ZodBoolean"; + ZodFirstPartyTypeKind["ZodDate"] = "ZodDate"; + ZodFirstPartyTypeKind["ZodSymbol"] = "ZodSymbol"; + ZodFirstPartyTypeKind["ZodUndefined"] = "ZodUndefined"; + ZodFirstPartyTypeKind["ZodNull"] = "ZodNull"; + ZodFirstPartyTypeKind["ZodAny"] = "ZodAny"; + ZodFirstPartyTypeKind["ZodUnknown"] = "ZodUnknown"; + ZodFirstPartyTypeKind["ZodNever"] = "ZodNever"; + ZodFirstPartyTypeKind["ZodVoid"] = "ZodVoid"; + ZodFirstPartyTypeKind["ZodArray"] = "ZodArray"; + ZodFirstPartyTypeKind["ZodObject"] = "ZodObject"; + ZodFirstPartyTypeKind["ZodUnion"] = "ZodUnion"; + ZodFirstPartyTypeKind["ZodDiscriminatedUnion"] = "ZodDiscriminatedUnion"; + ZodFirstPartyTypeKind["ZodIntersection"] = "ZodIntersection"; + ZodFirstPartyTypeKind["ZodTuple"] = "ZodTuple"; + ZodFirstPartyTypeKind["ZodRecord"] = "ZodRecord"; + ZodFirstPartyTypeKind["ZodMap"] = "ZodMap"; + ZodFirstPartyTypeKind["ZodSet"] = "ZodSet"; + ZodFirstPartyTypeKind["ZodFunction"] = "ZodFunction"; + ZodFirstPartyTypeKind["ZodLazy"] = "ZodLazy"; + ZodFirstPartyTypeKind["ZodLiteral"] = "ZodLiteral"; + ZodFirstPartyTypeKind["ZodEnum"] = "ZodEnum"; + ZodFirstPartyTypeKind["ZodEffects"] = "ZodEffects"; + ZodFirstPartyTypeKind["ZodNativeEnum"] = "ZodNativeEnum"; + ZodFirstPartyTypeKind["ZodOptional"] = "ZodOptional"; + ZodFirstPartyTypeKind["ZodNullable"] = "ZodNullable"; + ZodFirstPartyTypeKind["ZodDefault"] = "ZodDefault"; + ZodFirstPartyTypeKind["ZodCatch"] = "ZodCatch"; + ZodFirstPartyTypeKind["ZodPromise"] = "ZodPromise"; + ZodFirstPartyTypeKind["ZodBranded"] = "ZodBranded"; + ZodFirstPartyTypeKind["ZodPipeline"] = "ZodPipeline"; + ZodFirstPartyTypeKind["ZodReadonly"] = "ZodReadonly"; +})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {})); +const instanceOfType = ( +// const instanceOfType = any>( +cls, params = { + message: `Input not instance of ${cls.name}`, +}) => custom((data) => data instanceof cls, params); +const stringType = ZodString.create; +const numberType = ZodNumber.create; +const nanType = ZodNaN.create; +const bigIntType = ZodBigInt.create; +const booleanType = ZodBoolean.create; +const dateType = ZodDate.create; +const symbolType = ZodSymbol.create; +const undefinedType = ZodUndefined.create; +const nullType = ZodNull.create; +const anyType = ZodAny.create; +const unknownType = ZodUnknown.create; +const neverType = ZodNever.create; +const voidType = ZodVoid.create; +const arrayType = ZodArray.create; +const objectType = ZodObject.create; +const strictObjectType = ZodObject.strictCreate; +const unionType = ZodUnion.create; +const discriminatedUnionType = ZodDiscriminatedUnion.create; +const intersectionType = ZodIntersection.create; +const tupleType = ZodTuple.create; +const recordType = ZodRecord.create; +const mapType = ZodMap.create; +const setType = ZodSet.create; +const functionType = ZodFunction.create; +const lazyType = ZodLazy.create; +const literalType = ZodLiteral.create; +const enumType = ZodEnum.create; +const nativeEnumType = ZodNativeEnum.create; +const promiseType = ZodPromise.create; +const effectsType = ZodEffects.create; +const optionalType = ZodOptional.create; +const nullableType = ZodNullable.create; +const preprocessType = ZodEffects.createWithPreprocess; +const pipelineType = ZodPipeline.create; +const ostring = () => stringType().optional(); +const onumber = () => numberType().optional(); +const oboolean = () => booleanType().optional(); +const coerce = { + string: ((arg) => ZodString.create({ ...arg, coerce: true })), + number: ((arg) => ZodNumber.create({ ...arg, coerce: true })), + boolean: ((arg) => ZodBoolean.create({ + ...arg, + coerce: true, + })), + bigint: ((arg) => ZodBigInt.create({ ...arg, coerce: true })), + date: ((arg) => ZodDate.create({ ...arg, coerce: true })), +}; +const NEVER = INVALID; + +var z = /*#__PURE__*/Object.freeze({ + __proto__: null, + defaultErrorMap: errorMap, + setErrorMap: setErrorMap, + getErrorMap: getErrorMap, + makeIssue: makeIssue, + EMPTY_PATH: EMPTY_PATH, + addIssueToContext: addIssueToContext, + ParseStatus: ParseStatus, + INVALID: INVALID, + DIRTY: DIRTY, + OK: OK, + isAborted: isAborted, + isDirty: isDirty, + isValid: isValid, + isAsync: isAsync, + get util () { return util; }, + get objectUtil () { return objectUtil; }, + ZodParsedType: ZodParsedType, + getParsedType: getParsedType, + ZodType: ZodType, + datetimeRegex: datetimeRegex, + ZodString: ZodString, + ZodNumber: ZodNumber, + ZodBigInt: ZodBigInt, + ZodBoolean: ZodBoolean, + ZodDate: ZodDate, + ZodSymbol: ZodSymbol, + ZodUndefined: ZodUndefined, + ZodNull: ZodNull, + ZodAny: ZodAny, + ZodUnknown: ZodUnknown, + ZodNever: ZodNever, + ZodVoid: ZodVoid, + ZodArray: ZodArray, + ZodObject: ZodObject, + ZodUnion: ZodUnion, + ZodDiscriminatedUnion: ZodDiscriminatedUnion, + ZodIntersection: ZodIntersection, + ZodTuple: ZodTuple, + ZodRecord: ZodRecord, + ZodMap: ZodMap, + ZodSet: ZodSet, + ZodFunction: ZodFunction, + ZodLazy: ZodLazy, + ZodLiteral: ZodLiteral, + ZodEnum: ZodEnum, + ZodNativeEnum: ZodNativeEnum, + ZodPromise: ZodPromise, + ZodEffects: ZodEffects, + ZodTransformer: ZodEffects, + ZodOptional: ZodOptional, + ZodNullable: ZodNullable, + ZodDefault: ZodDefault, + ZodCatch: ZodCatch, + ZodNaN: ZodNaN, + BRAND: BRAND, + ZodBranded: ZodBranded, + ZodPipeline: ZodPipeline, + ZodReadonly: ZodReadonly, + custom: custom, + Schema: ZodType, + ZodSchema: ZodType, + late: late, + get ZodFirstPartyTypeKind () { return ZodFirstPartyTypeKind; }, + coerce: coerce, + any: anyType, + array: arrayType, + bigint: bigIntType, + boolean: booleanType, + date: dateType, + discriminatedUnion: discriminatedUnionType, + effect: effectsType, + 'enum': enumType, + 'function': functionType, + 'instanceof': instanceOfType, + intersection: intersectionType, + lazy: lazyType, + literal: literalType, + map: mapType, + nan: nanType, + nativeEnum: nativeEnumType, + never: neverType, + 'null': nullType, + nullable: nullableType, + number: numberType, + object: objectType, + oboolean: oboolean, + onumber: onumber, + optional: optionalType, + ostring: ostring, + pipeline: pipelineType, + preprocess: preprocessType, + promise: promiseType, + record: recordType, + set: setType, + strictObject: strictObjectType, + string: stringType, + symbol: symbolType, + transformer: effectsType, + tuple: tupleType, + 'undefined': undefinedType, + union: unionType, + unknown: unknownType, + 'void': voidType, + NEVER: NEVER, + ZodIssueCode: ZodIssueCode, + quotelessJson: quotelessJson, + ZodError: ZodError +}); + +export { BRAND, DIRTY, EMPTY_PATH, INVALID, NEVER, OK, ParseStatus, ZodType as Schema, ZodAny, ZodArray, ZodBigInt, ZodBoolean, ZodBranded, ZodCatch, ZodDate, ZodDefault, ZodDiscriminatedUnion, ZodEffects, ZodEnum, ZodError, ZodFirstPartyTypeKind, ZodFunction, ZodIntersection, ZodIssueCode, ZodLazy, ZodLiteral, ZodMap, ZodNaN, ZodNativeEnum, ZodNever, ZodNull, ZodNullable, ZodNumber, ZodObject, ZodOptional, ZodParsedType, ZodPipeline, ZodPromise, ZodReadonly, ZodRecord, ZodType as ZodSchema, ZodSet, ZodString, ZodSymbol, ZodEffects as ZodTransformer, ZodTuple, ZodType, ZodUndefined, ZodUnion, ZodUnknown, ZodVoid, addIssueToContext, anyType as any, arrayType as array, bigIntType as bigint, booleanType as boolean, coerce, custom, dateType as date, datetimeRegex, z as default, errorMap as defaultErrorMap, discriminatedUnionType as discriminatedUnion, effectsType as effect, enumType as enum, functionType as function, getErrorMap, getParsedType, instanceOfType as instanceof, intersectionType as intersection, isAborted, isAsync, isDirty, isValid, late, lazyType as lazy, literalType as literal, makeIssue, mapType as map, nanType as nan, nativeEnumType as nativeEnum, neverType as never, nullType as null, nullableType as nullable, numberType as number, objectType as object, objectUtil, oboolean, onumber, optionalType as optional, ostring, pipelineType as pipeline, preprocessType as preprocess, promiseType as promise, quotelessJson, recordType as record, setType as set, setErrorMap, strictObjectType as strictObject, stringType as string, symbolType as symbol, effectsType as transformer, tupleType as tuple, undefinedType as undefined, unionType as union, unknownType as unknown, util, voidType as void, z }; diff --git a/front_end/third_party/mcp-sdk/zod/lib/index.umd.js b/front_end/third_party/mcp-sdk/zod/lib/index.umd.js new file mode 100644 index 0000000000..d964117a03 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/index.umd.js @@ -0,0 +1,4351 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Zod = {})); +})(this, (function (exports) { 'use strict'; + + exports.util = void 0; + (function (util) { + util.assertEqual = (val) => val; + function assertIs(_arg) { } + util.assertIs = assertIs; + function assertNever(_x) { + throw new Error(); + } + util.assertNever = assertNever; + util.arrayToEnum = (items) => { + const obj = {}; + for (const item of items) { + obj[item] = item; + } + return obj; + }; + util.getValidEnumValues = (obj) => { + const validKeys = util.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number"); + const filtered = {}; + for (const k of validKeys) { + filtered[k] = obj[k]; + } + return util.objectValues(filtered); + }; + util.objectValues = (obj) => { + return util.objectKeys(obj).map(function (e) { + return obj[e]; + }); + }; + util.objectKeys = typeof Object.keys === "function" // eslint-disable-line ban/ban + ? (obj) => Object.keys(obj) // eslint-disable-line ban/ban + : (object) => { + const keys = []; + for (const key in object) { + if (Object.prototype.hasOwnProperty.call(object, key)) { + keys.push(key); + } + } + return keys; + }; + util.find = (arr, checker) => { + for (const item of arr) { + if (checker(item)) + return item; + } + return undefined; + }; + util.isInteger = typeof Number.isInteger === "function" + ? (val) => Number.isInteger(val) // eslint-disable-line ban/ban + : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val; + function joinValues(array, separator = " | ") { + return array + .map((val) => (typeof val === "string" ? `'${val}'` : val)) + .join(separator); + } + util.joinValues = joinValues; + util.jsonStringifyReplacer = (_, value) => { + if (typeof value === "bigint") { + return value.toString(); + } + return value; + }; + })(exports.util || (exports.util = {})); + exports.objectUtil = void 0; + (function (objectUtil) { + objectUtil.mergeShapes = (first, second) => { + return { + ...first, + ...second, // second overwrites first + }; + }; + })(exports.objectUtil || (exports.objectUtil = {})); + const ZodParsedType = exports.util.arrayToEnum([ + "string", + "nan", + "number", + "integer", + "float", + "boolean", + "date", + "bigint", + "symbol", + "function", + "undefined", + "null", + "array", + "object", + "unknown", + "promise", + "void", + "never", + "map", + "set", + ]); + const getParsedType = (data) => { + const t = typeof data; + switch (t) { + case "undefined": + return ZodParsedType.undefined; + case "string": + return ZodParsedType.string; + case "number": + return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number; + case "boolean": + return ZodParsedType.boolean; + case "function": + return ZodParsedType.function; + case "bigint": + return ZodParsedType.bigint; + case "symbol": + return ZodParsedType.symbol; + case "object": + if (Array.isArray(data)) { + return ZodParsedType.array; + } + if (data === null) { + return ZodParsedType.null; + } + if (data.then && + typeof data.then === "function" && + data.catch && + typeof data.catch === "function") { + return ZodParsedType.promise; + } + if (typeof Map !== "undefined" && data instanceof Map) { + return ZodParsedType.map; + } + if (typeof Set !== "undefined" && data instanceof Set) { + return ZodParsedType.set; + } + if (typeof Date !== "undefined" && data instanceof Date) { + return ZodParsedType.date; + } + return ZodParsedType.object; + default: + return ZodParsedType.unknown; + } + }; + + const ZodIssueCode = exports.util.arrayToEnum([ + "invalid_type", + "invalid_literal", + "custom", + "invalid_union", + "invalid_union_discriminator", + "invalid_enum_value", + "unrecognized_keys", + "invalid_arguments", + "invalid_return_type", + "invalid_date", + "invalid_string", + "too_small", + "too_big", + "invalid_intersection_types", + "not_multiple_of", + "not_finite", + ]); + const quotelessJson = (obj) => { + const json = JSON.stringify(obj, null, 2); + return json.replace(/"([^"]+)":/g, "$1:"); + }; + class ZodError extends Error { + constructor(issues) { + super(); + this.issues = []; + this.addIssue = (sub) => { + this.issues = [...this.issues, sub]; + }; + this.addIssues = (subs = []) => { + this.issues = [...this.issues, ...subs]; + }; + const actualProto = new.target.prototype; + if (Object.setPrototypeOf) { + // eslint-disable-next-line ban/ban + Object.setPrototypeOf(this, actualProto); + } + else { + this.__proto__ = actualProto; + } + this.name = "ZodError"; + this.issues = issues; + } + get errors() { + return this.issues; + } + format(_mapper) { + const mapper = _mapper || + function (issue) { + return issue.message; + }; + const fieldErrors = { _errors: [] }; + const processError = (error) => { + for (const issue of error.issues) { + if (issue.code === "invalid_union") { + issue.unionErrors.map(processError); + } + else if (issue.code === "invalid_return_type") { + processError(issue.returnTypeError); + } + else if (issue.code === "invalid_arguments") { + processError(issue.argumentsError); + } + else if (issue.path.length === 0) { + fieldErrors._errors.push(mapper(issue)); + } + else { + let curr = fieldErrors; + let i = 0; + while (i < issue.path.length) { + const el = issue.path[i]; + const terminal = i === issue.path.length - 1; + if (!terminal) { + curr[el] = curr[el] || { _errors: [] }; + // if (typeof el === "string") { + // curr[el] = curr[el] || { _errors: [] }; + // } else if (typeof el === "number") { + // const errorArray: any = []; + // errorArray._errors = []; + // curr[el] = curr[el] || errorArray; + // } + } + else { + curr[el] = curr[el] || { _errors: [] }; + curr[el]._errors.push(mapper(issue)); + } + curr = curr[el]; + i++; + } + } + } + }; + processError(this); + return fieldErrors; + } + static assert(value) { + if (!(value instanceof ZodError)) { + throw new Error(`Not a ZodError: ${value}`); + } + } + toString() { + return this.message; + } + get message() { + return JSON.stringify(this.issues, exports.util.jsonStringifyReplacer, 2); + } + get isEmpty() { + return this.issues.length === 0; + } + flatten(mapper = (issue) => issue.message) { + const fieldErrors = {}; + const formErrors = []; + for (const sub of this.issues) { + if (sub.path.length > 0) { + fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || []; + fieldErrors[sub.path[0]].push(mapper(sub)); + } + else { + formErrors.push(mapper(sub)); + } + } + return { formErrors, fieldErrors }; + } + get formErrors() { + return this.flatten(); + } + } + ZodError.create = (issues) => { + const error = new ZodError(issues); + return error; + }; + + const errorMap = (issue, _ctx) => { + let message; + switch (issue.code) { + case ZodIssueCode.invalid_type: + if (issue.received === ZodParsedType.undefined) { + message = "Required"; + } + else { + message = `Expected ${issue.expected}, received ${issue.received}`; + } + break; + case ZodIssueCode.invalid_literal: + message = `Invalid literal value, expected ${JSON.stringify(issue.expected, exports.util.jsonStringifyReplacer)}`; + break; + case ZodIssueCode.unrecognized_keys: + message = `Unrecognized key(s) in object: ${exports.util.joinValues(issue.keys, ", ")}`; + break; + case ZodIssueCode.invalid_union: + message = `Invalid input`; + break; + case ZodIssueCode.invalid_union_discriminator: + message = `Invalid discriminator value. Expected ${exports.util.joinValues(issue.options)}`; + break; + case ZodIssueCode.invalid_enum_value: + message = `Invalid enum value. Expected ${exports.util.joinValues(issue.options)}, received '${issue.received}'`; + break; + case ZodIssueCode.invalid_arguments: + message = `Invalid function arguments`; + break; + case ZodIssueCode.invalid_return_type: + message = `Invalid function return type`; + break; + case ZodIssueCode.invalid_date: + message = `Invalid date`; + break; + case ZodIssueCode.invalid_string: + if (typeof issue.validation === "object") { + if ("includes" in issue.validation) { + message = `Invalid input: must include "${issue.validation.includes}"`; + if (typeof issue.validation.position === "number") { + message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`; + } + } + else if ("startsWith" in issue.validation) { + message = `Invalid input: must start with "${issue.validation.startsWith}"`; + } + else if ("endsWith" in issue.validation) { + message = `Invalid input: must end with "${issue.validation.endsWith}"`; + } + else { + exports.util.assertNever(issue.validation); + } + } + else if (issue.validation !== "regex") { + message = `Invalid ${issue.validation}`; + } + else { + message = "Invalid"; + } + break; + case ZodIssueCode.too_small: + if (issue.type === "array") + message = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`; + else if (issue.type === "string") + message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`; + else if (issue.type === "number") + message = `Number must be ${issue.exact + ? `exactly equal to ` + : issue.inclusive + ? `greater than or equal to ` + : `greater than `}${issue.minimum}`; + else if (issue.type === "date") + message = `Date must be ${issue.exact + ? `exactly equal to ` + : issue.inclusive + ? `greater than or equal to ` + : `greater than `}${new Date(Number(issue.minimum))}`; + else + message = "Invalid input"; + break; + case ZodIssueCode.too_big: + if (issue.type === "array") + message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`; + else if (issue.type === "string") + message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`; + else if (issue.type === "number") + message = `Number must be ${issue.exact + ? `exactly` + : issue.inclusive + ? `less than or equal to` + : `less than`} ${issue.maximum}`; + else if (issue.type === "bigint") + message = `BigInt must be ${issue.exact + ? `exactly` + : issue.inclusive + ? `less than or equal to` + : `less than`} ${issue.maximum}`; + else if (issue.type === "date") + message = `Date must be ${issue.exact + ? `exactly` + : issue.inclusive + ? `smaller than or equal to` + : `smaller than`} ${new Date(Number(issue.maximum))}`; + else + message = "Invalid input"; + break; + case ZodIssueCode.custom: + message = `Invalid input`; + break; + case ZodIssueCode.invalid_intersection_types: + message = `Intersection results could not be merged`; + break; + case ZodIssueCode.not_multiple_of: + message = `Number must be a multiple of ${issue.multipleOf}`; + break; + case ZodIssueCode.not_finite: + message = "Number must be finite"; + break; + default: + message = _ctx.defaultError; + exports.util.assertNever(issue); + } + return { message }; + }; + + let overrideErrorMap = errorMap; + function setErrorMap(map) { + overrideErrorMap = map; + } + function getErrorMap() { + return overrideErrorMap; + } + + const makeIssue = (params) => { + const { data, path, errorMaps, issueData } = params; + const fullPath = [...path, ...(issueData.path || [])]; + const fullIssue = { + ...issueData, + path: fullPath, + }; + if (issueData.message !== undefined) { + return { + ...issueData, + path: fullPath, + message: issueData.message, + }; + } + let errorMessage = ""; + const maps = errorMaps + .filter((m) => !!m) + .slice() + .reverse(); + for (const map of maps) { + errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message; + } + return { + ...issueData, + path: fullPath, + message: errorMessage, + }; + }; + const EMPTY_PATH = []; + function addIssueToContext(ctx, issueData) { + const overrideMap = getErrorMap(); + const issue = makeIssue({ + issueData: issueData, + data: ctx.data, + path: ctx.path, + errorMaps: [ + ctx.common.contextualErrorMap, + ctx.schemaErrorMap, + overrideMap, + overrideMap === errorMap ? undefined : errorMap, // then global default map + ].filter((x) => !!x), + }); + ctx.common.issues.push(issue); + } + class ParseStatus { + constructor() { + this.value = "valid"; + } + dirty() { + if (this.value === "valid") + this.value = "dirty"; + } + abort() { + if (this.value !== "aborted") + this.value = "aborted"; + } + static mergeArray(status, results) { + const arrayValue = []; + for (const s of results) { + if (s.status === "aborted") + return INVALID; + if (s.status === "dirty") + status.dirty(); + arrayValue.push(s.value); + } + return { status: status.value, value: arrayValue }; + } + static async mergeObjectAsync(status, pairs) { + const syncPairs = []; + for (const pair of pairs) { + const key = await pair.key; + const value = await pair.value; + syncPairs.push({ + key, + value, + }); + } + return ParseStatus.mergeObjectSync(status, syncPairs); + } + static mergeObjectSync(status, pairs) { + const finalObject = {}; + for (const pair of pairs) { + const { key, value } = pair; + if (key.status === "aborted") + return INVALID; + if (value.status === "aborted") + return INVALID; + if (key.status === "dirty") + status.dirty(); + if (value.status === "dirty") + status.dirty(); + if (key.value !== "__proto__" && + (typeof value.value !== "undefined" || pair.alwaysSet)) { + finalObject[key.value] = value.value; + } + } + return { status: status.value, value: finalObject }; + } + } + const INVALID = Object.freeze({ + status: "aborted", + }); + const DIRTY = (value) => ({ status: "dirty", value }); + const OK = (value) => ({ status: "valid", value }); + const isAborted = (x) => x.status === "aborted"; + const isDirty = (x) => x.status === "dirty"; + const isValid = (x) => x.status === "valid"; + const isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise; + + /****************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */ + + function __classPrivateFieldGet(receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); + } + + function __classPrivateFieldSet(receiver, state, value, kind, f) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; + } + + typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { + var e = new Error(message); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; + }; + + var errorUtil; + (function (errorUtil) { + errorUtil.errToObj = (message) => typeof message === "string" ? { message } : message || {}; + errorUtil.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message; + })(errorUtil || (errorUtil = {})); + + var _ZodEnum_cache, _ZodNativeEnum_cache; + class ParseInputLazyPath { + constructor(parent, value, path, key) { + this._cachedPath = []; + this.parent = parent; + this.data = value; + this._path = path; + this._key = key; + } + get path() { + if (!this._cachedPath.length) { + if (this._key instanceof Array) { + this._cachedPath.push(...this._path, ...this._key); + } + else { + this._cachedPath.push(...this._path, this._key); + } + } + return this._cachedPath; + } + } + const handleResult = (ctx, result) => { + if (isValid(result)) { + return { success: true, data: result.value }; + } + else { + if (!ctx.common.issues.length) { + throw new Error("Validation failed but no issues detected."); + } + return { + success: false, + get error() { + if (this._error) + return this._error; + const error = new ZodError(ctx.common.issues); + this._error = error; + return this._error; + }, + }; + } + }; + function processCreateParams(params) { + if (!params) + return {}; + const { errorMap, invalid_type_error, required_error, description } = params; + if (errorMap && (invalid_type_error || required_error)) { + throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`); + } + if (errorMap) + return { errorMap: errorMap, description }; + const customMap = (iss, ctx) => { + var _a, _b; + const { message } = params; + if (iss.code === "invalid_enum_value") { + return { message: message !== null && message !== void 0 ? message : ctx.defaultError }; + } + if (typeof ctx.data === "undefined") { + return { message: (_a = message !== null && message !== void 0 ? message : required_error) !== null && _a !== void 0 ? _a : ctx.defaultError }; + } + if (iss.code !== "invalid_type") + return { message: ctx.defaultError }; + return { message: (_b = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _b !== void 0 ? _b : ctx.defaultError }; + }; + return { errorMap: customMap, description }; + } + class ZodType { + constructor(def) { + /** Alias of safeParseAsync */ + this.spa = this.safeParseAsync; + this._def = def; + this.parse = this.parse.bind(this); + this.safeParse = this.safeParse.bind(this); + this.parseAsync = this.parseAsync.bind(this); + this.safeParseAsync = this.safeParseAsync.bind(this); + this.spa = this.spa.bind(this); + this.refine = this.refine.bind(this); + this.refinement = this.refinement.bind(this); + this.superRefine = this.superRefine.bind(this); + this.optional = this.optional.bind(this); + this.nullable = this.nullable.bind(this); + this.nullish = this.nullish.bind(this); + this.array = this.array.bind(this); + this.promise = this.promise.bind(this); + this.or = this.or.bind(this); + this.and = this.and.bind(this); + this.transform = this.transform.bind(this); + this.brand = this.brand.bind(this); + this.default = this.default.bind(this); + this.catch = this.catch.bind(this); + this.describe = this.describe.bind(this); + this.pipe = this.pipe.bind(this); + this.readonly = this.readonly.bind(this); + this.isNullable = this.isNullable.bind(this); + this.isOptional = this.isOptional.bind(this); + } + get description() { + return this._def.description; + } + _getType(input) { + return getParsedType(input.data); + } + _getOrReturnCtx(input, ctx) { + return (ctx || { + common: input.parent.common, + data: input.data, + parsedType: getParsedType(input.data), + schemaErrorMap: this._def.errorMap, + path: input.path, + parent: input.parent, + }); + } + _processInputParams(input) { + return { + status: new ParseStatus(), + ctx: { + common: input.parent.common, + data: input.data, + parsedType: getParsedType(input.data), + schemaErrorMap: this._def.errorMap, + path: input.path, + parent: input.parent, + }, + }; + } + _parseSync(input) { + const result = this._parse(input); + if (isAsync(result)) { + throw new Error("Synchronous parse encountered promise."); + } + return result; + } + _parseAsync(input) { + const result = this._parse(input); + return Promise.resolve(result); + } + parse(data, params) { + const result = this.safeParse(data, params); + if (result.success) + return result.data; + throw result.error; + } + safeParse(data, params) { + var _a; + const ctx = { + common: { + issues: [], + async: (_a = params === null || params === void 0 ? void 0 : params.async) !== null && _a !== void 0 ? _a : false, + contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap, + }, + path: (params === null || params === void 0 ? void 0 : params.path) || [], + schemaErrorMap: this._def.errorMap, + parent: null, + data, + parsedType: getParsedType(data), + }; + const result = this._parseSync({ data, path: ctx.path, parent: ctx }); + return handleResult(ctx, result); + } + async parseAsync(data, params) { + const result = await this.safeParseAsync(data, params); + if (result.success) + return result.data; + throw result.error; + } + async safeParseAsync(data, params) { + const ctx = { + common: { + issues: [], + contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap, + async: true, + }, + path: (params === null || params === void 0 ? void 0 : params.path) || [], + schemaErrorMap: this._def.errorMap, + parent: null, + data, + parsedType: getParsedType(data), + }; + const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx }); + const result = await (isAsync(maybeAsyncResult) + ? maybeAsyncResult + : Promise.resolve(maybeAsyncResult)); + return handleResult(ctx, result); + } + refine(check, message) { + const getIssueProperties = (val) => { + if (typeof message === "string" || typeof message === "undefined") { + return { message }; + } + else if (typeof message === "function") { + return message(val); + } + else { + return message; + } + }; + return this._refinement((val, ctx) => { + const result = check(val); + const setError = () => ctx.addIssue({ + code: ZodIssueCode.custom, + ...getIssueProperties(val), + }); + if (typeof Promise !== "undefined" && result instanceof Promise) { + return result.then((data) => { + if (!data) { + setError(); + return false; + } + else { + return true; + } + }); + } + if (!result) { + setError(); + return false; + } + else { + return true; + } + }); + } + refinement(check, refinementData) { + return this._refinement((val, ctx) => { + if (!check(val)) { + ctx.addIssue(typeof refinementData === "function" + ? refinementData(val, ctx) + : refinementData); + return false; + } + else { + return true; + } + }); + } + _refinement(refinement) { + return new ZodEffects({ + schema: this, + typeName: exports.ZodFirstPartyTypeKind.ZodEffects, + effect: { type: "refinement", refinement }, + }); + } + superRefine(refinement) { + return this._refinement(refinement); + } + optional() { + return ZodOptional.create(this, this._def); + } + nullable() { + return ZodNullable.create(this, this._def); + } + nullish() { + return this.nullable().optional(); + } + array() { + return ZodArray.create(this, this._def); + } + promise() { + return ZodPromise.create(this, this._def); + } + or(option) { + return ZodUnion.create([this, option], this._def); + } + and(incoming) { + return ZodIntersection.create(this, incoming, this._def); + } + transform(transform) { + return new ZodEffects({ + ...processCreateParams(this._def), + schema: this, + typeName: exports.ZodFirstPartyTypeKind.ZodEffects, + effect: { type: "transform", transform }, + }); + } + default(def) { + const defaultValueFunc = typeof def === "function" ? def : () => def; + return new ZodDefault({ + ...processCreateParams(this._def), + innerType: this, + defaultValue: defaultValueFunc, + typeName: exports.ZodFirstPartyTypeKind.ZodDefault, + }); + } + brand() { + return new ZodBranded({ + typeName: exports.ZodFirstPartyTypeKind.ZodBranded, + type: this, + ...processCreateParams(this._def), + }); + } + catch(def) { + const catchValueFunc = typeof def === "function" ? def : () => def; + return new ZodCatch({ + ...processCreateParams(this._def), + innerType: this, + catchValue: catchValueFunc, + typeName: exports.ZodFirstPartyTypeKind.ZodCatch, + }); + } + describe(description) { + const This = this.constructor; + return new This({ + ...this._def, + description, + }); + } + pipe(target) { + return ZodPipeline.create(this, target); + } + readonly() { + return ZodReadonly.create(this); + } + isOptional() { + return this.safeParse(undefined).success; + } + isNullable() { + return this.safeParse(null).success; + } + } + const cuidRegex = /^c[^\s-]{8,}$/i; + const cuid2Regex = /^[0-9a-z]+$/; + const ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/; + // const uuidRegex = + // /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i; + const uuidRegex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i; + const nanoidRegex = /^[a-z0-9_-]{21}$/i; + const durationRegex = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/; + // from https://stackoverflow.com/a/46181/1550155 + // old version: too slow, didn't support unicode + // const emailRegex = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i; + //old email regex + // const emailRegex = /^(([^<>()[\].,;:\s@"]+(\.[^<>()[\].,;:\s@"]+)*)|(".+"))@((?!-)([^<>()[\].,;:\s@"]+\.)+[^<>()[\].,;:\s@"]{1,})[^-<>()[\].,;:\s@"]$/i; + // eslint-disable-next-line + // const emailRegex = + // /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\])|(\[IPv6:(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\.[A-Za-z]{2,})+))$/; + // const emailRegex = + // /^[a-zA-Z0-9\.\!\#\$\%\&\'\*\+\/\=\?\^\_\`\{\|\}\~\-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/; + // const emailRegex = + // /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i; + const emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i; + // const emailRegex = + // /^[a-z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-z0-9-]+(?:\.[a-z0-9\-]+)*$/i; + // from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression + const _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`; + let emojiRegex; + // faster, simpler, safer + const ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/; + const ipv6Regex = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/; + // https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript + const base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/; + // simple + // const dateRegexSource = `\\d{4}-\\d{2}-\\d{2}`; + // no leap year validation + // const dateRegexSource = `\\d{4}-((0[13578]|10|12)-31|(0[13-9]|1[0-2])-30|(0[1-9]|1[0-2])-(0[1-9]|1\\d|2\\d))`; + // with leap year validation + const dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`; + const dateRegex = new RegExp(`^${dateRegexSource}$`); + function timeRegexSource(args) { + // let regex = `\\d{2}:\\d{2}:\\d{2}`; + let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`; + if (args.precision) { + regex = `${regex}\\.\\d{${args.precision}}`; + } + else if (args.precision == null) { + regex = `${regex}(\\.\\d+)?`; + } + return regex; + } + function timeRegex(args) { + return new RegExp(`^${timeRegexSource(args)}$`); + } + // Adapted from https://stackoverflow.com/a/3143231 + function datetimeRegex(args) { + let regex = `${dateRegexSource}T${timeRegexSource(args)}`; + const opts = []; + opts.push(args.local ? `Z?` : `Z`); + if (args.offset) + opts.push(`([+-]\\d{2}:?\\d{2})`); + regex = `${regex}(${opts.join("|")})`; + return new RegExp(`^${regex}$`); + } + function isValidIP(ip, version) { + if ((version === "v4" || !version) && ipv4Regex.test(ip)) { + return true; + } + if ((version === "v6" || !version) && ipv6Regex.test(ip)) { + return true; + } + return false; + } + class ZodString extends ZodType { + _parse(input) { + if (this._def.coerce) { + input.data = String(input.data); + } + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.string) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.string, + received: ctx.parsedType, + }); + return INVALID; + } + const status = new ParseStatus(); + let ctx = undefined; + for (const check of this._def.checks) { + if (check.kind === "min") { + if (input.data.length < check.value) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.too_small, + minimum: check.value, + type: "string", + inclusive: true, + exact: false, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "max") { + if (input.data.length > check.value) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.too_big, + maximum: check.value, + type: "string", + inclusive: true, + exact: false, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "length") { + const tooBig = input.data.length > check.value; + const tooSmall = input.data.length < check.value; + if (tooBig || tooSmall) { + ctx = this._getOrReturnCtx(input, ctx); + if (tooBig) { + addIssueToContext(ctx, { + code: ZodIssueCode.too_big, + maximum: check.value, + type: "string", + inclusive: true, + exact: true, + message: check.message, + }); + } + else if (tooSmall) { + addIssueToContext(ctx, { + code: ZodIssueCode.too_small, + minimum: check.value, + type: "string", + inclusive: true, + exact: true, + message: check.message, + }); + } + status.dirty(); + } + } + else if (check.kind === "email") { + if (!emailRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "email", + code: ZodIssueCode.invalid_string, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "emoji") { + if (!emojiRegex) { + emojiRegex = new RegExp(_emojiRegex, "u"); + } + if (!emojiRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "emoji", + code: ZodIssueCode.invalid_string, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "uuid") { + if (!uuidRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "uuid", + code: ZodIssueCode.invalid_string, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "nanoid") { + if (!nanoidRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "nanoid", + code: ZodIssueCode.invalid_string, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "cuid") { + if (!cuidRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "cuid", + code: ZodIssueCode.invalid_string, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "cuid2") { + if (!cuid2Regex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "cuid2", + code: ZodIssueCode.invalid_string, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "ulid") { + if (!ulidRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "ulid", + code: ZodIssueCode.invalid_string, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "url") { + try { + new URL(input.data); + } + catch (_a) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "url", + code: ZodIssueCode.invalid_string, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "regex") { + check.regex.lastIndex = 0; + const testResult = check.regex.test(input.data); + if (!testResult) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "regex", + code: ZodIssueCode.invalid_string, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "trim") { + input.data = input.data.trim(); + } + else if (check.kind === "includes") { + if (!input.data.includes(check.value, check.position)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_string, + validation: { includes: check.value, position: check.position }, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "toLowerCase") { + input.data = input.data.toLowerCase(); + } + else if (check.kind === "toUpperCase") { + input.data = input.data.toUpperCase(); + } + else if (check.kind === "startsWith") { + if (!input.data.startsWith(check.value)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_string, + validation: { startsWith: check.value }, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "endsWith") { + if (!input.data.endsWith(check.value)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_string, + validation: { endsWith: check.value }, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "datetime") { + const regex = datetimeRegex(check); + if (!regex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_string, + validation: "datetime", + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "date") { + const regex = dateRegex; + if (!regex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_string, + validation: "date", + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "time") { + const regex = timeRegex(check); + if (!regex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_string, + validation: "time", + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "duration") { + if (!durationRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "duration", + code: ZodIssueCode.invalid_string, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "ip") { + if (!isValidIP(input.data, check.version)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "ip", + code: ZodIssueCode.invalid_string, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "base64") { + if (!base64Regex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "base64", + code: ZodIssueCode.invalid_string, + message: check.message, + }); + status.dirty(); + } + } + else { + exports.util.assertNever(check); + } + } + return { status: status.value, value: input.data }; + } + _regex(regex, validation, message) { + return this.refinement((data) => regex.test(data), { + validation, + code: ZodIssueCode.invalid_string, + ...errorUtil.errToObj(message), + }); + } + _addCheck(check) { + return new ZodString({ + ...this._def, + checks: [...this._def.checks, check], + }); + } + email(message) { + return this._addCheck({ kind: "email", ...errorUtil.errToObj(message) }); + } + url(message) { + return this._addCheck({ kind: "url", ...errorUtil.errToObj(message) }); + } + emoji(message) { + return this._addCheck({ kind: "emoji", ...errorUtil.errToObj(message) }); + } + uuid(message) { + return this._addCheck({ kind: "uuid", ...errorUtil.errToObj(message) }); + } + nanoid(message) { + return this._addCheck({ kind: "nanoid", ...errorUtil.errToObj(message) }); + } + cuid(message) { + return this._addCheck({ kind: "cuid", ...errorUtil.errToObj(message) }); + } + cuid2(message) { + return this._addCheck({ kind: "cuid2", ...errorUtil.errToObj(message) }); + } + ulid(message) { + return this._addCheck({ kind: "ulid", ...errorUtil.errToObj(message) }); + } + base64(message) { + return this._addCheck({ kind: "base64", ...errorUtil.errToObj(message) }); + } + ip(options) { + return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) }); + } + datetime(options) { + var _a, _b; + if (typeof options === "string") { + return this._addCheck({ + kind: "datetime", + precision: null, + offset: false, + local: false, + message: options, + }); + } + return this._addCheck({ + kind: "datetime", + precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision, + offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false, + local: (_b = options === null || options === void 0 ? void 0 : options.local) !== null && _b !== void 0 ? _b : false, + ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message), + }); + } + date(message) { + return this._addCheck({ kind: "date", message }); + } + time(options) { + if (typeof options === "string") { + return this._addCheck({ + kind: "time", + precision: null, + message: options, + }); + } + return this._addCheck({ + kind: "time", + precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision, + ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message), + }); + } + duration(message) { + return this._addCheck({ kind: "duration", ...errorUtil.errToObj(message) }); + } + regex(regex, message) { + return this._addCheck({ + kind: "regex", + regex: regex, + ...errorUtil.errToObj(message), + }); + } + includes(value, options) { + return this._addCheck({ + kind: "includes", + value: value, + position: options === null || options === void 0 ? void 0 : options.position, + ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message), + }); + } + startsWith(value, message) { + return this._addCheck({ + kind: "startsWith", + value: value, + ...errorUtil.errToObj(message), + }); + } + endsWith(value, message) { + return this._addCheck({ + kind: "endsWith", + value: value, + ...errorUtil.errToObj(message), + }); + } + min(minLength, message) { + return this._addCheck({ + kind: "min", + value: minLength, + ...errorUtil.errToObj(message), + }); + } + max(maxLength, message) { + return this._addCheck({ + kind: "max", + value: maxLength, + ...errorUtil.errToObj(message), + }); + } + length(len, message) { + return this._addCheck({ + kind: "length", + value: len, + ...errorUtil.errToObj(message), + }); + } + /** + * @deprecated Use z.string().min(1) instead. + * @see {@link ZodString.min} + */ + nonempty(message) { + return this.min(1, errorUtil.errToObj(message)); + } + trim() { + return new ZodString({ + ...this._def, + checks: [...this._def.checks, { kind: "trim" }], + }); + } + toLowerCase() { + return new ZodString({ + ...this._def, + checks: [...this._def.checks, { kind: "toLowerCase" }], + }); + } + toUpperCase() { + return new ZodString({ + ...this._def, + checks: [...this._def.checks, { kind: "toUpperCase" }], + }); + } + get isDatetime() { + return !!this._def.checks.find((ch) => ch.kind === "datetime"); + } + get isDate() { + return !!this._def.checks.find((ch) => ch.kind === "date"); + } + get isTime() { + return !!this._def.checks.find((ch) => ch.kind === "time"); + } + get isDuration() { + return !!this._def.checks.find((ch) => ch.kind === "duration"); + } + get isEmail() { + return !!this._def.checks.find((ch) => ch.kind === "email"); + } + get isURL() { + return !!this._def.checks.find((ch) => ch.kind === "url"); + } + get isEmoji() { + return !!this._def.checks.find((ch) => ch.kind === "emoji"); + } + get isUUID() { + return !!this._def.checks.find((ch) => ch.kind === "uuid"); + } + get isNANOID() { + return !!this._def.checks.find((ch) => ch.kind === "nanoid"); + } + get isCUID() { + return !!this._def.checks.find((ch) => ch.kind === "cuid"); + } + get isCUID2() { + return !!this._def.checks.find((ch) => ch.kind === "cuid2"); + } + get isULID() { + return !!this._def.checks.find((ch) => ch.kind === "ulid"); + } + get isIP() { + return !!this._def.checks.find((ch) => ch.kind === "ip"); + } + get isBase64() { + return !!this._def.checks.find((ch) => ch.kind === "base64"); + } + get minLength() { + let min = null; + for (const ch of this._def.checks) { + if (ch.kind === "min") { + if (min === null || ch.value > min) + min = ch.value; + } + } + return min; + } + get maxLength() { + let max = null; + for (const ch of this._def.checks) { + if (ch.kind === "max") { + if (max === null || ch.value < max) + max = ch.value; + } + } + return max; + } + } + ZodString.create = (params) => { + var _a; + return new ZodString({ + checks: [], + typeName: exports.ZodFirstPartyTypeKind.ZodString, + coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false, + ...processCreateParams(params), + }); + }; + // https://stackoverflow.com/questions/3966484/why-does-modulus-operator-return-fractional-number-in-javascript/31711034#31711034 + function floatSafeRemainder(val, step) { + const valDecCount = (val.toString().split(".")[1] || "").length; + const stepDecCount = (step.toString().split(".")[1] || "").length; + const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount; + const valInt = parseInt(val.toFixed(decCount).replace(".", "")); + const stepInt = parseInt(step.toFixed(decCount).replace(".", "")); + return (valInt % stepInt) / Math.pow(10, decCount); + } + class ZodNumber extends ZodType { + constructor() { + super(...arguments); + this.min = this.gte; + this.max = this.lte; + this.step = this.multipleOf; + } + _parse(input) { + if (this._def.coerce) { + input.data = Number(input.data); + } + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.number) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.number, + received: ctx.parsedType, + }); + return INVALID; + } + let ctx = undefined; + const status = new ParseStatus(); + for (const check of this._def.checks) { + if (check.kind === "int") { + if (!exports.util.isInteger(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: "integer", + received: "float", + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "min") { + const tooSmall = check.inclusive + ? input.data < check.value + : input.data <= check.value; + if (tooSmall) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.too_small, + minimum: check.value, + type: "number", + inclusive: check.inclusive, + exact: false, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "max") { + const tooBig = check.inclusive + ? input.data > check.value + : input.data >= check.value; + if (tooBig) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.too_big, + maximum: check.value, + type: "number", + inclusive: check.inclusive, + exact: false, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "multipleOf") { + if (floatSafeRemainder(input.data, check.value) !== 0) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.not_multiple_of, + multipleOf: check.value, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "finite") { + if (!Number.isFinite(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.not_finite, + message: check.message, + }); + status.dirty(); + } + } + else { + exports.util.assertNever(check); + } + } + return { status: status.value, value: input.data }; + } + gte(value, message) { + return this.setLimit("min", value, true, errorUtil.toString(message)); + } + gt(value, message) { + return this.setLimit("min", value, false, errorUtil.toString(message)); + } + lte(value, message) { + return this.setLimit("max", value, true, errorUtil.toString(message)); + } + lt(value, message) { + return this.setLimit("max", value, false, errorUtil.toString(message)); + } + setLimit(kind, value, inclusive, message) { + return new ZodNumber({ + ...this._def, + checks: [ + ...this._def.checks, + { + kind, + value, + inclusive, + message: errorUtil.toString(message), + }, + ], + }); + } + _addCheck(check) { + return new ZodNumber({ + ...this._def, + checks: [...this._def.checks, check], + }); + } + int(message) { + return this._addCheck({ + kind: "int", + message: errorUtil.toString(message), + }); + } + positive(message) { + return this._addCheck({ + kind: "min", + value: 0, + inclusive: false, + message: errorUtil.toString(message), + }); + } + negative(message) { + return this._addCheck({ + kind: "max", + value: 0, + inclusive: false, + message: errorUtil.toString(message), + }); + } + nonpositive(message) { + return this._addCheck({ + kind: "max", + value: 0, + inclusive: true, + message: errorUtil.toString(message), + }); + } + nonnegative(message) { + return this._addCheck({ + kind: "min", + value: 0, + inclusive: true, + message: errorUtil.toString(message), + }); + } + multipleOf(value, message) { + return this._addCheck({ + kind: "multipleOf", + value: value, + message: errorUtil.toString(message), + }); + } + finite(message) { + return this._addCheck({ + kind: "finite", + message: errorUtil.toString(message), + }); + } + safe(message) { + return this._addCheck({ + kind: "min", + inclusive: true, + value: Number.MIN_SAFE_INTEGER, + message: errorUtil.toString(message), + })._addCheck({ + kind: "max", + inclusive: true, + value: Number.MAX_SAFE_INTEGER, + message: errorUtil.toString(message), + }); + } + get minValue() { + let min = null; + for (const ch of this._def.checks) { + if (ch.kind === "min") { + if (min === null || ch.value > min) + min = ch.value; + } + } + return min; + } + get maxValue() { + let max = null; + for (const ch of this._def.checks) { + if (ch.kind === "max") { + if (max === null || ch.value < max) + max = ch.value; + } + } + return max; + } + get isInt() { + return !!this._def.checks.find((ch) => ch.kind === "int" || + (ch.kind === "multipleOf" && exports.util.isInteger(ch.value))); + } + get isFinite() { + let max = null, min = null; + for (const ch of this._def.checks) { + if (ch.kind === "finite" || + ch.kind === "int" || + ch.kind === "multipleOf") { + return true; + } + else if (ch.kind === "min") { + if (min === null || ch.value > min) + min = ch.value; + } + else if (ch.kind === "max") { + if (max === null || ch.value < max) + max = ch.value; + } + } + return Number.isFinite(min) && Number.isFinite(max); + } + } + ZodNumber.create = (params) => { + return new ZodNumber({ + checks: [], + typeName: exports.ZodFirstPartyTypeKind.ZodNumber, + coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false, + ...processCreateParams(params), + }); + }; + class ZodBigInt extends ZodType { + constructor() { + super(...arguments); + this.min = this.gte; + this.max = this.lte; + } + _parse(input) { + if (this._def.coerce) { + input.data = BigInt(input.data); + } + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.bigint) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.bigint, + received: ctx.parsedType, + }); + return INVALID; + } + let ctx = undefined; + const status = new ParseStatus(); + for (const check of this._def.checks) { + if (check.kind === "min") { + const tooSmall = check.inclusive + ? input.data < check.value + : input.data <= check.value; + if (tooSmall) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.too_small, + type: "bigint", + minimum: check.value, + inclusive: check.inclusive, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "max") { + const tooBig = check.inclusive + ? input.data > check.value + : input.data >= check.value; + if (tooBig) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.too_big, + type: "bigint", + maximum: check.value, + inclusive: check.inclusive, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "multipleOf") { + if (input.data % check.value !== BigInt(0)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.not_multiple_of, + multipleOf: check.value, + message: check.message, + }); + status.dirty(); + } + } + else { + exports.util.assertNever(check); + } + } + return { status: status.value, value: input.data }; + } + gte(value, message) { + return this.setLimit("min", value, true, errorUtil.toString(message)); + } + gt(value, message) { + return this.setLimit("min", value, false, errorUtil.toString(message)); + } + lte(value, message) { + return this.setLimit("max", value, true, errorUtil.toString(message)); + } + lt(value, message) { + return this.setLimit("max", value, false, errorUtil.toString(message)); + } + setLimit(kind, value, inclusive, message) { + return new ZodBigInt({ + ...this._def, + checks: [ + ...this._def.checks, + { + kind, + value, + inclusive, + message: errorUtil.toString(message), + }, + ], + }); + } + _addCheck(check) { + return new ZodBigInt({ + ...this._def, + checks: [...this._def.checks, check], + }); + } + positive(message) { + return this._addCheck({ + kind: "min", + value: BigInt(0), + inclusive: false, + message: errorUtil.toString(message), + }); + } + negative(message) { + return this._addCheck({ + kind: "max", + value: BigInt(0), + inclusive: false, + message: errorUtil.toString(message), + }); + } + nonpositive(message) { + return this._addCheck({ + kind: "max", + value: BigInt(0), + inclusive: true, + message: errorUtil.toString(message), + }); + } + nonnegative(message) { + return this._addCheck({ + kind: "min", + value: BigInt(0), + inclusive: true, + message: errorUtil.toString(message), + }); + } + multipleOf(value, message) { + return this._addCheck({ + kind: "multipleOf", + value, + message: errorUtil.toString(message), + }); + } + get minValue() { + let min = null; + for (const ch of this._def.checks) { + if (ch.kind === "min") { + if (min === null || ch.value > min) + min = ch.value; + } + } + return min; + } + get maxValue() { + let max = null; + for (const ch of this._def.checks) { + if (ch.kind === "max") { + if (max === null || ch.value < max) + max = ch.value; + } + } + return max; + } + } + ZodBigInt.create = (params) => { + var _a; + return new ZodBigInt({ + checks: [], + typeName: exports.ZodFirstPartyTypeKind.ZodBigInt, + coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false, + ...processCreateParams(params), + }); + }; + class ZodBoolean extends ZodType { + _parse(input) { + if (this._def.coerce) { + input.data = Boolean(input.data); + } + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.boolean) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.boolean, + received: ctx.parsedType, + }); + return INVALID; + } + return OK(input.data); + } + } + ZodBoolean.create = (params) => { + return new ZodBoolean({ + typeName: exports.ZodFirstPartyTypeKind.ZodBoolean, + coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false, + ...processCreateParams(params), + }); + }; + class ZodDate extends ZodType { + _parse(input) { + if (this._def.coerce) { + input.data = new Date(input.data); + } + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.date) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.date, + received: ctx.parsedType, + }); + return INVALID; + } + if (isNaN(input.data.getTime())) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_date, + }); + return INVALID; + } + const status = new ParseStatus(); + let ctx = undefined; + for (const check of this._def.checks) { + if (check.kind === "min") { + if (input.data.getTime() < check.value) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.too_small, + message: check.message, + inclusive: true, + exact: false, + minimum: check.value, + type: "date", + }); + status.dirty(); + } + } + else if (check.kind === "max") { + if (input.data.getTime() > check.value) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.too_big, + message: check.message, + inclusive: true, + exact: false, + maximum: check.value, + type: "date", + }); + status.dirty(); + } + } + else { + exports.util.assertNever(check); + } + } + return { + status: status.value, + value: new Date(input.data.getTime()), + }; + } + _addCheck(check) { + return new ZodDate({ + ...this._def, + checks: [...this._def.checks, check], + }); + } + min(minDate, message) { + return this._addCheck({ + kind: "min", + value: minDate.getTime(), + message: errorUtil.toString(message), + }); + } + max(maxDate, message) { + return this._addCheck({ + kind: "max", + value: maxDate.getTime(), + message: errorUtil.toString(message), + }); + } + get minDate() { + let min = null; + for (const ch of this._def.checks) { + if (ch.kind === "min") { + if (min === null || ch.value > min) + min = ch.value; + } + } + return min != null ? new Date(min) : null; + } + get maxDate() { + let max = null; + for (const ch of this._def.checks) { + if (ch.kind === "max") { + if (max === null || ch.value < max) + max = ch.value; + } + } + return max != null ? new Date(max) : null; + } + } + ZodDate.create = (params) => { + return new ZodDate({ + checks: [], + coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false, + typeName: exports.ZodFirstPartyTypeKind.ZodDate, + ...processCreateParams(params), + }); + }; + class ZodSymbol extends ZodType { + _parse(input) { + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.symbol) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.symbol, + received: ctx.parsedType, + }); + return INVALID; + } + return OK(input.data); + } + } + ZodSymbol.create = (params) => { + return new ZodSymbol({ + typeName: exports.ZodFirstPartyTypeKind.ZodSymbol, + ...processCreateParams(params), + }); + }; + class ZodUndefined extends ZodType { + _parse(input) { + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.undefined) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.undefined, + received: ctx.parsedType, + }); + return INVALID; + } + return OK(input.data); + } + } + ZodUndefined.create = (params) => { + return new ZodUndefined({ + typeName: exports.ZodFirstPartyTypeKind.ZodUndefined, + ...processCreateParams(params), + }); + }; + class ZodNull extends ZodType { + _parse(input) { + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.null) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.null, + received: ctx.parsedType, + }); + return INVALID; + } + return OK(input.data); + } + } + ZodNull.create = (params) => { + return new ZodNull({ + typeName: exports.ZodFirstPartyTypeKind.ZodNull, + ...processCreateParams(params), + }); + }; + class ZodAny extends ZodType { + constructor() { + super(...arguments); + // to prevent instances of other classes from extending ZodAny. this causes issues with catchall in ZodObject. + this._any = true; + } + _parse(input) { + return OK(input.data); + } + } + ZodAny.create = (params) => { + return new ZodAny({ + typeName: exports.ZodFirstPartyTypeKind.ZodAny, + ...processCreateParams(params), + }); + }; + class ZodUnknown extends ZodType { + constructor() { + super(...arguments); + // required + this._unknown = true; + } + _parse(input) { + return OK(input.data); + } + } + ZodUnknown.create = (params) => { + return new ZodUnknown({ + typeName: exports.ZodFirstPartyTypeKind.ZodUnknown, + ...processCreateParams(params), + }); + }; + class ZodNever extends ZodType { + _parse(input) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.never, + received: ctx.parsedType, + }); + return INVALID; + } + } + ZodNever.create = (params) => { + return new ZodNever({ + typeName: exports.ZodFirstPartyTypeKind.ZodNever, + ...processCreateParams(params), + }); + }; + class ZodVoid extends ZodType { + _parse(input) { + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.undefined) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.void, + received: ctx.parsedType, + }); + return INVALID; + } + return OK(input.data); + } + } + ZodVoid.create = (params) => { + return new ZodVoid({ + typeName: exports.ZodFirstPartyTypeKind.ZodVoid, + ...processCreateParams(params), + }); + }; + class ZodArray extends ZodType { + _parse(input) { + const { ctx, status } = this._processInputParams(input); + const def = this._def; + if (ctx.parsedType !== ZodParsedType.array) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.array, + received: ctx.parsedType, + }); + return INVALID; + } + if (def.exactLength !== null) { + const tooBig = ctx.data.length > def.exactLength.value; + const tooSmall = ctx.data.length < def.exactLength.value; + if (tooBig || tooSmall) { + addIssueToContext(ctx, { + code: tooBig ? ZodIssueCode.too_big : ZodIssueCode.too_small, + minimum: (tooSmall ? def.exactLength.value : undefined), + maximum: (tooBig ? def.exactLength.value : undefined), + type: "array", + inclusive: true, + exact: true, + message: def.exactLength.message, + }); + status.dirty(); + } + } + if (def.minLength !== null) { + if (ctx.data.length < def.minLength.value) { + addIssueToContext(ctx, { + code: ZodIssueCode.too_small, + minimum: def.minLength.value, + type: "array", + inclusive: true, + exact: false, + message: def.minLength.message, + }); + status.dirty(); + } + } + if (def.maxLength !== null) { + if (ctx.data.length > def.maxLength.value) { + addIssueToContext(ctx, { + code: ZodIssueCode.too_big, + maximum: def.maxLength.value, + type: "array", + inclusive: true, + exact: false, + message: def.maxLength.message, + }); + status.dirty(); + } + } + if (ctx.common.async) { + return Promise.all([...ctx.data].map((item, i) => { + return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i)); + })).then((result) => { + return ParseStatus.mergeArray(status, result); + }); + } + const result = [...ctx.data].map((item, i) => { + return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i)); + }); + return ParseStatus.mergeArray(status, result); + } + get element() { + return this._def.type; + } + min(minLength, message) { + return new ZodArray({ + ...this._def, + minLength: { value: minLength, message: errorUtil.toString(message) }, + }); + } + max(maxLength, message) { + return new ZodArray({ + ...this._def, + maxLength: { value: maxLength, message: errorUtil.toString(message) }, + }); + } + length(len, message) { + return new ZodArray({ + ...this._def, + exactLength: { value: len, message: errorUtil.toString(message) }, + }); + } + nonempty(message) { + return this.min(1, message); + } + } + ZodArray.create = (schema, params) => { + return new ZodArray({ + type: schema, + minLength: null, + maxLength: null, + exactLength: null, + typeName: exports.ZodFirstPartyTypeKind.ZodArray, + ...processCreateParams(params), + }); + }; + function deepPartialify(schema) { + if (schema instanceof ZodObject) { + const newShape = {}; + for (const key in schema.shape) { + const fieldSchema = schema.shape[key]; + newShape[key] = ZodOptional.create(deepPartialify(fieldSchema)); + } + return new ZodObject({ + ...schema._def, + shape: () => newShape, + }); + } + else if (schema instanceof ZodArray) { + return new ZodArray({ + ...schema._def, + type: deepPartialify(schema.element), + }); + } + else if (schema instanceof ZodOptional) { + return ZodOptional.create(deepPartialify(schema.unwrap())); + } + else if (schema instanceof ZodNullable) { + return ZodNullable.create(deepPartialify(schema.unwrap())); + } + else if (schema instanceof ZodTuple) { + return ZodTuple.create(schema.items.map((item) => deepPartialify(item))); + } + else { + return schema; + } + } + class ZodObject extends ZodType { + constructor() { + super(...arguments); + this._cached = null; + /** + * @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped. + * If you want to pass through unknown properties, use `.passthrough()` instead. + */ + this.nonstrict = this.passthrough; + // extend< + // Augmentation extends ZodRawShape, + // NewOutput extends util.flatten<{ + // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation + // ? Augmentation[k]["_output"] + // : k extends keyof Output + // ? Output[k] + // : never; + // }>, + // NewInput extends util.flatten<{ + // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation + // ? Augmentation[k]["_input"] + // : k extends keyof Input + // ? Input[k] + // : never; + // }> + // >( + // augmentation: Augmentation + // ): ZodObject< + // extendShape, + // UnknownKeys, + // Catchall, + // NewOutput, + // NewInput + // > { + // return new ZodObject({ + // ...this._def, + // shape: () => ({ + // ...this._def.shape(), + // ...augmentation, + // }), + // }) as any; + // } + /** + * @deprecated Use `.extend` instead + * */ + this.augment = this.extend; + } + _getCached() { + if (this._cached !== null) + return this._cached; + const shape = this._def.shape(); + const keys = exports.util.objectKeys(shape); + return (this._cached = { shape, keys }); + } + _parse(input) { + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.object) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.object, + received: ctx.parsedType, + }); + return INVALID; + } + const { status, ctx } = this._processInputParams(input); + const { shape, keys: shapeKeys } = this._getCached(); + const extraKeys = []; + if (!(this._def.catchall instanceof ZodNever && + this._def.unknownKeys === "strip")) { + for (const key in ctx.data) { + if (!shapeKeys.includes(key)) { + extraKeys.push(key); + } + } + } + const pairs = []; + for (const key of shapeKeys) { + const keyValidator = shape[key]; + const value = ctx.data[key]; + pairs.push({ + key: { status: "valid", value: key }, + value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)), + alwaysSet: key in ctx.data, + }); + } + if (this._def.catchall instanceof ZodNever) { + const unknownKeys = this._def.unknownKeys; + if (unknownKeys === "passthrough") { + for (const key of extraKeys) { + pairs.push({ + key: { status: "valid", value: key }, + value: { status: "valid", value: ctx.data[key] }, + }); + } + } + else if (unknownKeys === "strict") { + if (extraKeys.length > 0) { + addIssueToContext(ctx, { + code: ZodIssueCode.unrecognized_keys, + keys: extraKeys, + }); + status.dirty(); + } + } + else if (unknownKeys === "strip") ; + else { + throw new Error(`Internal ZodObject error: invalid unknownKeys value.`); + } + } + else { + // run catchall validation + const catchall = this._def.catchall; + for (const key of extraKeys) { + const value = ctx.data[key]; + pairs.push({ + key: { status: "valid", value: key }, + value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key) //, ctx.child(key), value, getParsedType(value) + ), + alwaysSet: key in ctx.data, + }); + } + } + if (ctx.common.async) { + return Promise.resolve() + .then(async () => { + const syncPairs = []; + for (const pair of pairs) { + const key = await pair.key; + const value = await pair.value; + syncPairs.push({ + key, + value, + alwaysSet: pair.alwaysSet, + }); + } + return syncPairs; + }) + .then((syncPairs) => { + return ParseStatus.mergeObjectSync(status, syncPairs); + }); + } + else { + return ParseStatus.mergeObjectSync(status, pairs); + } + } + get shape() { + return this._def.shape(); + } + strict(message) { + errorUtil.errToObj; + return new ZodObject({ + ...this._def, + unknownKeys: "strict", + ...(message !== undefined + ? { + errorMap: (issue, ctx) => { + var _a, _b, _c, _d; + const defaultError = (_c = (_b = (_a = this._def).errorMap) === null || _b === void 0 ? void 0 : _b.call(_a, issue, ctx).message) !== null && _c !== void 0 ? _c : ctx.defaultError; + if (issue.code === "unrecognized_keys") + return { + message: (_d = errorUtil.errToObj(message).message) !== null && _d !== void 0 ? _d : defaultError, + }; + return { + message: defaultError, + }; + }, + } + : {}), + }); + } + strip() { + return new ZodObject({ + ...this._def, + unknownKeys: "strip", + }); + } + passthrough() { + return new ZodObject({ + ...this._def, + unknownKeys: "passthrough", + }); + } + // const AugmentFactory = + // (def: Def) => + // ( + // augmentation: Augmentation + // ): ZodObject< + // extendShape, Augmentation>, + // Def["unknownKeys"], + // Def["catchall"] + // > => { + // return new ZodObject({ + // ...def, + // shape: () => ({ + // ...def.shape(), + // ...augmentation, + // }), + // }) as any; + // }; + extend(augmentation) { + return new ZodObject({ + ...this._def, + shape: () => ({ + ...this._def.shape(), + ...augmentation, + }), + }); + } + /** + * Prior to zod@1.0.12 there was a bug in the + * inferred type of merged objects. Please + * upgrade if you are experiencing issues. + */ + merge(merging) { + const merged = new ZodObject({ + unknownKeys: merging._def.unknownKeys, + catchall: merging._def.catchall, + shape: () => ({ + ...this._def.shape(), + ...merging._def.shape(), + }), + typeName: exports.ZodFirstPartyTypeKind.ZodObject, + }); + return merged; + } + // merge< + // Incoming extends AnyZodObject, + // Augmentation extends Incoming["shape"], + // NewOutput extends { + // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation + // ? Augmentation[k]["_output"] + // : k extends keyof Output + // ? Output[k] + // : never; + // }, + // NewInput extends { + // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation + // ? Augmentation[k]["_input"] + // : k extends keyof Input + // ? Input[k] + // : never; + // } + // >( + // merging: Incoming + // ): ZodObject< + // extendShape>, + // Incoming["_def"]["unknownKeys"], + // Incoming["_def"]["catchall"], + // NewOutput, + // NewInput + // > { + // const merged: any = new ZodObject({ + // unknownKeys: merging._def.unknownKeys, + // catchall: merging._def.catchall, + // shape: () => + // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()), + // typeName: ZodFirstPartyTypeKind.ZodObject, + // }) as any; + // return merged; + // } + setKey(key, schema) { + return this.augment({ [key]: schema }); + } + // merge( + // merging: Incoming + // ): //ZodObject = (merging) => { + // ZodObject< + // extendShape>, + // Incoming["_def"]["unknownKeys"], + // Incoming["_def"]["catchall"] + // > { + // // const mergedShape = objectUtil.mergeShapes( + // // this._def.shape(), + // // merging._def.shape() + // // ); + // const merged: any = new ZodObject({ + // unknownKeys: merging._def.unknownKeys, + // catchall: merging._def.catchall, + // shape: () => + // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()), + // typeName: ZodFirstPartyTypeKind.ZodObject, + // }) as any; + // return merged; + // } + catchall(index) { + return new ZodObject({ + ...this._def, + catchall: index, + }); + } + pick(mask) { + const shape = {}; + exports.util.objectKeys(mask).forEach((key) => { + if (mask[key] && this.shape[key]) { + shape[key] = this.shape[key]; + } + }); + return new ZodObject({ + ...this._def, + shape: () => shape, + }); + } + omit(mask) { + const shape = {}; + exports.util.objectKeys(this.shape).forEach((key) => { + if (!mask[key]) { + shape[key] = this.shape[key]; + } + }); + return new ZodObject({ + ...this._def, + shape: () => shape, + }); + } + /** + * @deprecated + */ + deepPartial() { + return deepPartialify(this); + } + partial(mask) { + const newShape = {}; + exports.util.objectKeys(this.shape).forEach((key) => { + const fieldSchema = this.shape[key]; + if (mask && !mask[key]) { + newShape[key] = fieldSchema; + } + else { + newShape[key] = fieldSchema.optional(); + } + }); + return new ZodObject({ + ...this._def, + shape: () => newShape, + }); + } + required(mask) { + const newShape = {}; + exports.util.objectKeys(this.shape).forEach((key) => { + if (mask && !mask[key]) { + newShape[key] = this.shape[key]; + } + else { + const fieldSchema = this.shape[key]; + let newField = fieldSchema; + while (newField instanceof ZodOptional) { + newField = newField._def.innerType; + } + newShape[key] = newField; + } + }); + return new ZodObject({ + ...this._def, + shape: () => newShape, + }); + } + keyof() { + return createZodEnum(exports.util.objectKeys(this.shape)); + } + } + ZodObject.create = (shape, params) => { + return new ZodObject({ + shape: () => shape, + unknownKeys: "strip", + catchall: ZodNever.create(), + typeName: exports.ZodFirstPartyTypeKind.ZodObject, + ...processCreateParams(params), + }); + }; + ZodObject.strictCreate = (shape, params) => { + return new ZodObject({ + shape: () => shape, + unknownKeys: "strict", + catchall: ZodNever.create(), + typeName: exports.ZodFirstPartyTypeKind.ZodObject, + ...processCreateParams(params), + }); + }; + ZodObject.lazycreate = (shape, params) => { + return new ZodObject({ + shape, + unknownKeys: "strip", + catchall: ZodNever.create(), + typeName: exports.ZodFirstPartyTypeKind.ZodObject, + ...processCreateParams(params), + }); + }; + class ZodUnion extends ZodType { + _parse(input) { + const { ctx } = this._processInputParams(input); + const options = this._def.options; + function handleResults(results) { + // return first issue-free validation if it exists + for (const result of results) { + if (result.result.status === "valid") { + return result.result; + } + } + for (const result of results) { + if (result.result.status === "dirty") { + // add issues from dirty option + ctx.common.issues.push(...result.ctx.common.issues); + return result.result; + } + } + // return invalid + const unionErrors = results.map((result) => new ZodError(result.ctx.common.issues)); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_union, + unionErrors, + }); + return INVALID; + } + if (ctx.common.async) { + return Promise.all(options.map(async (option) => { + const childCtx = { + ...ctx, + common: { + ...ctx.common, + issues: [], + }, + parent: null, + }; + return { + result: await option._parseAsync({ + data: ctx.data, + path: ctx.path, + parent: childCtx, + }), + ctx: childCtx, + }; + })).then(handleResults); + } + else { + let dirty = undefined; + const issues = []; + for (const option of options) { + const childCtx = { + ...ctx, + common: { + ...ctx.common, + issues: [], + }, + parent: null, + }; + const result = option._parseSync({ + data: ctx.data, + path: ctx.path, + parent: childCtx, + }); + if (result.status === "valid") { + return result; + } + else if (result.status === "dirty" && !dirty) { + dirty = { result, ctx: childCtx }; + } + if (childCtx.common.issues.length) { + issues.push(childCtx.common.issues); + } + } + if (dirty) { + ctx.common.issues.push(...dirty.ctx.common.issues); + return dirty.result; + } + const unionErrors = issues.map((issues) => new ZodError(issues)); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_union, + unionErrors, + }); + return INVALID; + } + } + get options() { + return this._def.options; + } + } + ZodUnion.create = (types, params) => { + return new ZodUnion({ + options: types, + typeName: exports.ZodFirstPartyTypeKind.ZodUnion, + ...processCreateParams(params), + }); + }; + ///////////////////////////////////////////////////// + ///////////////////////////////////////////////////// + ////////// ////////// + ////////// ZodDiscriminatedUnion ////////// + ////////// ////////// + ///////////////////////////////////////////////////// + ///////////////////////////////////////////////////// + const getDiscriminator = (type) => { + if (type instanceof ZodLazy) { + return getDiscriminator(type.schema); + } + else if (type instanceof ZodEffects) { + return getDiscriminator(type.innerType()); + } + else if (type instanceof ZodLiteral) { + return [type.value]; + } + else if (type instanceof ZodEnum) { + return type.options; + } + else if (type instanceof ZodNativeEnum) { + // eslint-disable-next-line ban/ban + return exports.util.objectValues(type.enum); + } + else if (type instanceof ZodDefault) { + return getDiscriminator(type._def.innerType); + } + else if (type instanceof ZodUndefined) { + return [undefined]; + } + else if (type instanceof ZodNull) { + return [null]; + } + else if (type instanceof ZodOptional) { + return [undefined, ...getDiscriminator(type.unwrap())]; + } + else if (type instanceof ZodNullable) { + return [null, ...getDiscriminator(type.unwrap())]; + } + else if (type instanceof ZodBranded) { + return getDiscriminator(type.unwrap()); + } + else if (type instanceof ZodReadonly) { + return getDiscriminator(type.unwrap()); + } + else if (type instanceof ZodCatch) { + return getDiscriminator(type._def.innerType); + } + else { + return []; + } + }; + class ZodDiscriminatedUnion extends ZodType { + _parse(input) { + const { ctx } = this._processInputParams(input); + if (ctx.parsedType !== ZodParsedType.object) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.object, + received: ctx.parsedType, + }); + return INVALID; + } + const discriminator = this.discriminator; + const discriminatorValue = ctx.data[discriminator]; + const option = this.optionsMap.get(discriminatorValue); + if (!option) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_union_discriminator, + options: Array.from(this.optionsMap.keys()), + path: [discriminator], + }); + return INVALID; + } + if (ctx.common.async) { + return option._parseAsync({ + data: ctx.data, + path: ctx.path, + parent: ctx, + }); + } + else { + return option._parseSync({ + data: ctx.data, + path: ctx.path, + parent: ctx, + }); + } + } + get discriminator() { + return this._def.discriminator; + } + get options() { + return this._def.options; + } + get optionsMap() { + return this._def.optionsMap; + } + /** + * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor. + * However, it only allows a union of objects, all of which need to share a discriminator property. This property must + * have a different value for each object in the union. + * @param discriminator the name of the discriminator property + * @param types an array of object schemas + * @param params + */ + static create(discriminator, options, params) { + // Get all the valid discriminator values + const optionsMap = new Map(); + // try { + for (const type of options) { + const discriminatorValues = getDiscriminator(type.shape[discriminator]); + if (!discriminatorValues.length) { + throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`); + } + for (const value of discriminatorValues) { + if (optionsMap.has(value)) { + throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`); + } + optionsMap.set(value, type); + } + } + return new ZodDiscriminatedUnion({ + typeName: exports.ZodFirstPartyTypeKind.ZodDiscriminatedUnion, + discriminator, + options, + optionsMap, + ...processCreateParams(params), + }); + } + } + function mergeValues(a, b) { + const aType = getParsedType(a); + const bType = getParsedType(b); + if (a === b) { + return { valid: true, data: a }; + } + else if (aType === ZodParsedType.object && bType === ZodParsedType.object) { + const bKeys = exports.util.objectKeys(b); + const sharedKeys = exports.util + .objectKeys(a) + .filter((key) => bKeys.indexOf(key) !== -1); + const newObj = { ...a, ...b }; + for (const key of sharedKeys) { + const sharedValue = mergeValues(a[key], b[key]); + if (!sharedValue.valid) { + return { valid: false }; + } + newObj[key] = sharedValue.data; + } + return { valid: true, data: newObj }; + } + else if (aType === ZodParsedType.array && bType === ZodParsedType.array) { + if (a.length !== b.length) { + return { valid: false }; + } + const newArray = []; + for (let index = 0; index < a.length; index++) { + const itemA = a[index]; + const itemB = b[index]; + const sharedValue = mergeValues(itemA, itemB); + if (!sharedValue.valid) { + return { valid: false }; + } + newArray.push(sharedValue.data); + } + return { valid: true, data: newArray }; + } + else if (aType === ZodParsedType.date && + bType === ZodParsedType.date && + +a === +b) { + return { valid: true, data: a }; + } + else { + return { valid: false }; + } + } + class ZodIntersection extends ZodType { + _parse(input) { + const { status, ctx } = this._processInputParams(input); + const handleParsed = (parsedLeft, parsedRight) => { + if (isAborted(parsedLeft) || isAborted(parsedRight)) { + return INVALID; + } + const merged = mergeValues(parsedLeft.value, parsedRight.value); + if (!merged.valid) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_intersection_types, + }); + return INVALID; + } + if (isDirty(parsedLeft) || isDirty(parsedRight)) { + status.dirty(); + } + return { status: status.value, value: merged.data }; + }; + if (ctx.common.async) { + return Promise.all([ + this._def.left._parseAsync({ + data: ctx.data, + path: ctx.path, + parent: ctx, + }), + this._def.right._parseAsync({ + data: ctx.data, + path: ctx.path, + parent: ctx, + }), + ]).then(([left, right]) => handleParsed(left, right)); + } + else { + return handleParsed(this._def.left._parseSync({ + data: ctx.data, + path: ctx.path, + parent: ctx, + }), this._def.right._parseSync({ + data: ctx.data, + path: ctx.path, + parent: ctx, + })); + } + } + } + ZodIntersection.create = (left, right, params) => { + return new ZodIntersection({ + left: left, + right: right, + typeName: exports.ZodFirstPartyTypeKind.ZodIntersection, + ...processCreateParams(params), + }); + }; + class ZodTuple extends ZodType { + _parse(input) { + const { status, ctx } = this._processInputParams(input); + if (ctx.parsedType !== ZodParsedType.array) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.array, + received: ctx.parsedType, + }); + return INVALID; + } + if (ctx.data.length < this._def.items.length) { + addIssueToContext(ctx, { + code: ZodIssueCode.too_small, + minimum: this._def.items.length, + inclusive: true, + exact: false, + type: "array", + }); + return INVALID; + } + const rest = this._def.rest; + if (!rest && ctx.data.length > this._def.items.length) { + addIssueToContext(ctx, { + code: ZodIssueCode.too_big, + maximum: this._def.items.length, + inclusive: true, + exact: false, + type: "array", + }); + status.dirty(); + } + const items = [...ctx.data] + .map((item, itemIndex) => { + const schema = this._def.items[itemIndex] || this._def.rest; + if (!schema) + return null; + return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex)); + }) + .filter((x) => !!x); // filter nulls + if (ctx.common.async) { + return Promise.all(items).then((results) => { + return ParseStatus.mergeArray(status, results); + }); + } + else { + return ParseStatus.mergeArray(status, items); + } + } + get items() { + return this._def.items; + } + rest(rest) { + return new ZodTuple({ + ...this._def, + rest, + }); + } + } + ZodTuple.create = (schemas, params) => { + if (!Array.isArray(schemas)) { + throw new Error("You must pass an array of schemas to z.tuple([ ... ])"); + } + return new ZodTuple({ + items: schemas, + typeName: exports.ZodFirstPartyTypeKind.ZodTuple, + rest: null, + ...processCreateParams(params), + }); + }; + class ZodRecord extends ZodType { + get keySchema() { + return this._def.keyType; + } + get valueSchema() { + return this._def.valueType; + } + _parse(input) { + const { status, ctx } = this._processInputParams(input); + if (ctx.parsedType !== ZodParsedType.object) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.object, + received: ctx.parsedType, + }); + return INVALID; + } + const pairs = []; + const keyType = this._def.keyType; + const valueType = this._def.valueType; + for (const key in ctx.data) { + pairs.push({ + key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)), + value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)), + alwaysSet: key in ctx.data, + }); + } + if (ctx.common.async) { + return ParseStatus.mergeObjectAsync(status, pairs); + } + else { + return ParseStatus.mergeObjectSync(status, pairs); + } + } + get element() { + return this._def.valueType; + } + static create(first, second, third) { + if (second instanceof ZodType) { + return new ZodRecord({ + keyType: first, + valueType: second, + typeName: exports.ZodFirstPartyTypeKind.ZodRecord, + ...processCreateParams(third), + }); + } + return new ZodRecord({ + keyType: ZodString.create(), + valueType: first, + typeName: exports.ZodFirstPartyTypeKind.ZodRecord, + ...processCreateParams(second), + }); + } + } + class ZodMap extends ZodType { + get keySchema() { + return this._def.keyType; + } + get valueSchema() { + return this._def.valueType; + } + _parse(input) { + const { status, ctx } = this._processInputParams(input); + if (ctx.parsedType !== ZodParsedType.map) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.map, + received: ctx.parsedType, + }); + return INVALID; + } + const keyType = this._def.keyType; + const valueType = this._def.valueType; + const pairs = [...ctx.data.entries()].map(([key, value], index) => { + return { + key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index, "key"])), + value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, "value"])), + }; + }); + if (ctx.common.async) { + const finalMap = new Map(); + return Promise.resolve().then(async () => { + for (const pair of pairs) { + const key = await pair.key; + const value = await pair.value; + if (key.status === "aborted" || value.status === "aborted") { + return INVALID; + } + if (key.status === "dirty" || value.status === "dirty") { + status.dirty(); + } + finalMap.set(key.value, value.value); + } + return { status: status.value, value: finalMap }; + }); + } + else { + const finalMap = new Map(); + for (const pair of pairs) { + const key = pair.key; + const value = pair.value; + if (key.status === "aborted" || value.status === "aborted") { + return INVALID; + } + if (key.status === "dirty" || value.status === "dirty") { + status.dirty(); + } + finalMap.set(key.value, value.value); + } + return { status: status.value, value: finalMap }; + } + } + } + ZodMap.create = (keyType, valueType, params) => { + return new ZodMap({ + valueType, + keyType, + typeName: exports.ZodFirstPartyTypeKind.ZodMap, + ...processCreateParams(params), + }); + }; + class ZodSet extends ZodType { + _parse(input) { + const { status, ctx } = this._processInputParams(input); + if (ctx.parsedType !== ZodParsedType.set) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.set, + received: ctx.parsedType, + }); + return INVALID; + } + const def = this._def; + if (def.minSize !== null) { + if (ctx.data.size < def.minSize.value) { + addIssueToContext(ctx, { + code: ZodIssueCode.too_small, + minimum: def.minSize.value, + type: "set", + inclusive: true, + exact: false, + message: def.minSize.message, + }); + status.dirty(); + } + } + if (def.maxSize !== null) { + if (ctx.data.size > def.maxSize.value) { + addIssueToContext(ctx, { + code: ZodIssueCode.too_big, + maximum: def.maxSize.value, + type: "set", + inclusive: true, + exact: false, + message: def.maxSize.message, + }); + status.dirty(); + } + } + const valueType = this._def.valueType; + function finalizeSet(elements) { + const parsedSet = new Set(); + for (const element of elements) { + if (element.status === "aborted") + return INVALID; + if (element.status === "dirty") + status.dirty(); + parsedSet.add(element.value); + } + return { status: status.value, value: parsedSet }; + } + const elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i))); + if (ctx.common.async) { + return Promise.all(elements).then((elements) => finalizeSet(elements)); + } + else { + return finalizeSet(elements); + } + } + min(minSize, message) { + return new ZodSet({ + ...this._def, + minSize: { value: minSize, message: errorUtil.toString(message) }, + }); + } + max(maxSize, message) { + return new ZodSet({ + ...this._def, + maxSize: { value: maxSize, message: errorUtil.toString(message) }, + }); + } + size(size, message) { + return this.min(size, message).max(size, message); + } + nonempty(message) { + return this.min(1, message); + } + } + ZodSet.create = (valueType, params) => { + return new ZodSet({ + valueType, + minSize: null, + maxSize: null, + typeName: exports.ZodFirstPartyTypeKind.ZodSet, + ...processCreateParams(params), + }); + }; + class ZodFunction extends ZodType { + constructor() { + super(...arguments); + this.validate = this.implement; + } + _parse(input) { + const { ctx } = this._processInputParams(input); + if (ctx.parsedType !== ZodParsedType.function) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.function, + received: ctx.parsedType, + }); + return INVALID; + } + function makeArgsIssue(args, error) { + return makeIssue({ + data: args, + path: ctx.path, + errorMaps: [ + ctx.common.contextualErrorMap, + ctx.schemaErrorMap, + getErrorMap(), + errorMap, + ].filter((x) => !!x), + issueData: { + code: ZodIssueCode.invalid_arguments, + argumentsError: error, + }, + }); + } + function makeReturnsIssue(returns, error) { + return makeIssue({ + data: returns, + path: ctx.path, + errorMaps: [ + ctx.common.contextualErrorMap, + ctx.schemaErrorMap, + getErrorMap(), + errorMap, + ].filter((x) => !!x), + issueData: { + code: ZodIssueCode.invalid_return_type, + returnTypeError: error, + }, + }); + } + const params = { errorMap: ctx.common.contextualErrorMap }; + const fn = ctx.data; + if (this._def.returns instanceof ZodPromise) { + // Would love a way to avoid disabling this rule, but we need + // an alias (using an arrow function was what caused 2651). + // eslint-disable-next-line @typescript-eslint/no-this-alias + const me = this; + return OK(async function (...args) { + const error = new ZodError([]); + const parsedArgs = await me._def.args + .parseAsync(args, params) + .catch((e) => { + error.addIssue(makeArgsIssue(args, e)); + throw error; + }); + const result = await Reflect.apply(fn, this, parsedArgs); + const parsedReturns = await me._def.returns._def.type + .parseAsync(result, params) + .catch((e) => { + error.addIssue(makeReturnsIssue(result, e)); + throw error; + }); + return parsedReturns; + }); + } + else { + // Would love a way to avoid disabling this rule, but we need + // an alias (using an arrow function was what caused 2651). + // eslint-disable-next-line @typescript-eslint/no-this-alias + const me = this; + return OK(function (...args) { + const parsedArgs = me._def.args.safeParse(args, params); + if (!parsedArgs.success) { + throw new ZodError([makeArgsIssue(args, parsedArgs.error)]); + } + const result = Reflect.apply(fn, this, parsedArgs.data); + const parsedReturns = me._def.returns.safeParse(result, params); + if (!parsedReturns.success) { + throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]); + } + return parsedReturns.data; + }); + } + } + parameters() { + return this._def.args; + } + returnType() { + return this._def.returns; + } + args(...items) { + return new ZodFunction({ + ...this._def, + args: ZodTuple.create(items).rest(ZodUnknown.create()), + }); + } + returns(returnType) { + return new ZodFunction({ + ...this._def, + returns: returnType, + }); + } + implement(func) { + const validatedFunc = this.parse(func); + return validatedFunc; + } + strictImplement(func) { + const validatedFunc = this.parse(func); + return validatedFunc; + } + static create(args, returns, params) { + return new ZodFunction({ + args: (args + ? args + : ZodTuple.create([]).rest(ZodUnknown.create())), + returns: returns || ZodUnknown.create(), + typeName: exports.ZodFirstPartyTypeKind.ZodFunction, + ...processCreateParams(params), + }); + } + } + class ZodLazy extends ZodType { + get schema() { + return this._def.getter(); + } + _parse(input) { + const { ctx } = this._processInputParams(input); + const lazySchema = this._def.getter(); + return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx }); + } + } + ZodLazy.create = (getter, params) => { + return new ZodLazy({ + getter: getter, + typeName: exports.ZodFirstPartyTypeKind.ZodLazy, + ...processCreateParams(params), + }); + }; + class ZodLiteral extends ZodType { + _parse(input) { + if (input.data !== this._def.value) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + received: ctx.data, + code: ZodIssueCode.invalid_literal, + expected: this._def.value, + }); + return INVALID; + } + return { status: "valid", value: input.data }; + } + get value() { + return this._def.value; + } + } + ZodLiteral.create = (value, params) => { + return new ZodLiteral({ + value: value, + typeName: exports.ZodFirstPartyTypeKind.ZodLiteral, + ...processCreateParams(params), + }); + }; + function createZodEnum(values, params) { + return new ZodEnum({ + values, + typeName: exports.ZodFirstPartyTypeKind.ZodEnum, + ...processCreateParams(params), + }); + } + class ZodEnum extends ZodType { + constructor() { + super(...arguments); + _ZodEnum_cache.set(this, void 0); + } + _parse(input) { + if (typeof input.data !== "string") { + const ctx = this._getOrReturnCtx(input); + const expectedValues = this._def.values; + addIssueToContext(ctx, { + expected: exports.util.joinValues(expectedValues), + received: ctx.parsedType, + code: ZodIssueCode.invalid_type, + }); + return INVALID; + } + if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f")) { + __classPrivateFieldSet(this, _ZodEnum_cache, new Set(this._def.values), "f"); + } + if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f").has(input.data)) { + const ctx = this._getOrReturnCtx(input); + const expectedValues = this._def.values; + addIssueToContext(ctx, { + received: ctx.data, + code: ZodIssueCode.invalid_enum_value, + options: expectedValues, + }); + return INVALID; + } + return OK(input.data); + } + get options() { + return this._def.values; + } + get enum() { + const enumValues = {}; + for (const val of this._def.values) { + enumValues[val] = val; + } + return enumValues; + } + get Values() { + const enumValues = {}; + for (const val of this._def.values) { + enumValues[val] = val; + } + return enumValues; + } + get Enum() { + const enumValues = {}; + for (const val of this._def.values) { + enumValues[val] = val; + } + return enumValues; + } + extract(values, newDef = this._def) { + return ZodEnum.create(values, { + ...this._def, + ...newDef, + }); + } + exclude(values, newDef = this._def) { + return ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), { + ...this._def, + ...newDef, + }); + } + } + _ZodEnum_cache = new WeakMap(); + ZodEnum.create = createZodEnum; + class ZodNativeEnum extends ZodType { + constructor() { + super(...arguments); + _ZodNativeEnum_cache.set(this, void 0); + } + _parse(input) { + const nativeEnumValues = exports.util.getValidEnumValues(this._def.values); + const ctx = this._getOrReturnCtx(input); + if (ctx.parsedType !== ZodParsedType.string && + ctx.parsedType !== ZodParsedType.number) { + const expectedValues = exports.util.objectValues(nativeEnumValues); + addIssueToContext(ctx, { + expected: exports.util.joinValues(expectedValues), + received: ctx.parsedType, + code: ZodIssueCode.invalid_type, + }); + return INVALID; + } + if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f")) { + __classPrivateFieldSet(this, _ZodNativeEnum_cache, new Set(exports.util.getValidEnumValues(this._def.values)), "f"); + } + if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f").has(input.data)) { + const expectedValues = exports.util.objectValues(nativeEnumValues); + addIssueToContext(ctx, { + received: ctx.data, + code: ZodIssueCode.invalid_enum_value, + options: expectedValues, + }); + return INVALID; + } + return OK(input.data); + } + get enum() { + return this._def.values; + } + } + _ZodNativeEnum_cache = new WeakMap(); + ZodNativeEnum.create = (values, params) => { + return new ZodNativeEnum({ + values: values, + typeName: exports.ZodFirstPartyTypeKind.ZodNativeEnum, + ...processCreateParams(params), + }); + }; + class ZodPromise extends ZodType { + unwrap() { + return this._def.type; + } + _parse(input) { + const { ctx } = this._processInputParams(input); + if (ctx.parsedType !== ZodParsedType.promise && + ctx.common.async === false) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.promise, + received: ctx.parsedType, + }); + return INVALID; + } + const promisified = ctx.parsedType === ZodParsedType.promise + ? ctx.data + : Promise.resolve(ctx.data); + return OK(promisified.then((data) => { + return this._def.type.parseAsync(data, { + path: ctx.path, + errorMap: ctx.common.contextualErrorMap, + }); + })); + } + } + ZodPromise.create = (schema, params) => { + return new ZodPromise({ + type: schema, + typeName: exports.ZodFirstPartyTypeKind.ZodPromise, + ...processCreateParams(params), + }); + }; + class ZodEffects extends ZodType { + innerType() { + return this._def.schema; + } + sourceType() { + return this._def.schema._def.typeName === exports.ZodFirstPartyTypeKind.ZodEffects + ? this._def.schema.sourceType() + : this._def.schema; + } + _parse(input) { + const { status, ctx } = this._processInputParams(input); + const effect = this._def.effect || null; + const checkCtx = { + addIssue: (arg) => { + addIssueToContext(ctx, arg); + if (arg.fatal) { + status.abort(); + } + else { + status.dirty(); + } + }, + get path() { + return ctx.path; + }, + }; + checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx); + if (effect.type === "preprocess") { + const processed = effect.transform(ctx.data, checkCtx); + if (ctx.common.async) { + return Promise.resolve(processed).then(async (processed) => { + if (status.value === "aborted") + return INVALID; + const result = await this._def.schema._parseAsync({ + data: processed, + path: ctx.path, + parent: ctx, + }); + if (result.status === "aborted") + return INVALID; + if (result.status === "dirty") + return DIRTY(result.value); + if (status.value === "dirty") + return DIRTY(result.value); + return result; + }); + } + else { + if (status.value === "aborted") + return INVALID; + const result = this._def.schema._parseSync({ + data: processed, + path: ctx.path, + parent: ctx, + }); + if (result.status === "aborted") + return INVALID; + if (result.status === "dirty") + return DIRTY(result.value); + if (status.value === "dirty") + return DIRTY(result.value); + return result; + } + } + if (effect.type === "refinement") { + const executeRefinement = (acc) => { + const result = effect.refinement(acc, checkCtx); + if (ctx.common.async) { + return Promise.resolve(result); + } + if (result instanceof Promise) { + throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead."); + } + return acc; + }; + if (ctx.common.async === false) { + const inner = this._def.schema._parseSync({ + data: ctx.data, + path: ctx.path, + parent: ctx, + }); + if (inner.status === "aborted") + return INVALID; + if (inner.status === "dirty") + status.dirty(); + // return value is ignored + executeRefinement(inner.value); + return { status: status.value, value: inner.value }; + } + else { + return this._def.schema + ._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }) + .then((inner) => { + if (inner.status === "aborted") + return INVALID; + if (inner.status === "dirty") + status.dirty(); + return executeRefinement(inner.value).then(() => { + return { status: status.value, value: inner.value }; + }); + }); + } + } + if (effect.type === "transform") { + if (ctx.common.async === false) { + const base = this._def.schema._parseSync({ + data: ctx.data, + path: ctx.path, + parent: ctx, + }); + if (!isValid(base)) + return base; + const result = effect.transform(base.value, checkCtx); + if (result instanceof Promise) { + throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`); + } + return { status: status.value, value: result }; + } + else { + return this._def.schema + ._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }) + .then((base) => { + if (!isValid(base)) + return base; + return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({ status: status.value, value: result })); + }); + } + } + exports.util.assertNever(effect); + } + } + ZodEffects.create = (schema, effect, params) => { + return new ZodEffects({ + schema, + typeName: exports.ZodFirstPartyTypeKind.ZodEffects, + effect, + ...processCreateParams(params), + }); + }; + ZodEffects.createWithPreprocess = (preprocess, schema, params) => { + return new ZodEffects({ + schema, + effect: { type: "preprocess", transform: preprocess }, + typeName: exports.ZodFirstPartyTypeKind.ZodEffects, + ...processCreateParams(params), + }); + }; + class ZodOptional extends ZodType { + _parse(input) { + const parsedType = this._getType(input); + if (parsedType === ZodParsedType.undefined) { + return OK(undefined); + } + return this._def.innerType._parse(input); + } + unwrap() { + return this._def.innerType; + } + } + ZodOptional.create = (type, params) => { + return new ZodOptional({ + innerType: type, + typeName: exports.ZodFirstPartyTypeKind.ZodOptional, + ...processCreateParams(params), + }); + }; + class ZodNullable extends ZodType { + _parse(input) { + const parsedType = this._getType(input); + if (parsedType === ZodParsedType.null) { + return OK(null); + } + return this._def.innerType._parse(input); + } + unwrap() { + return this._def.innerType; + } + } + ZodNullable.create = (type, params) => { + return new ZodNullable({ + innerType: type, + typeName: exports.ZodFirstPartyTypeKind.ZodNullable, + ...processCreateParams(params), + }); + }; + class ZodDefault extends ZodType { + _parse(input) { + const { ctx } = this._processInputParams(input); + let data = ctx.data; + if (ctx.parsedType === ZodParsedType.undefined) { + data = this._def.defaultValue(); + } + return this._def.innerType._parse({ + data, + path: ctx.path, + parent: ctx, + }); + } + removeDefault() { + return this._def.innerType; + } + } + ZodDefault.create = (type, params) => { + return new ZodDefault({ + innerType: type, + typeName: exports.ZodFirstPartyTypeKind.ZodDefault, + defaultValue: typeof params.default === "function" + ? params.default + : () => params.default, + ...processCreateParams(params), + }); + }; + class ZodCatch extends ZodType { + _parse(input) { + const { ctx } = this._processInputParams(input); + // newCtx is used to not collect issues from inner types in ctx + const newCtx = { + ...ctx, + common: { + ...ctx.common, + issues: [], + }, + }; + const result = this._def.innerType._parse({ + data: newCtx.data, + path: newCtx.path, + parent: { + ...newCtx, + }, + }); + if (isAsync(result)) { + return result.then((result) => { + return { + status: "valid", + value: result.status === "valid" + ? result.value + : this._def.catchValue({ + get error() { + return new ZodError(newCtx.common.issues); + }, + input: newCtx.data, + }), + }; + }); + } + else { + return { + status: "valid", + value: result.status === "valid" + ? result.value + : this._def.catchValue({ + get error() { + return new ZodError(newCtx.common.issues); + }, + input: newCtx.data, + }), + }; + } + } + removeCatch() { + return this._def.innerType; + } + } + ZodCatch.create = (type, params) => { + return new ZodCatch({ + innerType: type, + typeName: exports.ZodFirstPartyTypeKind.ZodCatch, + catchValue: typeof params.catch === "function" ? params.catch : () => params.catch, + ...processCreateParams(params), + }); + }; + class ZodNaN extends ZodType { + _parse(input) { + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.nan) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.nan, + received: ctx.parsedType, + }); + return INVALID; + } + return { status: "valid", value: input.data }; + } + } + ZodNaN.create = (params) => { + return new ZodNaN({ + typeName: exports.ZodFirstPartyTypeKind.ZodNaN, + ...processCreateParams(params), + }); + }; + const BRAND = Symbol("zod_brand"); + class ZodBranded extends ZodType { + _parse(input) { + const { ctx } = this._processInputParams(input); + const data = ctx.data; + return this._def.type._parse({ + data, + path: ctx.path, + parent: ctx, + }); + } + unwrap() { + return this._def.type; + } + } + class ZodPipeline extends ZodType { + _parse(input) { + const { status, ctx } = this._processInputParams(input); + if (ctx.common.async) { + const handleAsync = async () => { + const inResult = await this._def.in._parseAsync({ + data: ctx.data, + path: ctx.path, + parent: ctx, + }); + if (inResult.status === "aborted") + return INVALID; + if (inResult.status === "dirty") { + status.dirty(); + return DIRTY(inResult.value); + } + else { + return this._def.out._parseAsync({ + data: inResult.value, + path: ctx.path, + parent: ctx, + }); + } + }; + return handleAsync(); + } + else { + const inResult = this._def.in._parseSync({ + data: ctx.data, + path: ctx.path, + parent: ctx, + }); + if (inResult.status === "aborted") + return INVALID; + if (inResult.status === "dirty") { + status.dirty(); + return { + status: "dirty", + value: inResult.value, + }; + } + else { + return this._def.out._parseSync({ + data: inResult.value, + path: ctx.path, + parent: ctx, + }); + } + } + } + static create(a, b) { + return new ZodPipeline({ + in: a, + out: b, + typeName: exports.ZodFirstPartyTypeKind.ZodPipeline, + }); + } + } + class ZodReadonly extends ZodType { + _parse(input) { + const result = this._def.innerType._parse(input); + const freeze = (data) => { + if (isValid(data)) { + data.value = Object.freeze(data.value); + } + return data; + }; + return isAsync(result) + ? result.then((data) => freeze(data)) + : freeze(result); + } + unwrap() { + return this._def.innerType; + } + } + ZodReadonly.create = (type, params) => { + return new ZodReadonly({ + innerType: type, + typeName: exports.ZodFirstPartyTypeKind.ZodReadonly, + ...processCreateParams(params), + }); + }; + function custom(check, params = {}, + /** + * @deprecated + * + * Pass `fatal` into the params object instead: + * + * ```ts + * z.string().custom((val) => val.length > 5, { fatal: false }) + * ``` + * + */ + fatal) { + if (check) + return ZodAny.create().superRefine((data, ctx) => { + var _a, _b; + if (!check(data)) { + const p = typeof params === "function" + ? params(data) + : typeof params === "string" + ? { message: params } + : params; + const _fatal = (_b = (_a = p.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true; + const p2 = typeof p === "string" ? { message: p } : p; + ctx.addIssue({ code: "custom", ...p2, fatal: _fatal }); + } + }); + return ZodAny.create(); + } + const late = { + object: ZodObject.lazycreate, + }; + exports.ZodFirstPartyTypeKind = void 0; + (function (ZodFirstPartyTypeKind) { + ZodFirstPartyTypeKind["ZodString"] = "ZodString"; + ZodFirstPartyTypeKind["ZodNumber"] = "ZodNumber"; + ZodFirstPartyTypeKind["ZodNaN"] = "ZodNaN"; + ZodFirstPartyTypeKind["ZodBigInt"] = "ZodBigInt"; + ZodFirstPartyTypeKind["ZodBoolean"] = "ZodBoolean"; + ZodFirstPartyTypeKind["ZodDate"] = "ZodDate"; + ZodFirstPartyTypeKind["ZodSymbol"] = "ZodSymbol"; + ZodFirstPartyTypeKind["ZodUndefined"] = "ZodUndefined"; + ZodFirstPartyTypeKind["ZodNull"] = "ZodNull"; + ZodFirstPartyTypeKind["ZodAny"] = "ZodAny"; + ZodFirstPartyTypeKind["ZodUnknown"] = "ZodUnknown"; + ZodFirstPartyTypeKind["ZodNever"] = "ZodNever"; + ZodFirstPartyTypeKind["ZodVoid"] = "ZodVoid"; + ZodFirstPartyTypeKind["ZodArray"] = "ZodArray"; + ZodFirstPartyTypeKind["ZodObject"] = "ZodObject"; + ZodFirstPartyTypeKind["ZodUnion"] = "ZodUnion"; + ZodFirstPartyTypeKind["ZodDiscriminatedUnion"] = "ZodDiscriminatedUnion"; + ZodFirstPartyTypeKind["ZodIntersection"] = "ZodIntersection"; + ZodFirstPartyTypeKind["ZodTuple"] = "ZodTuple"; + ZodFirstPartyTypeKind["ZodRecord"] = "ZodRecord"; + ZodFirstPartyTypeKind["ZodMap"] = "ZodMap"; + ZodFirstPartyTypeKind["ZodSet"] = "ZodSet"; + ZodFirstPartyTypeKind["ZodFunction"] = "ZodFunction"; + ZodFirstPartyTypeKind["ZodLazy"] = "ZodLazy"; + ZodFirstPartyTypeKind["ZodLiteral"] = "ZodLiteral"; + ZodFirstPartyTypeKind["ZodEnum"] = "ZodEnum"; + ZodFirstPartyTypeKind["ZodEffects"] = "ZodEffects"; + ZodFirstPartyTypeKind["ZodNativeEnum"] = "ZodNativeEnum"; + ZodFirstPartyTypeKind["ZodOptional"] = "ZodOptional"; + ZodFirstPartyTypeKind["ZodNullable"] = "ZodNullable"; + ZodFirstPartyTypeKind["ZodDefault"] = "ZodDefault"; + ZodFirstPartyTypeKind["ZodCatch"] = "ZodCatch"; + ZodFirstPartyTypeKind["ZodPromise"] = "ZodPromise"; + ZodFirstPartyTypeKind["ZodBranded"] = "ZodBranded"; + ZodFirstPartyTypeKind["ZodPipeline"] = "ZodPipeline"; + ZodFirstPartyTypeKind["ZodReadonly"] = "ZodReadonly"; + })(exports.ZodFirstPartyTypeKind || (exports.ZodFirstPartyTypeKind = {})); + const instanceOfType = ( + // const instanceOfType = any>( + cls, params = { + message: `Input not instance of ${cls.name}`, + }) => custom((data) => data instanceof cls, params); + const stringType = ZodString.create; + const numberType = ZodNumber.create; + const nanType = ZodNaN.create; + const bigIntType = ZodBigInt.create; + const booleanType = ZodBoolean.create; + const dateType = ZodDate.create; + const symbolType = ZodSymbol.create; + const undefinedType = ZodUndefined.create; + const nullType = ZodNull.create; + const anyType = ZodAny.create; + const unknownType = ZodUnknown.create; + const neverType = ZodNever.create; + const voidType = ZodVoid.create; + const arrayType = ZodArray.create; + const objectType = ZodObject.create; + const strictObjectType = ZodObject.strictCreate; + const unionType = ZodUnion.create; + const discriminatedUnionType = ZodDiscriminatedUnion.create; + const intersectionType = ZodIntersection.create; + const tupleType = ZodTuple.create; + const recordType = ZodRecord.create; + const mapType = ZodMap.create; + const setType = ZodSet.create; + const functionType = ZodFunction.create; + const lazyType = ZodLazy.create; + const literalType = ZodLiteral.create; + const enumType = ZodEnum.create; + const nativeEnumType = ZodNativeEnum.create; + const promiseType = ZodPromise.create; + const effectsType = ZodEffects.create; + const optionalType = ZodOptional.create; + const nullableType = ZodNullable.create; + const preprocessType = ZodEffects.createWithPreprocess; + const pipelineType = ZodPipeline.create; + const ostring = () => stringType().optional(); + const onumber = () => numberType().optional(); + const oboolean = () => booleanType().optional(); + const coerce = { + string: ((arg) => ZodString.create({ ...arg, coerce: true })), + number: ((arg) => ZodNumber.create({ ...arg, coerce: true })), + boolean: ((arg) => ZodBoolean.create({ + ...arg, + coerce: true, + })), + bigint: ((arg) => ZodBigInt.create({ ...arg, coerce: true })), + date: ((arg) => ZodDate.create({ ...arg, coerce: true })), + }; + const NEVER = INVALID; + + var z = /*#__PURE__*/Object.freeze({ + __proto__: null, + defaultErrorMap: errorMap, + setErrorMap: setErrorMap, + getErrorMap: getErrorMap, + makeIssue: makeIssue, + EMPTY_PATH: EMPTY_PATH, + addIssueToContext: addIssueToContext, + ParseStatus: ParseStatus, + INVALID: INVALID, + DIRTY: DIRTY, + OK: OK, + isAborted: isAborted, + isDirty: isDirty, + isValid: isValid, + isAsync: isAsync, + get util () { return exports.util; }, + get objectUtil () { return exports.objectUtil; }, + ZodParsedType: ZodParsedType, + getParsedType: getParsedType, + ZodType: ZodType, + datetimeRegex: datetimeRegex, + ZodString: ZodString, + ZodNumber: ZodNumber, + ZodBigInt: ZodBigInt, + ZodBoolean: ZodBoolean, + ZodDate: ZodDate, + ZodSymbol: ZodSymbol, + ZodUndefined: ZodUndefined, + ZodNull: ZodNull, + ZodAny: ZodAny, + ZodUnknown: ZodUnknown, + ZodNever: ZodNever, + ZodVoid: ZodVoid, + ZodArray: ZodArray, + ZodObject: ZodObject, + ZodUnion: ZodUnion, + ZodDiscriminatedUnion: ZodDiscriminatedUnion, + ZodIntersection: ZodIntersection, + ZodTuple: ZodTuple, + ZodRecord: ZodRecord, + ZodMap: ZodMap, + ZodSet: ZodSet, + ZodFunction: ZodFunction, + ZodLazy: ZodLazy, + ZodLiteral: ZodLiteral, + ZodEnum: ZodEnum, + ZodNativeEnum: ZodNativeEnum, + ZodPromise: ZodPromise, + ZodEffects: ZodEffects, + ZodTransformer: ZodEffects, + ZodOptional: ZodOptional, + ZodNullable: ZodNullable, + ZodDefault: ZodDefault, + ZodCatch: ZodCatch, + ZodNaN: ZodNaN, + BRAND: BRAND, + ZodBranded: ZodBranded, + ZodPipeline: ZodPipeline, + ZodReadonly: ZodReadonly, + custom: custom, + Schema: ZodType, + ZodSchema: ZodType, + late: late, + get ZodFirstPartyTypeKind () { return exports.ZodFirstPartyTypeKind; }, + coerce: coerce, + any: anyType, + array: arrayType, + bigint: bigIntType, + boolean: booleanType, + date: dateType, + discriminatedUnion: discriminatedUnionType, + effect: effectsType, + 'enum': enumType, + 'function': functionType, + 'instanceof': instanceOfType, + intersection: intersectionType, + lazy: lazyType, + literal: literalType, + map: mapType, + nan: nanType, + nativeEnum: nativeEnumType, + never: neverType, + 'null': nullType, + nullable: nullableType, + number: numberType, + object: objectType, + oboolean: oboolean, + onumber: onumber, + optional: optionalType, + ostring: ostring, + pipeline: pipelineType, + preprocess: preprocessType, + promise: promiseType, + record: recordType, + set: setType, + strictObject: strictObjectType, + string: stringType, + symbol: symbolType, + transformer: effectsType, + tuple: tupleType, + 'undefined': undefinedType, + union: unionType, + unknown: unknownType, + 'void': voidType, + NEVER: NEVER, + ZodIssueCode: ZodIssueCode, + quotelessJson: quotelessJson, + ZodError: ZodError + }); + + exports.BRAND = BRAND; + exports.DIRTY = DIRTY; + exports.EMPTY_PATH = EMPTY_PATH; + exports.INVALID = INVALID; + exports.NEVER = NEVER; + exports.OK = OK; + exports.ParseStatus = ParseStatus; + exports.Schema = ZodType; + exports.ZodAny = ZodAny; + exports.ZodArray = ZodArray; + exports.ZodBigInt = ZodBigInt; + exports.ZodBoolean = ZodBoolean; + exports.ZodBranded = ZodBranded; + exports.ZodCatch = ZodCatch; + exports.ZodDate = ZodDate; + exports.ZodDefault = ZodDefault; + exports.ZodDiscriminatedUnion = ZodDiscriminatedUnion; + exports.ZodEffects = ZodEffects; + exports.ZodEnum = ZodEnum; + exports.ZodError = ZodError; + exports.ZodFunction = ZodFunction; + exports.ZodIntersection = ZodIntersection; + exports.ZodIssueCode = ZodIssueCode; + exports.ZodLazy = ZodLazy; + exports.ZodLiteral = ZodLiteral; + exports.ZodMap = ZodMap; + exports.ZodNaN = ZodNaN; + exports.ZodNativeEnum = ZodNativeEnum; + exports.ZodNever = ZodNever; + exports.ZodNull = ZodNull; + exports.ZodNullable = ZodNullable; + exports.ZodNumber = ZodNumber; + exports.ZodObject = ZodObject; + exports.ZodOptional = ZodOptional; + exports.ZodParsedType = ZodParsedType; + exports.ZodPipeline = ZodPipeline; + exports.ZodPromise = ZodPromise; + exports.ZodReadonly = ZodReadonly; + exports.ZodRecord = ZodRecord; + exports.ZodSchema = ZodType; + exports.ZodSet = ZodSet; + exports.ZodString = ZodString; + exports.ZodSymbol = ZodSymbol; + exports.ZodTransformer = ZodEffects; + exports.ZodTuple = ZodTuple; + exports.ZodType = ZodType; + exports.ZodUndefined = ZodUndefined; + exports.ZodUnion = ZodUnion; + exports.ZodUnknown = ZodUnknown; + exports.ZodVoid = ZodVoid; + exports.addIssueToContext = addIssueToContext; + exports.any = anyType; + exports.array = arrayType; + exports.bigint = bigIntType; + exports.boolean = booleanType; + exports.coerce = coerce; + exports.custom = custom; + exports.date = dateType; + exports.datetimeRegex = datetimeRegex; + exports["default"] = z; + exports.defaultErrorMap = errorMap; + exports.discriminatedUnion = discriminatedUnionType; + exports.effect = effectsType; + exports["enum"] = enumType; + exports["function"] = functionType; + exports.getErrorMap = getErrorMap; + exports.getParsedType = getParsedType; + exports["instanceof"] = instanceOfType; + exports.intersection = intersectionType; + exports.isAborted = isAborted; + exports.isAsync = isAsync; + exports.isDirty = isDirty; + exports.isValid = isValid; + exports.late = late; + exports.lazy = lazyType; + exports.literal = literalType; + exports.makeIssue = makeIssue; + exports.map = mapType; + exports.nan = nanType; + exports.nativeEnum = nativeEnumType; + exports.never = neverType; + exports["null"] = nullType; + exports.nullable = nullableType; + exports.number = numberType; + exports.object = objectType; + exports.oboolean = oboolean; + exports.onumber = onumber; + exports.optional = optionalType; + exports.ostring = ostring; + exports.pipeline = pipelineType; + exports.preprocess = preprocessType; + exports.promise = promiseType; + exports.quotelessJson = quotelessJson; + exports.record = recordType; + exports.set = setType; + exports.setErrorMap = setErrorMap; + exports.strictObject = strictObjectType; + exports.string = stringType; + exports.symbol = symbolType; + exports.transformer = effectsType; + exports.tuple = tupleType; + exports["undefined"] = undefinedType; + exports.union = unionType; + exports.unknown = unknownType; + exports["void"] = voidType; + exports.z = z; + + Object.defineProperty(exports, '__esModule', { value: true }); + +})); diff --git a/front_end/third_party/mcp-sdk/zod/lib/locales/en.d.ts b/front_end/third_party/mcp-sdk/zod/lib/locales/en.d.ts new file mode 100644 index 0000000000..e5a387159f --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/locales/en.d.ts @@ -0,0 +1,3 @@ +import { ZodErrorMap } from "../ZodError"; +declare const errorMap: ZodErrorMap; +export default errorMap; diff --git a/front_end/third_party/mcp-sdk/zod/lib/locales/en.js b/front_end/third_party/mcp-sdk/zod/lib/locales/en.js new file mode 100644 index 0000000000..98342a0bc6 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/locales/en.js @@ -0,0 +1,129 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const util_1 = require("../helpers/util"); +const ZodError_1 = require("../ZodError"); +const errorMap = (issue, _ctx) => { + let message; + switch (issue.code) { + case ZodError_1.ZodIssueCode.invalid_type: + if (issue.received === util_1.ZodParsedType.undefined) { + message = "Required"; + } + else { + message = `Expected ${issue.expected}, received ${issue.received}`; + } + break; + case ZodError_1.ZodIssueCode.invalid_literal: + message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util_1.util.jsonStringifyReplacer)}`; + break; + case ZodError_1.ZodIssueCode.unrecognized_keys: + message = `Unrecognized key(s) in object: ${util_1.util.joinValues(issue.keys, ", ")}`; + break; + case ZodError_1.ZodIssueCode.invalid_union: + message = `Invalid input`; + break; + case ZodError_1.ZodIssueCode.invalid_union_discriminator: + message = `Invalid discriminator value. Expected ${util_1.util.joinValues(issue.options)}`; + break; + case ZodError_1.ZodIssueCode.invalid_enum_value: + message = `Invalid enum value. Expected ${util_1.util.joinValues(issue.options)}, received '${issue.received}'`; + break; + case ZodError_1.ZodIssueCode.invalid_arguments: + message = `Invalid function arguments`; + break; + case ZodError_1.ZodIssueCode.invalid_return_type: + message = `Invalid function return type`; + break; + case ZodError_1.ZodIssueCode.invalid_date: + message = `Invalid date`; + break; + case ZodError_1.ZodIssueCode.invalid_string: + if (typeof issue.validation === "object") { + if ("includes" in issue.validation) { + message = `Invalid input: must include "${issue.validation.includes}"`; + if (typeof issue.validation.position === "number") { + message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`; + } + } + else if ("startsWith" in issue.validation) { + message = `Invalid input: must start with "${issue.validation.startsWith}"`; + } + else if ("endsWith" in issue.validation) { + message = `Invalid input: must end with "${issue.validation.endsWith}"`; + } + else { + util_1.util.assertNever(issue.validation); + } + } + else if (issue.validation !== "regex") { + message = `Invalid ${issue.validation}`; + } + else { + message = "Invalid"; + } + break; + case ZodError_1.ZodIssueCode.too_small: + if (issue.type === "array") + message = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`; + else if (issue.type === "string") + message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`; + else if (issue.type === "number") + message = `Number must be ${issue.exact + ? `exactly equal to ` + : issue.inclusive + ? `greater than or equal to ` + : `greater than `}${issue.minimum}`; + else if (issue.type === "date") + message = `Date must be ${issue.exact + ? `exactly equal to ` + : issue.inclusive + ? `greater than or equal to ` + : `greater than `}${new Date(Number(issue.minimum))}`; + else + message = "Invalid input"; + break; + case ZodError_1.ZodIssueCode.too_big: + if (issue.type === "array") + message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`; + else if (issue.type === "string") + message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`; + else if (issue.type === "number") + message = `Number must be ${issue.exact + ? `exactly` + : issue.inclusive + ? `less than or equal to` + : `less than`} ${issue.maximum}`; + else if (issue.type === "bigint") + message = `BigInt must be ${issue.exact + ? `exactly` + : issue.inclusive + ? `less than or equal to` + : `less than`} ${issue.maximum}`; + else if (issue.type === "date") + message = `Date must be ${issue.exact + ? `exactly` + : issue.inclusive + ? `smaller than or equal to` + : `smaller than`} ${new Date(Number(issue.maximum))}`; + else + message = "Invalid input"; + break; + case ZodError_1.ZodIssueCode.custom: + message = `Invalid input`; + break; + case ZodError_1.ZodIssueCode.invalid_intersection_types: + message = `Intersection results could not be merged`; + break; + case ZodError_1.ZodIssueCode.not_multiple_of: + message = `Number must be a multiple of ${issue.multipleOf}`; + break; + case ZodError_1.ZodIssueCode.not_finite: + message = "Number must be finite"; + break; + default: + message = _ctx.defaultError; + util_1.util.assertNever(issue); + } + return { message }; +}; +exports.default = errorMap; diff --git a/front_end/third_party/mcp-sdk/zod/lib/types.d.ts b/front_end/third_party/mcp-sdk/zod/lib/types.d.ts new file mode 100644 index 0000000000..e5314e667e --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/types.d.ts @@ -0,0 +1,1127 @@ +import { enumUtil } from "./helpers/enumUtil"; +import { errorUtil } from "./helpers/errorUtil"; +import { AsyncParseReturnType, ParseContext, ParseInput, ParseParams, ParseReturnType, ParseStatus, SyncParseReturnType } from "./helpers/parseUtil"; +import { partialUtil } from "./helpers/partialUtil"; +import { Primitive } from "./helpers/typeAliases"; +import { objectUtil, util } from "./helpers/util"; +import { IssueData, StringValidation, ZodCustomIssue, ZodError, ZodErrorMap } from "./ZodError"; +export interface RefinementCtx { + addIssue: (arg: IssueData) => void; + path: (string | number)[]; +} +export declare type ZodRawShape = { + [k: string]: ZodTypeAny; +}; +export declare type ZodTypeAny = ZodType; +export declare type TypeOf> = T["_output"]; +export declare type input> = T["_input"]; +export declare type output> = T["_output"]; +export type { TypeOf as infer }; +export declare type CustomErrorParams = Partial>; +export interface ZodTypeDef { + errorMap?: ZodErrorMap; + description?: string; +} +export declare type RawCreateParams = { + errorMap?: ZodErrorMap; + invalid_type_error?: string; + required_error?: string; + message?: string; + description?: string; +} | undefined; +export declare type ProcessedCreateParams = { + errorMap?: ZodErrorMap; + description?: string; +}; +export declare type SafeParseSuccess = { + success: true; + data: Output; + error?: never; +}; +export declare type SafeParseError = { + success: false; + error: ZodError; + data?: never; +}; +export declare type SafeParseReturnType = SafeParseSuccess | SafeParseError; +export declare abstract class ZodType { + readonly _type: Output; + readonly _output: Output; + readonly _input: Input; + readonly _def: Def; + get description(): string | undefined; + abstract _parse(input: ParseInput): ParseReturnType; + _getType(input: ParseInput): string; + _getOrReturnCtx(input: ParseInput, ctx?: ParseContext | undefined): ParseContext; + _processInputParams(input: ParseInput): { + status: ParseStatus; + ctx: ParseContext; + }; + _parseSync(input: ParseInput): SyncParseReturnType; + _parseAsync(input: ParseInput): AsyncParseReturnType; + parse(data: unknown, params?: Partial): Output; + safeParse(data: unknown, params?: Partial): SafeParseReturnType; + parseAsync(data: unknown, params?: Partial): Promise; + safeParseAsync(data: unknown, params?: Partial): Promise>; + /** Alias of safeParseAsync */ + spa: (data: unknown, params?: Partial | undefined) => Promise>; + refine(check: (arg: Output) => arg is RefinedOutput, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects; + refine(check: (arg: Output) => unknown | Promise, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects; + refinement(check: (arg: Output) => arg is RefinedOutput, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects; + refinement(check: (arg: Output) => boolean, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects; + _refinement(refinement: RefinementEffect["refinement"]): ZodEffects; + superRefine(refinement: (arg: Output, ctx: RefinementCtx) => arg is RefinedOutput): ZodEffects; + superRefine(refinement: (arg: Output, ctx: RefinementCtx) => void): ZodEffects; + superRefine(refinement: (arg: Output, ctx: RefinementCtx) => Promise): ZodEffects; + constructor(def: Def); + optional(): ZodOptional; + nullable(): ZodNullable; + nullish(): ZodOptional>; + array(): ZodArray; + promise(): ZodPromise; + or(option: T): ZodUnion<[this, T]>; + and(incoming: T): ZodIntersection; + transform(transform: (arg: Output, ctx: RefinementCtx) => NewOut | Promise): ZodEffects; + default(def: util.noUndefined): ZodDefault; + default(def: () => util.noUndefined): ZodDefault; + brand(brand?: B): ZodBranded; + catch(def: Output): ZodCatch; + catch(def: (ctx: { + error: ZodError; + input: Input; + }) => Output): ZodCatch; + describe(description: string): this; + pipe(target: T): ZodPipeline; + readonly(): ZodReadonly; + isOptional(): boolean; + isNullable(): boolean; +} +export declare type IpVersion = "v4" | "v6"; +export declare type ZodStringCheck = { + kind: "min"; + value: number; + message?: string; +} | { + kind: "max"; + value: number; + message?: string; +} | { + kind: "length"; + value: number; + message?: string; +} | { + kind: "email"; + message?: string; +} | { + kind: "url"; + message?: string; +} | { + kind: "emoji"; + message?: string; +} | { + kind: "uuid"; + message?: string; +} | { + kind: "nanoid"; + message?: string; +} | { + kind: "cuid"; + message?: string; +} | { + kind: "includes"; + value: string; + position?: number; + message?: string; +} | { + kind: "cuid2"; + message?: string; +} | { + kind: "ulid"; + message?: string; +} | { + kind: "startsWith"; + value: string; + message?: string; +} | { + kind: "endsWith"; + value: string; + message?: string; +} | { + kind: "regex"; + regex: RegExp; + message?: string; +} | { + kind: "trim"; + message?: string; +} | { + kind: "toLowerCase"; + message?: string; +} | { + kind: "toUpperCase"; + message?: string; +} | { + kind: "datetime"; + offset: boolean; + local: boolean; + precision: number | null; + message?: string; +} | { + kind: "date"; + message?: string; +} | { + kind: "time"; + precision: number | null; + message?: string; +} | { + kind: "duration"; + message?: string; +} | { + kind: "ip"; + version?: IpVersion; + message?: string; +} | { + kind: "base64"; + message?: string; +}; +export interface ZodStringDef extends ZodTypeDef { + checks: ZodStringCheck[]; + typeName: ZodFirstPartyTypeKind.ZodString; + coerce: boolean; +} +export declare function datetimeRegex(args: { + precision?: number | null; + offset?: boolean; + local?: boolean; +}): RegExp; +export declare class ZodString extends ZodType { + _parse(input: ParseInput): ParseReturnType; + protected _regex(regex: RegExp, validation: StringValidation, message?: errorUtil.ErrMessage): ZodEffects; + _addCheck(check: ZodStringCheck): ZodString; + email(message?: errorUtil.ErrMessage): ZodString; + url(message?: errorUtil.ErrMessage): ZodString; + emoji(message?: errorUtil.ErrMessage): ZodString; + uuid(message?: errorUtil.ErrMessage): ZodString; + nanoid(message?: errorUtil.ErrMessage): ZodString; + cuid(message?: errorUtil.ErrMessage): ZodString; + cuid2(message?: errorUtil.ErrMessage): ZodString; + ulid(message?: errorUtil.ErrMessage): ZodString; + base64(message?: errorUtil.ErrMessage): ZodString; + ip(options?: string | { + version?: "v4" | "v6"; + message?: string; + }): ZodString; + datetime(options?: string | { + message?: string | undefined; + precision?: number | null; + offset?: boolean; + local?: boolean; + }): ZodString; + date(message?: string): ZodString; + time(options?: string | { + message?: string | undefined; + precision?: number | null; + }): ZodString; + duration(message?: errorUtil.ErrMessage): ZodString; + regex(regex: RegExp, message?: errorUtil.ErrMessage): ZodString; + includes(value: string, options?: { + message?: string; + position?: number; + }): ZodString; + startsWith(value: string, message?: errorUtil.ErrMessage): ZodString; + endsWith(value: string, message?: errorUtil.ErrMessage): ZodString; + min(minLength: number, message?: errorUtil.ErrMessage): ZodString; + max(maxLength: number, message?: errorUtil.ErrMessage): ZodString; + length(len: number, message?: errorUtil.ErrMessage): ZodString; + /** + * @deprecated Use z.string().min(1) instead. + * @see {@link ZodString.min} + */ + nonempty(message?: errorUtil.ErrMessage): ZodString; + trim(): ZodString; + toLowerCase(): ZodString; + toUpperCase(): ZodString; + get isDatetime(): boolean; + get isDate(): boolean; + get isTime(): boolean; + get isDuration(): boolean; + get isEmail(): boolean; + get isURL(): boolean; + get isEmoji(): boolean; + get isUUID(): boolean; + get isNANOID(): boolean; + get isCUID(): boolean; + get isCUID2(): boolean; + get isULID(): boolean; + get isIP(): boolean; + get isBase64(): boolean; + get minLength(): number | null; + get maxLength(): number | null; + static create: (params?: ({ + errorMap?: ZodErrorMap | undefined; + invalid_type_error?: string | undefined; + required_error?: string | undefined; + message?: string | undefined; + description?: string | undefined; + } & { + coerce?: true | undefined; + }) | undefined) => ZodString; +} +export declare type ZodNumberCheck = { + kind: "min"; + value: number; + inclusive: boolean; + message?: string; +} | { + kind: "max"; + value: number; + inclusive: boolean; + message?: string; +} | { + kind: "int"; + message?: string; +} | { + kind: "multipleOf"; + value: number; + message?: string; +} | { + kind: "finite"; + message?: string; +}; +export interface ZodNumberDef extends ZodTypeDef { + checks: ZodNumberCheck[]; + typeName: ZodFirstPartyTypeKind.ZodNumber; + coerce: boolean; +} +export declare class ZodNumber extends ZodType { + _parse(input: ParseInput): ParseReturnType; + static create: (params?: ({ + errorMap?: ZodErrorMap | undefined; + invalid_type_error?: string | undefined; + required_error?: string | undefined; + message?: string | undefined; + description?: string | undefined; + } & { + coerce?: boolean | undefined; + }) | undefined) => ZodNumber; + gte(value: number, message?: errorUtil.ErrMessage): ZodNumber; + min: (value: number, message?: errorUtil.ErrMessage | undefined) => ZodNumber; + gt(value: number, message?: errorUtil.ErrMessage): ZodNumber; + lte(value: number, message?: errorUtil.ErrMessage): ZodNumber; + max: (value: number, message?: errorUtil.ErrMessage | undefined) => ZodNumber; + lt(value: number, message?: errorUtil.ErrMessage): ZodNumber; + protected setLimit(kind: "min" | "max", value: number, inclusive: boolean, message?: string): ZodNumber; + _addCheck(check: ZodNumberCheck): ZodNumber; + int(message?: errorUtil.ErrMessage): ZodNumber; + positive(message?: errorUtil.ErrMessage): ZodNumber; + negative(message?: errorUtil.ErrMessage): ZodNumber; + nonpositive(message?: errorUtil.ErrMessage): ZodNumber; + nonnegative(message?: errorUtil.ErrMessage): ZodNumber; + multipleOf(value: number, message?: errorUtil.ErrMessage): ZodNumber; + step: (value: number, message?: errorUtil.ErrMessage | undefined) => ZodNumber; + finite(message?: errorUtil.ErrMessage): ZodNumber; + safe(message?: errorUtil.ErrMessage): ZodNumber; + get minValue(): number | null; + get maxValue(): number | null; + get isInt(): boolean; + get isFinite(): boolean; +} +export declare type ZodBigIntCheck = { + kind: "min"; + value: bigint; + inclusive: boolean; + message?: string; +} | { + kind: "max"; + value: bigint; + inclusive: boolean; + message?: string; +} | { + kind: "multipleOf"; + value: bigint; + message?: string; +}; +export interface ZodBigIntDef extends ZodTypeDef { + checks: ZodBigIntCheck[]; + typeName: ZodFirstPartyTypeKind.ZodBigInt; + coerce: boolean; +} +export declare class ZodBigInt extends ZodType { + _parse(input: ParseInput): ParseReturnType; + static create: (params?: ({ + errorMap?: ZodErrorMap | undefined; + invalid_type_error?: string | undefined; + required_error?: string | undefined; + message?: string | undefined; + description?: string | undefined; + } & { + coerce?: boolean | undefined; + }) | undefined) => ZodBigInt; + gte(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt; + min: (value: bigint, message?: errorUtil.ErrMessage | undefined) => ZodBigInt; + gt(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt; + lte(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt; + max: (value: bigint, message?: errorUtil.ErrMessage | undefined) => ZodBigInt; + lt(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt; + protected setLimit(kind: "min" | "max", value: bigint, inclusive: boolean, message?: string): ZodBigInt; + _addCheck(check: ZodBigIntCheck): ZodBigInt; + positive(message?: errorUtil.ErrMessage): ZodBigInt; + negative(message?: errorUtil.ErrMessage): ZodBigInt; + nonpositive(message?: errorUtil.ErrMessage): ZodBigInt; + nonnegative(message?: errorUtil.ErrMessage): ZodBigInt; + multipleOf(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt; + get minValue(): bigint | null; + get maxValue(): bigint | null; +} +export interface ZodBooleanDef extends ZodTypeDef { + typeName: ZodFirstPartyTypeKind.ZodBoolean; + coerce: boolean; +} +export declare class ZodBoolean extends ZodType { + _parse(input: ParseInput): ParseReturnType; + static create: (params?: ({ + errorMap?: ZodErrorMap | undefined; + invalid_type_error?: string | undefined; + required_error?: string | undefined; + message?: string | undefined; + description?: string | undefined; + } & { + coerce?: boolean | undefined; + }) | undefined) => ZodBoolean; +} +export declare type ZodDateCheck = { + kind: "min"; + value: number; + message?: string; +} | { + kind: "max"; + value: number; + message?: string; +}; +export interface ZodDateDef extends ZodTypeDef { + checks: ZodDateCheck[]; + coerce: boolean; + typeName: ZodFirstPartyTypeKind.ZodDate; +} +export declare class ZodDate extends ZodType { + _parse(input: ParseInput): ParseReturnType; + _addCheck(check: ZodDateCheck): ZodDate; + min(minDate: Date, message?: errorUtil.ErrMessage): ZodDate; + max(maxDate: Date, message?: errorUtil.ErrMessage): ZodDate; + get minDate(): Date | null; + get maxDate(): Date | null; + static create: (params?: ({ + errorMap?: ZodErrorMap | undefined; + invalid_type_error?: string | undefined; + required_error?: string | undefined; + message?: string | undefined; + description?: string | undefined; + } & { + coerce?: boolean | undefined; + }) | undefined) => ZodDate; +} +export interface ZodSymbolDef extends ZodTypeDef { + typeName: ZodFirstPartyTypeKind.ZodSymbol; +} +export declare class ZodSymbol extends ZodType { + _parse(input: ParseInput): ParseReturnType; + static create: (params?: RawCreateParams) => ZodSymbol; +} +export interface ZodUndefinedDef extends ZodTypeDef { + typeName: ZodFirstPartyTypeKind.ZodUndefined; +} +export declare class ZodUndefined extends ZodType { + _parse(input: ParseInput): ParseReturnType; + params?: RawCreateParams; + static create: (params?: RawCreateParams) => ZodUndefined; +} +export interface ZodNullDef extends ZodTypeDef { + typeName: ZodFirstPartyTypeKind.ZodNull; +} +export declare class ZodNull extends ZodType { + _parse(input: ParseInput): ParseReturnType; + static create: (params?: RawCreateParams) => ZodNull; +} +export interface ZodAnyDef extends ZodTypeDef { + typeName: ZodFirstPartyTypeKind.ZodAny; +} +export declare class ZodAny extends ZodType { + _any: true; + _parse(input: ParseInput): ParseReturnType; + static create: (params?: RawCreateParams) => ZodAny; +} +export interface ZodUnknownDef extends ZodTypeDef { + typeName: ZodFirstPartyTypeKind.ZodUnknown; +} +export declare class ZodUnknown extends ZodType { + _unknown: true; + _parse(input: ParseInput): ParseReturnType; + static create: (params?: RawCreateParams) => ZodUnknown; +} +export interface ZodNeverDef extends ZodTypeDef { + typeName: ZodFirstPartyTypeKind.ZodNever; +} +export declare class ZodNever extends ZodType { + _parse(input: ParseInput): ParseReturnType; + static create: (params?: RawCreateParams) => ZodNever; +} +export interface ZodVoidDef extends ZodTypeDef { + typeName: ZodFirstPartyTypeKind.ZodVoid; +} +export declare class ZodVoid extends ZodType { + _parse(input: ParseInput): ParseReturnType; + static create: (params?: RawCreateParams) => ZodVoid; +} +export interface ZodArrayDef extends ZodTypeDef { + type: T; + typeName: ZodFirstPartyTypeKind.ZodArray; + exactLength: { + value: number; + message?: string; + } | null; + minLength: { + value: number; + message?: string; + } | null; + maxLength: { + value: number; + message?: string; + } | null; +} +export declare type ArrayCardinality = "many" | "atleastone"; +export declare type arrayOutputType = Cardinality extends "atleastone" ? [T["_output"], ...T["_output"][]] : T["_output"][]; +export declare class ZodArray extends ZodType, ZodArrayDef, Cardinality extends "atleastone" ? [T["_input"], ...T["_input"][]] : T["_input"][]> { + _parse(input: ParseInput): ParseReturnType; + get element(): T; + min(minLength: number, message?: errorUtil.ErrMessage): this; + max(maxLength: number, message?: errorUtil.ErrMessage): this; + length(len: number, message?: errorUtil.ErrMessage): this; + nonempty(message?: errorUtil.ErrMessage): ZodArray; + static create: (schema: T_1, params?: RawCreateParams) => ZodArray; +} +export declare type ZodNonEmptyArray = ZodArray; +export declare type UnknownKeysParam = "passthrough" | "strict" | "strip"; +export interface ZodObjectDef extends ZodTypeDef { + typeName: ZodFirstPartyTypeKind.ZodObject; + shape: () => T; + catchall: Catchall; + unknownKeys: UnknownKeys; +} +export declare type mergeTypes = { + [k in keyof A | keyof B]: k extends keyof B ? B[k] : k extends keyof A ? A[k] : never; +}; +export declare type objectOutputType = objectUtil.flatten>> & CatchallOutput & PassthroughType; +export declare type baseObjectOutputType = { + [k in keyof Shape]: Shape[k]["_output"]; +}; +export declare type objectInputType = objectUtil.flatten> & CatchallInput & PassthroughType; +export declare type baseObjectInputType = objectUtil.addQuestionMarks<{ + [k in keyof Shape]: Shape[k]["_input"]; +}>; +export declare type CatchallOutput = ZodType extends T ? unknown : { + [k: string]: T["_output"]; +}; +export declare type CatchallInput = ZodType extends T ? unknown : { + [k: string]: T["_input"]; +}; +export declare type PassthroughType = T extends "passthrough" ? { + [k: string]: unknown; +} : unknown; +export declare type deoptional = T extends ZodOptional ? deoptional : T extends ZodNullable ? ZodNullable> : T; +export declare type SomeZodObject = ZodObject; +export declare type noUnrecognized = { + [k in keyof Obj]: k extends keyof Shape ? Obj[k] : never; +}; +export declare class ZodObject, Input = objectInputType> extends ZodType, Input> { + private _cached; + _getCached(): { + shape: T; + keys: string[]; + }; + _parse(input: ParseInput): ParseReturnType; + get shape(): T; + strict(message?: errorUtil.ErrMessage): ZodObject; + strip(): ZodObject; + passthrough(): ZodObject; + /** + * @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped. + * If you want to pass through unknown properties, use `.passthrough()` instead. + */ + nonstrict: () => ZodObject; + extend(augmentation: Augmentation): ZodObject, UnknownKeys, Catchall>; + /** + * @deprecated Use `.extend` instead + * */ + augment: (augmentation: Augmentation) => ZodObject, UnknownKeys, Catchall, objectOutputType, Catchall, UnknownKeys>, objectInputType, Catchall, UnknownKeys>>; + /** + * Prior to zod@1.0.12 there was a bug in the + * inferred type of merged objects. Please + * upgrade if you are experiencing issues. + */ + merge(merging: Incoming): ZodObject, Incoming["_def"]["unknownKeys"], Incoming["_def"]["catchall"]>; + setKey(key: Key, schema: Schema): ZodObject; + catchall(index: Index): ZodObject; + pick>(mask: Mask): ZodObject>, UnknownKeys, Catchall>; + omit>(mask: Mask): ZodObject, UnknownKeys, Catchall>; + /** + * @deprecated + */ + deepPartial(): partialUtil.DeepPartial; + partial(): ZodObject<{ + [k in keyof T]: ZodOptional; + }, UnknownKeys, Catchall>; + partial>(mask: Mask): ZodObject : T[k]; + }>, UnknownKeys, Catchall>; + required(): ZodObject<{ + [k in keyof T]: deoptional; + }, UnknownKeys, Catchall>; + required>(mask: Mask): ZodObject : T[k]; + }>, UnknownKeys, Catchall>; + keyof(): ZodEnum>; + static create: (shape: T_1, params?: RawCreateParams) => ZodObject, any>]: objectUtil.addQuestionMarks, any>[k]; }, { [k_1 in keyof baseObjectInputType]: baseObjectInputType[k_1]; }>; + static strictCreate: (shape: T_1, params?: RawCreateParams) => ZodObject, any>]: objectUtil.addQuestionMarks, any>[k]; }, { [k_1 in keyof baseObjectInputType]: baseObjectInputType[k_1]; }>; + static lazycreate: (shape: () => T_1, params?: RawCreateParams) => ZodObject, any>]: objectUtil.addQuestionMarks, any>[k]; }, { [k_1 in keyof baseObjectInputType]: baseObjectInputType[k_1]; }>; +} +export declare type AnyZodObject = ZodObject; +export declare type ZodUnionOptions = Readonly<[ZodTypeAny, ...ZodTypeAny[]]>; +export interface ZodUnionDef> extends ZodTypeDef { + options: T; + typeName: ZodFirstPartyTypeKind.ZodUnion; +} +export declare class ZodUnion extends ZodType, T[number]["_input"]> { + _parse(input: ParseInput): ParseReturnType; + get options(): T; + static create: (types: T_1, params?: RawCreateParams) => ZodUnion; +} +export declare type ZodDiscriminatedUnionOption = ZodObject<{ + [key in Discriminator]: ZodTypeAny; +} & ZodRawShape, UnknownKeysParam, ZodTypeAny>; +export interface ZodDiscriminatedUnionDef[] = ZodDiscriminatedUnionOption[]> extends ZodTypeDef { + discriminator: Discriminator; + options: Options; + optionsMap: Map>; + typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion; +} +export declare class ZodDiscriminatedUnion[]> extends ZodType, ZodDiscriminatedUnionDef, input> { + _parse(input: ParseInput): ParseReturnType; + get discriminator(): Discriminator; + get options(): Options; + get optionsMap(): Map>; + /** + * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor. + * However, it only allows a union of objects, all of which need to share a discriminator property. This property must + * have a different value for each object in the union. + * @param discriminator the name of the discriminator property + * @param types an array of object schemas + * @param params + */ + static create, + ...ZodDiscriminatedUnionOption[] + ]>(discriminator: Discriminator, options: Types, params?: RawCreateParams): ZodDiscriminatedUnion; +} +export interface ZodIntersectionDef extends ZodTypeDef { + left: T; + right: U; + typeName: ZodFirstPartyTypeKind.ZodIntersection; +} +export declare class ZodIntersection extends ZodType, T["_input"] & U["_input"]> { + _parse(input: ParseInput): ParseReturnType; + static create: (left: T_1, right: U_1, params?: RawCreateParams) => ZodIntersection; +} +export declare type ZodTupleItems = [ZodTypeAny, ...ZodTypeAny[]]; +export declare type AssertArray = T extends any[] ? T : never; +export declare type OutputTypeOfTuple = AssertArray<{ + [k in keyof T]: T[k] extends ZodType ? T[k]["_output"] : never; +}>; +export declare type OutputTypeOfTupleWithRest = Rest extends ZodTypeAny ? [...OutputTypeOfTuple, ...Rest["_output"][]] : OutputTypeOfTuple; +export declare type InputTypeOfTuple = AssertArray<{ + [k in keyof T]: T[k] extends ZodType ? T[k]["_input"] : never; +}>; +export declare type InputTypeOfTupleWithRest = Rest extends ZodTypeAny ? [...InputTypeOfTuple, ...Rest["_input"][]] : InputTypeOfTuple; +export interface ZodTupleDef extends ZodTypeDef { + items: T; + rest: Rest; + typeName: ZodFirstPartyTypeKind.ZodTuple; +} +export declare type AnyZodTuple = ZodTuple<[ + ZodTypeAny, + ...ZodTypeAny[] +] | [], ZodTypeAny | null>; +export declare class ZodTuple extends ZodType, ZodTupleDef, InputTypeOfTupleWithRest> { + _parse(input: ParseInput): ParseReturnType; + get items(): T; + rest(rest: Rest): ZodTuple; + static create: (schemas: T_1, params?: RawCreateParams) => ZodTuple; +} +export interface ZodRecordDef extends ZodTypeDef { + valueType: Value; + keyType: Key; + typeName: ZodFirstPartyTypeKind.ZodRecord; +} +export declare type KeySchema = ZodType; +export declare type RecordType = [ + string +] extends [K] ? Record : [number] extends [K] ? Record : [symbol] extends [K] ? Record : [BRAND] extends [K] ? Record : Partial>; +export declare class ZodRecord extends ZodType, ZodRecordDef, RecordType> { + get keySchema(): Key; + get valueSchema(): Value; + _parse(input: ParseInput): ParseReturnType; + get element(): Value; + static create(valueType: Value, params?: RawCreateParams): ZodRecord; + static create(keySchema: Keys, valueType: Value, params?: RawCreateParams): ZodRecord; +} +export interface ZodMapDef extends ZodTypeDef { + valueType: Value; + keyType: Key; + typeName: ZodFirstPartyTypeKind.ZodMap; +} +export declare class ZodMap extends ZodType, ZodMapDef, Map> { + get keySchema(): Key; + get valueSchema(): Value; + _parse(input: ParseInput): ParseReturnType; + static create: (keyType: Key_1, valueType: Value_1, params?: RawCreateParams) => ZodMap; +} +export interface ZodSetDef extends ZodTypeDef { + valueType: Value; + typeName: ZodFirstPartyTypeKind.ZodSet; + minSize: { + value: number; + message?: string; + } | null; + maxSize: { + value: number; + message?: string; + } | null; +} +export declare class ZodSet extends ZodType, ZodSetDef, Set> { + _parse(input: ParseInput): ParseReturnType; + min(minSize: number, message?: errorUtil.ErrMessage): this; + max(maxSize: number, message?: errorUtil.ErrMessage): this; + size(size: number, message?: errorUtil.ErrMessage): this; + nonempty(message?: errorUtil.ErrMessage): ZodSet; + static create: (valueType: Value_1, params?: RawCreateParams) => ZodSet; +} +export interface ZodFunctionDef = ZodTuple, Returns extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef { + args: Args; + returns: Returns; + typeName: ZodFirstPartyTypeKind.ZodFunction; +} +export declare type OuterTypeOfFunction, Returns extends ZodTypeAny> = Args["_input"] extends Array ? (...args: Args["_input"]) => Returns["_output"] : never; +export declare type InnerTypeOfFunction, Returns extends ZodTypeAny> = Args["_output"] extends Array ? (...args: Args["_output"]) => Returns["_input"] : never; +export declare class ZodFunction, Returns extends ZodTypeAny> extends ZodType, ZodFunctionDef, InnerTypeOfFunction> { + _parse(input: ParseInput): ParseReturnType; + parameters(): Args; + returnType(): Returns; + args[0]>(...items: Items): ZodFunction, Returns>; + returns>(returnType: NewReturnType): ZodFunction; + implement>(func: F): ReturnType extends Returns["_output"] ? (...args: Args["_input"]) => ReturnType : OuterTypeOfFunction; + strictImplement(func: InnerTypeOfFunction): InnerTypeOfFunction; + validate: >(func: F) => ReturnType extends Returns["_output"] ? (...args: Args["_input"]) => ReturnType : OuterTypeOfFunction; + static create(): ZodFunction, ZodUnknown>; + static create>(args: T): ZodFunction; + static create(args: T, returns: U): ZodFunction; + static create, U extends ZodTypeAny = ZodUnknown>(args: T, returns: U, params?: RawCreateParams): ZodFunction; +} +export interface ZodLazyDef extends ZodTypeDef { + getter: () => T; + typeName: ZodFirstPartyTypeKind.ZodLazy; +} +export declare class ZodLazy extends ZodType, ZodLazyDef, input> { + get schema(): T; + _parse(input: ParseInput): ParseReturnType; + static create: (getter: () => T_1, params?: RawCreateParams) => ZodLazy; +} +export interface ZodLiteralDef extends ZodTypeDef { + value: T; + typeName: ZodFirstPartyTypeKind.ZodLiteral; +} +export declare class ZodLiteral extends ZodType, T> { + _parse(input: ParseInput): ParseReturnType; + get value(): T; + static create: (value: T_1, params?: RawCreateParams) => ZodLiteral; +} +export declare type ArrayKeys = keyof any[]; +export declare type Indices = Exclude; +export declare type EnumValues = readonly [T, ...T[]]; +export declare type Values = { + [k in T[number]]: k; +}; +export interface ZodEnumDef extends ZodTypeDef { + values: T; + typeName: ZodFirstPartyTypeKind.ZodEnum; +} +export declare type Writeable = { + -readonly [P in keyof T]: T[P]; +}; +export declare type FilterEnum = Values extends [] ? [] : Values extends [infer Head, ...infer Rest] ? Head extends ToExclude ? FilterEnum : [Head, ...FilterEnum] : never; +export declare type typecast = A extends T ? A : never; +declare function createZodEnum>(values: T, params?: RawCreateParams): ZodEnum>; +declare function createZodEnum(values: T, params?: RawCreateParams): ZodEnum; +export declare class ZodEnum extends ZodType, T[number]> { + #private; + _parse(input: ParseInput): ParseReturnType; + get options(): T; + get enum(): Values; + get Values(): Values; + get Enum(): Values; + extract(values: ToExtract, newDef?: RawCreateParams): ZodEnum>; + exclude(values: ToExclude, newDef?: RawCreateParams): ZodEnum>, [string, ...string[]]>>; + static create: typeof createZodEnum; +} +export interface ZodNativeEnumDef extends ZodTypeDef { + values: T; + typeName: ZodFirstPartyTypeKind.ZodNativeEnum; +} +export declare type EnumLike = { + [k: string]: string | number; + [nu: number]: string; +}; +export declare class ZodNativeEnum extends ZodType, T[keyof T]> { + #private; + _parse(input: ParseInput): ParseReturnType; + get enum(): T; + static create: (values: T_1, params?: RawCreateParams) => ZodNativeEnum; +} +export interface ZodPromiseDef extends ZodTypeDef { + type: T; + typeName: ZodFirstPartyTypeKind.ZodPromise; +} +export declare class ZodPromise extends ZodType, ZodPromiseDef, Promise> { + unwrap(): T; + _parse(input: ParseInput): ParseReturnType; + static create: (schema: T_1, params?: RawCreateParams) => ZodPromise; +} +export declare type Refinement = (arg: T, ctx: RefinementCtx) => any; +export declare type SuperRefinement = (arg: T, ctx: RefinementCtx) => void | Promise; +export declare type RefinementEffect = { + type: "refinement"; + refinement: (arg: T, ctx: RefinementCtx) => any; +}; +export declare type TransformEffect = { + type: "transform"; + transform: (arg: T, ctx: RefinementCtx) => any; +}; +export declare type PreprocessEffect = { + type: "preprocess"; + transform: (arg: T, ctx: RefinementCtx) => any; +}; +export declare type Effect = RefinementEffect | TransformEffect | PreprocessEffect; +export interface ZodEffectsDef extends ZodTypeDef { + schema: T; + typeName: ZodFirstPartyTypeKind.ZodEffects; + effect: Effect; +} +export declare class ZodEffects, Input = input> extends ZodType, Input> { + innerType(): T; + sourceType(): T; + _parse(input: ParseInput): ParseReturnType; + static create: (schema: I, effect: Effect, params?: RawCreateParams) => ZodEffects>; + static createWithPreprocess: (preprocess: (arg: unknown, ctx: RefinementCtx) => unknown, schema: I, params?: RawCreateParams) => ZodEffects; +} +export { ZodEffects as ZodTransformer }; +export interface ZodOptionalDef extends ZodTypeDef { + innerType: T; + typeName: ZodFirstPartyTypeKind.ZodOptional; +} +export declare type ZodOptionalType = ZodOptional; +export declare class ZodOptional extends ZodType, T["_input"] | undefined> { + _parse(input: ParseInput): ParseReturnType; + unwrap(): T; + static create: (type: T_1, params?: RawCreateParams) => ZodOptional; +} +export interface ZodNullableDef extends ZodTypeDef { + innerType: T; + typeName: ZodFirstPartyTypeKind.ZodNullable; +} +export declare type ZodNullableType = ZodNullable; +export declare class ZodNullable extends ZodType, T["_input"] | null> { + _parse(input: ParseInput): ParseReturnType; + unwrap(): T; + static create: (type: T_1, params?: RawCreateParams) => ZodNullable; +} +export interface ZodDefaultDef extends ZodTypeDef { + innerType: T; + defaultValue: () => util.noUndefined; + typeName: ZodFirstPartyTypeKind.ZodDefault; +} +export declare class ZodDefault extends ZodType, ZodDefaultDef, T["_input"] | undefined> { + _parse(input: ParseInput): ParseReturnType; + removeDefault(): T; + static create: (type: T_1, params: { + errorMap?: ZodErrorMap | undefined; + invalid_type_error?: string | undefined; + required_error?: string | undefined; + message?: string | undefined; + description?: string | undefined; + } & { + default: T_1["_input"] | (() => util.noUndefined); + }) => ZodDefault; +} +export interface ZodCatchDef extends ZodTypeDef { + innerType: T; + catchValue: (ctx: { + error: ZodError; + input: unknown; + }) => T["_input"]; + typeName: ZodFirstPartyTypeKind.ZodCatch; +} +export declare class ZodCatch extends ZodType, unknown> { + _parse(input: ParseInput): ParseReturnType; + removeCatch(): T; + static create: (type: T_1, params: { + errorMap?: ZodErrorMap | undefined; + invalid_type_error?: string | undefined; + required_error?: string | undefined; + message?: string | undefined; + description?: string | undefined; + } & { + catch: T_1["_output"] | (() => T_1["_output"]); + }) => ZodCatch; +} +export interface ZodNaNDef extends ZodTypeDef { + typeName: ZodFirstPartyTypeKind.ZodNaN; +} +export declare class ZodNaN extends ZodType { + _parse(input: ParseInput): ParseReturnType; + static create: (params?: RawCreateParams) => ZodNaN; +} +export interface ZodBrandedDef extends ZodTypeDef { + type: T; + typeName: ZodFirstPartyTypeKind.ZodBranded; +} +export declare const BRAND: unique symbol; +export declare type BRAND = { + [BRAND]: { + [k in T]: true; + }; +}; +export declare class ZodBranded extends ZodType, ZodBrandedDef, T["_input"]> { + _parse(input: ParseInput): ParseReturnType; + unwrap(): T; +} +export interface ZodPipelineDef extends ZodTypeDef { + in: A; + out: B; + typeName: ZodFirstPartyTypeKind.ZodPipeline; +} +export declare class ZodPipeline extends ZodType, A["_input"]> { + _parse(input: ParseInput): ParseReturnType; + static create(a: A, b: B): ZodPipeline; +} +declare type BuiltIn = (((...args: any[]) => any) | (new (...args: any[]) => any)) | { + readonly [Symbol.toStringTag]: string; +} | Date | Error | Generator | Promise | RegExp; +declare type MakeReadonly = T extends Map ? ReadonlyMap : T extends Set ? ReadonlySet : T extends [infer Head, ...infer Tail] ? readonly [Head, ...Tail] : T extends Array ? ReadonlyArray : T extends BuiltIn ? T : Readonly; +export interface ZodReadonlyDef extends ZodTypeDef { + innerType: T; + typeName: ZodFirstPartyTypeKind.ZodReadonly; +} +export declare class ZodReadonly extends ZodType, ZodReadonlyDef, MakeReadonly> { + _parse(input: ParseInput): ParseReturnType; + static create: (type: T_1, params?: RawCreateParams) => ZodReadonly; + unwrap(): T; +} +declare type CustomParams = CustomErrorParams & { + fatal?: boolean; +}; +export declare function custom(check?: (data: any) => any, params?: string | CustomParams | ((input: any) => CustomParams), +/** + * @deprecated + * + * Pass `fatal` into the params object instead: + * + * ```ts + * z.string().custom((val) => val.length > 5, { fatal: false }) + * ``` + * + */ +fatal?: boolean): ZodType; +export { ZodType as Schema, ZodType as ZodSchema }; +export declare const late: { + object: (shape: () => T, params?: RawCreateParams) => ZodObject, any>]: objectUtil.addQuestionMarks, any>[k]; }, { [k_1 in keyof baseObjectInputType]: baseObjectInputType[k_1]; }>; +}; +export declare enum ZodFirstPartyTypeKind { + ZodString = "ZodString", + ZodNumber = "ZodNumber", + ZodNaN = "ZodNaN", + ZodBigInt = "ZodBigInt", + ZodBoolean = "ZodBoolean", + ZodDate = "ZodDate", + ZodSymbol = "ZodSymbol", + ZodUndefined = "ZodUndefined", + ZodNull = "ZodNull", + ZodAny = "ZodAny", + ZodUnknown = "ZodUnknown", + ZodNever = "ZodNever", + ZodVoid = "ZodVoid", + ZodArray = "ZodArray", + ZodObject = "ZodObject", + ZodUnion = "ZodUnion", + ZodDiscriminatedUnion = "ZodDiscriminatedUnion", + ZodIntersection = "ZodIntersection", + ZodTuple = "ZodTuple", + ZodRecord = "ZodRecord", + ZodMap = "ZodMap", + ZodSet = "ZodSet", + ZodFunction = "ZodFunction", + ZodLazy = "ZodLazy", + ZodLiteral = "ZodLiteral", + ZodEnum = "ZodEnum", + ZodEffects = "ZodEffects", + ZodNativeEnum = "ZodNativeEnum", + ZodOptional = "ZodOptional", + ZodNullable = "ZodNullable", + ZodDefault = "ZodDefault", + ZodCatch = "ZodCatch", + ZodPromise = "ZodPromise", + ZodBranded = "ZodBranded", + ZodPipeline = "ZodPipeline", + ZodReadonly = "ZodReadonly" +} +export declare type ZodFirstPartySchemaTypes = ZodString | ZodNumber | ZodNaN | ZodBigInt | ZodBoolean | ZodDate | ZodUndefined | ZodNull | ZodAny | ZodUnknown | ZodNever | ZodVoid | ZodArray | ZodObject | ZodUnion | ZodDiscriminatedUnion | ZodIntersection | ZodTuple | ZodRecord | ZodMap | ZodSet | ZodFunction | ZodLazy | ZodLiteral | ZodEnum | ZodEffects | ZodNativeEnum | ZodOptional | ZodNullable | ZodDefault | ZodCatch | ZodPromise | ZodBranded | ZodPipeline | ZodReadonly | ZodSymbol; +declare abstract class Class { + constructor(..._: any[]); +} +declare const instanceOfType: (cls: T, params?: CustomParams) => ZodType, ZodTypeDef, InstanceType>; +declare const stringType: (params?: ({ + errorMap?: ZodErrorMap | undefined; + invalid_type_error?: string | undefined; + required_error?: string | undefined; + message?: string | undefined; + description?: string | undefined; +} & { + coerce?: true | undefined; +}) | undefined) => ZodString; +declare const numberType: (params?: ({ + errorMap?: ZodErrorMap | undefined; + invalid_type_error?: string | undefined; + required_error?: string | undefined; + message?: string | undefined; + description?: string | undefined; +} & { + coerce?: boolean | undefined; +}) | undefined) => ZodNumber; +declare const nanType: (params?: RawCreateParams) => ZodNaN; +declare const bigIntType: (params?: ({ + errorMap?: ZodErrorMap | undefined; + invalid_type_error?: string | undefined; + required_error?: string | undefined; + message?: string | undefined; + description?: string | undefined; +} & { + coerce?: boolean | undefined; +}) | undefined) => ZodBigInt; +declare const booleanType: (params?: ({ + errorMap?: ZodErrorMap | undefined; + invalid_type_error?: string | undefined; + required_error?: string | undefined; + message?: string | undefined; + description?: string | undefined; +} & { + coerce?: boolean | undefined; +}) | undefined) => ZodBoolean; +declare const dateType: (params?: ({ + errorMap?: ZodErrorMap | undefined; + invalid_type_error?: string | undefined; + required_error?: string | undefined; + message?: string | undefined; + description?: string | undefined; +} & { + coerce?: boolean | undefined; +}) | undefined) => ZodDate; +declare const symbolType: (params?: RawCreateParams) => ZodSymbol; +declare const undefinedType: (params?: RawCreateParams) => ZodUndefined; +declare const nullType: (params?: RawCreateParams) => ZodNull; +declare const anyType: (params?: RawCreateParams) => ZodAny; +declare const unknownType: (params?: RawCreateParams) => ZodUnknown; +declare const neverType: (params?: RawCreateParams) => ZodNever; +declare const voidType: (params?: RawCreateParams) => ZodVoid; +declare const arrayType: (schema: T, params?: RawCreateParams) => ZodArray; +declare const objectType: (shape: T, params?: RawCreateParams) => ZodObject, any>]: objectUtil.addQuestionMarks, any>[k]; }, { [k_1 in keyof baseObjectInputType]: baseObjectInputType[k_1]; }>; +declare const strictObjectType: (shape: T, params?: RawCreateParams) => ZodObject, any>]: objectUtil.addQuestionMarks, any>[k]; }, { [k_1 in keyof baseObjectInputType]: baseObjectInputType[k_1]; }>; +declare const unionType: (types: T, params?: RawCreateParams) => ZodUnion; +declare const discriminatedUnionType: typeof ZodDiscriminatedUnion.create; +declare const intersectionType: (left: T, right: U, params?: RawCreateParams) => ZodIntersection; +declare const tupleType: (schemas: T, params?: RawCreateParams) => ZodTuple; +declare const recordType: typeof ZodRecord.create; +declare const mapType: (keyType: Key, valueType: Value, params?: RawCreateParams) => ZodMap; +declare const setType: (valueType: Value, params?: RawCreateParams) => ZodSet; +declare const functionType: typeof ZodFunction.create; +declare const lazyType: (getter: () => T, params?: RawCreateParams) => ZodLazy; +declare const literalType: (value: T, params?: RawCreateParams) => ZodLiteral; +declare const enumType: typeof createZodEnum; +declare const nativeEnumType: (values: T, params?: RawCreateParams) => ZodNativeEnum; +declare const promiseType: (schema: T, params?: RawCreateParams) => ZodPromise; +declare const effectsType: (schema: I, effect: Effect, params?: RawCreateParams) => ZodEffects>; +declare const optionalType: (type: T, params?: RawCreateParams) => ZodOptional; +declare const nullableType: (type: T, params?: RawCreateParams) => ZodNullable; +declare const preprocessType: (preprocess: (arg: unknown, ctx: RefinementCtx) => unknown, schema: I, params?: RawCreateParams) => ZodEffects; +declare const pipelineType: typeof ZodPipeline.create; +declare const ostring: () => ZodOptional; +declare const onumber: () => ZodOptional; +declare const oboolean: () => ZodOptional; +export declare const coerce: { + string: (params?: ({ + errorMap?: ZodErrorMap | undefined; + invalid_type_error?: string | undefined; + required_error?: string | undefined; + message?: string | undefined; + description?: string | undefined; + } & { + coerce?: true | undefined; + }) | undefined) => ZodString; + number: (params?: ({ + errorMap?: ZodErrorMap | undefined; + invalid_type_error?: string | undefined; + required_error?: string | undefined; + message?: string | undefined; + description?: string | undefined; + } & { + coerce?: boolean | undefined; + }) | undefined) => ZodNumber; + boolean: (params?: ({ + errorMap?: ZodErrorMap | undefined; + invalid_type_error?: string | undefined; + required_error?: string | undefined; + message?: string | undefined; + description?: string | undefined; + } & { + coerce?: boolean | undefined; + }) | undefined) => ZodBoolean; + bigint: (params?: ({ + errorMap?: ZodErrorMap | undefined; + invalid_type_error?: string | undefined; + required_error?: string | undefined; + message?: string | undefined; + description?: string | undefined; + } & { + coerce?: boolean | undefined; + }) | undefined) => ZodBigInt; + date: (params?: ({ + errorMap?: ZodErrorMap | undefined; + invalid_type_error?: string | undefined; + required_error?: string | undefined; + message?: string | undefined; + description?: string | undefined; + } & { + coerce?: boolean | undefined; + }) | undefined) => ZodDate; +}; +export { anyType as any, arrayType as array, bigIntType as bigint, booleanType as boolean, dateType as date, discriminatedUnionType as discriminatedUnion, effectsType as effect, enumType as enum, functionType as function, instanceOfType as instanceof, intersectionType as intersection, lazyType as lazy, literalType as literal, mapType as map, nanType as nan, nativeEnumType as nativeEnum, neverType as never, nullType as null, nullableType as nullable, numberType as number, objectType as object, oboolean, onumber, optionalType as optional, ostring, pipelineType as pipeline, preprocessType as preprocess, promiseType as promise, recordType as record, setType as set, strictObjectType as strictObject, stringType as string, symbolType as symbol, effectsType as transformer, tupleType as tuple, undefinedType as undefined, unionType as union, unknownType as unknown, voidType as void, }; +export declare const NEVER: never; diff --git a/front_end/third_party/mcp-sdk/zod/lib/types.js b/front_end/third_party/mcp-sdk/zod/lib/types.js new file mode 100644 index 0000000000..0eb943a350 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/lib/types.js @@ -0,0 +1,3677 @@ +"use strict"; +var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); +}; +var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; +}; +var _ZodEnum_cache, _ZodNativeEnum_cache; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.boolean = exports.bigint = exports.array = exports.any = exports.coerce = exports.ZodFirstPartyTypeKind = exports.late = exports.ZodSchema = exports.Schema = exports.custom = exports.ZodReadonly = exports.ZodPipeline = exports.ZodBranded = exports.BRAND = exports.ZodNaN = exports.ZodCatch = exports.ZodDefault = exports.ZodNullable = exports.ZodOptional = exports.ZodTransformer = exports.ZodEffects = exports.ZodPromise = exports.ZodNativeEnum = exports.ZodEnum = exports.ZodLiteral = exports.ZodLazy = exports.ZodFunction = exports.ZodSet = exports.ZodMap = exports.ZodRecord = exports.ZodTuple = exports.ZodIntersection = exports.ZodDiscriminatedUnion = exports.ZodUnion = exports.ZodObject = exports.ZodArray = exports.ZodVoid = exports.ZodNever = exports.ZodUnknown = exports.ZodAny = exports.ZodNull = exports.ZodUndefined = exports.ZodSymbol = exports.ZodDate = exports.ZodBoolean = exports.ZodBigInt = exports.ZodNumber = exports.ZodString = exports.datetimeRegex = exports.ZodType = void 0; +exports.NEVER = exports.void = exports.unknown = exports.union = exports.undefined = exports.tuple = exports.transformer = exports.symbol = exports.string = exports.strictObject = exports.set = exports.record = exports.promise = exports.preprocess = exports.pipeline = exports.ostring = exports.optional = exports.onumber = exports.oboolean = exports.object = exports.number = exports.nullable = exports.null = exports.never = exports.nativeEnum = exports.nan = exports.map = exports.literal = exports.lazy = exports.intersection = exports.instanceof = exports.function = exports.enum = exports.effect = exports.discriminatedUnion = exports.date = void 0; +const errors_1 = require("./errors"); +const errorUtil_1 = require("./helpers/errorUtil"); +const parseUtil_1 = require("./helpers/parseUtil"); +const util_1 = require("./helpers/util"); +const ZodError_1 = require("./ZodError"); +class ParseInputLazyPath { + constructor(parent, value, path, key) { + this._cachedPath = []; + this.parent = parent; + this.data = value; + this._path = path; + this._key = key; + } + get path() { + if (!this._cachedPath.length) { + if (this._key instanceof Array) { + this._cachedPath.push(...this._path, ...this._key); + } + else { + this._cachedPath.push(...this._path, this._key); + } + } + return this._cachedPath; + } +} +const handleResult = (ctx, result) => { + if ((0, parseUtil_1.isValid)(result)) { + return { success: true, data: result.value }; + } + else { + if (!ctx.common.issues.length) { + throw new Error("Validation failed but no issues detected."); + } + return { + success: false, + get error() { + if (this._error) + return this._error; + const error = new ZodError_1.ZodError(ctx.common.issues); + this._error = error; + return this._error; + }, + }; + } +}; +function processCreateParams(params) { + if (!params) + return {}; + const { errorMap, invalid_type_error, required_error, description } = params; + if (errorMap && (invalid_type_error || required_error)) { + throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`); + } + if (errorMap) + return { errorMap: errorMap, description }; + const customMap = (iss, ctx) => { + var _a, _b; + const { message } = params; + if (iss.code === "invalid_enum_value") { + return { message: message !== null && message !== void 0 ? message : ctx.defaultError }; + } + if (typeof ctx.data === "undefined") { + return { message: (_a = message !== null && message !== void 0 ? message : required_error) !== null && _a !== void 0 ? _a : ctx.defaultError }; + } + if (iss.code !== "invalid_type") + return { message: ctx.defaultError }; + return { message: (_b = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _b !== void 0 ? _b : ctx.defaultError }; + }; + return { errorMap: customMap, description }; +} +class ZodType { + constructor(def) { + /** Alias of safeParseAsync */ + this.spa = this.safeParseAsync; + this._def = def; + this.parse = this.parse.bind(this); + this.safeParse = this.safeParse.bind(this); + this.parseAsync = this.parseAsync.bind(this); + this.safeParseAsync = this.safeParseAsync.bind(this); + this.spa = this.spa.bind(this); + this.refine = this.refine.bind(this); + this.refinement = this.refinement.bind(this); + this.superRefine = this.superRefine.bind(this); + this.optional = this.optional.bind(this); + this.nullable = this.nullable.bind(this); + this.nullish = this.nullish.bind(this); + this.array = this.array.bind(this); + this.promise = this.promise.bind(this); + this.or = this.or.bind(this); + this.and = this.and.bind(this); + this.transform = this.transform.bind(this); + this.brand = this.brand.bind(this); + this.default = this.default.bind(this); + this.catch = this.catch.bind(this); + this.describe = this.describe.bind(this); + this.pipe = this.pipe.bind(this); + this.readonly = this.readonly.bind(this); + this.isNullable = this.isNullable.bind(this); + this.isOptional = this.isOptional.bind(this); + } + get description() { + return this._def.description; + } + _getType(input) { + return (0, util_1.getParsedType)(input.data); + } + _getOrReturnCtx(input, ctx) { + return (ctx || { + common: input.parent.common, + data: input.data, + parsedType: (0, util_1.getParsedType)(input.data), + schemaErrorMap: this._def.errorMap, + path: input.path, + parent: input.parent, + }); + } + _processInputParams(input) { + return { + status: new parseUtil_1.ParseStatus(), + ctx: { + common: input.parent.common, + data: input.data, + parsedType: (0, util_1.getParsedType)(input.data), + schemaErrorMap: this._def.errorMap, + path: input.path, + parent: input.parent, + }, + }; + } + _parseSync(input) { + const result = this._parse(input); + if ((0, parseUtil_1.isAsync)(result)) { + throw new Error("Synchronous parse encountered promise."); + } + return result; + } + _parseAsync(input) { + const result = this._parse(input); + return Promise.resolve(result); + } + parse(data, params) { + const result = this.safeParse(data, params); + if (result.success) + return result.data; + throw result.error; + } + safeParse(data, params) { + var _a; + const ctx = { + common: { + issues: [], + async: (_a = params === null || params === void 0 ? void 0 : params.async) !== null && _a !== void 0 ? _a : false, + contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap, + }, + path: (params === null || params === void 0 ? void 0 : params.path) || [], + schemaErrorMap: this._def.errorMap, + parent: null, + data, + parsedType: (0, util_1.getParsedType)(data), + }; + const result = this._parseSync({ data, path: ctx.path, parent: ctx }); + return handleResult(ctx, result); + } + async parseAsync(data, params) { + const result = await this.safeParseAsync(data, params); + if (result.success) + return result.data; + throw result.error; + } + async safeParseAsync(data, params) { + const ctx = { + common: { + issues: [], + contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap, + async: true, + }, + path: (params === null || params === void 0 ? void 0 : params.path) || [], + schemaErrorMap: this._def.errorMap, + parent: null, + data, + parsedType: (0, util_1.getParsedType)(data), + }; + const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx }); + const result = await ((0, parseUtil_1.isAsync)(maybeAsyncResult) + ? maybeAsyncResult + : Promise.resolve(maybeAsyncResult)); + return handleResult(ctx, result); + } + refine(check, message) { + const getIssueProperties = (val) => { + if (typeof message === "string" || typeof message === "undefined") { + return { message }; + } + else if (typeof message === "function") { + return message(val); + } + else { + return message; + } + }; + return this._refinement((val, ctx) => { + const result = check(val); + const setError = () => ctx.addIssue({ + code: ZodError_1.ZodIssueCode.custom, + ...getIssueProperties(val), + }); + if (typeof Promise !== "undefined" && result instanceof Promise) { + return result.then((data) => { + if (!data) { + setError(); + return false; + } + else { + return true; + } + }); + } + if (!result) { + setError(); + return false; + } + else { + return true; + } + }); + } + refinement(check, refinementData) { + return this._refinement((val, ctx) => { + if (!check(val)) { + ctx.addIssue(typeof refinementData === "function" + ? refinementData(val, ctx) + : refinementData); + return false; + } + else { + return true; + } + }); + } + _refinement(refinement) { + return new ZodEffects({ + schema: this, + typeName: ZodFirstPartyTypeKind.ZodEffects, + effect: { type: "refinement", refinement }, + }); + } + superRefine(refinement) { + return this._refinement(refinement); + } + optional() { + return ZodOptional.create(this, this._def); + } + nullable() { + return ZodNullable.create(this, this._def); + } + nullish() { + return this.nullable().optional(); + } + array() { + return ZodArray.create(this, this._def); + } + promise() { + return ZodPromise.create(this, this._def); + } + or(option) { + return ZodUnion.create([this, option], this._def); + } + and(incoming) { + return ZodIntersection.create(this, incoming, this._def); + } + transform(transform) { + return new ZodEffects({ + ...processCreateParams(this._def), + schema: this, + typeName: ZodFirstPartyTypeKind.ZodEffects, + effect: { type: "transform", transform }, + }); + } + default(def) { + const defaultValueFunc = typeof def === "function" ? def : () => def; + return new ZodDefault({ + ...processCreateParams(this._def), + innerType: this, + defaultValue: defaultValueFunc, + typeName: ZodFirstPartyTypeKind.ZodDefault, + }); + } + brand() { + return new ZodBranded({ + typeName: ZodFirstPartyTypeKind.ZodBranded, + type: this, + ...processCreateParams(this._def), + }); + } + catch(def) { + const catchValueFunc = typeof def === "function" ? def : () => def; + return new ZodCatch({ + ...processCreateParams(this._def), + innerType: this, + catchValue: catchValueFunc, + typeName: ZodFirstPartyTypeKind.ZodCatch, + }); + } + describe(description) { + const This = this.constructor; + return new This({ + ...this._def, + description, + }); + } + pipe(target) { + return ZodPipeline.create(this, target); + } + readonly() { + return ZodReadonly.create(this); + } + isOptional() { + return this.safeParse(undefined).success; + } + isNullable() { + return this.safeParse(null).success; + } +} +exports.ZodType = ZodType; +exports.Schema = ZodType; +exports.ZodSchema = ZodType; +const cuidRegex = /^c[^\s-]{8,}$/i; +const cuid2Regex = /^[0-9a-z]+$/; +const ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/; +// const uuidRegex = +// /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i; +const uuidRegex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i; +const nanoidRegex = /^[a-z0-9_-]{21}$/i; +const durationRegex = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/; +// from https://stackoverflow.com/a/46181/1550155 +// old version: too slow, didn't support unicode +// const emailRegex = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i; +//old email regex +// const emailRegex = /^(([^<>()[\].,;:\s@"]+(\.[^<>()[\].,;:\s@"]+)*)|(".+"))@((?!-)([^<>()[\].,;:\s@"]+\.)+[^<>()[\].,;:\s@"]{1,})[^-<>()[\].,;:\s@"]$/i; +// eslint-disable-next-line +// const emailRegex = +// /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\])|(\[IPv6:(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\.[A-Za-z]{2,})+))$/; +// const emailRegex = +// /^[a-zA-Z0-9\.\!\#\$\%\&\'\*\+\/\=\?\^\_\`\{\|\}\~\-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/; +// const emailRegex = +// /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i; +const emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i; +// const emailRegex = +// /^[a-z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-z0-9-]+(?:\.[a-z0-9\-]+)*$/i; +// from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression +const _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`; +let emojiRegex; +// faster, simpler, safer +const ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/; +const ipv6Regex = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/; +// https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript +const base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/; +// simple +// const dateRegexSource = `\\d{4}-\\d{2}-\\d{2}`; +// no leap year validation +// const dateRegexSource = `\\d{4}-((0[13578]|10|12)-31|(0[13-9]|1[0-2])-30|(0[1-9]|1[0-2])-(0[1-9]|1\\d|2\\d))`; +// with leap year validation +const dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`; +const dateRegex = new RegExp(`^${dateRegexSource}$`); +function timeRegexSource(args) { + // let regex = `\\d{2}:\\d{2}:\\d{2}`; + let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`; + if (args.precision) { + regex = `${regex}\\.\\d{${args.precision}}`; + } + else if (args.precision == null) { + regex = `${regex}(\\.\\d+)?`; + } + return regex; +} +function timeRegex(args) { + return new RegExp(`^${timeRegexSource(args)}$`); +} +// Adapted from https://stackoverflow.com/a/3143231 +function datetimeRegex(args) { + let regex = `${dateRegexSource}T${timeRegexSource(args)}`; + const opts = []; + opts.push(args.local ? `Z?` : `Z`); + if (args.offset) + opts.push(`([+-]\\d{2}:?\\d{2})`); + regex = `${regex}(${opts.join("|")})`; + return new RegExp(`^${regex}$`); +} +exports.datetimeRegex = datetimeRegex; +function isValidIP(ip, version) { + if ((version === "v4" || !version) && ipv4Regex.test(ip)) { + return true; + } + if ((version === "v6" || !version) && ipv6Regex.test(ip)) { + return true; + } + return false; +} +class ZodString extends ZodType { + _parse(input) { + if (this._def.coerce) { + input.data = String(input.data); + } + const parsedType = this._getType(input); + if (parsedType !== util_1.ZodParsedType.string) { + const ctx = this._getOrReturnCtx(input); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_type, + expected: util_1.ZodParsedType.string, + received: ctx.parsedType, + }); + return parseUtil_1.INVALID; + } + const status = new parseUtil_1.ParseStatus(); + let ctx = undefined; + for (const check of this._def.checks) { + if (check.kind === "min") { + if (input.data.length < check.value) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.too_small, + minimum: check.value, + type: "string", + inclusive: true, + exact: false, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "max") { + if (input.data.length > check.value) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.too_big, + maximum: check.value, + type: "string", + inclusive: true, + exact: false, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "length") { + const tooBig = input.data.length > check.value; + const tooSmall = input.data.length < check.value; + if (tooBig || tooSmall) { + ctx = this._getOrReturnCtx(input, ctx); + if (tooBig) { + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.too_big, + maximum: check.value, + type: "string", + inclusive: true, + exact: true, + message: check.message, + }); + } + else if (tooSmall) { + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.too_small, + minimum: check.value, + type: "string", + inclusive: true, + exact: true, + message: check.message, + }); + } + status.dirty(); + } + } + else if (check.kind === "email") { + if (!emailRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + validation: "email", + code: ZodError_1.ZodIssueCode.invalid_string, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "emoji") { + if (!emojiRegex) { + emojiRegex = new RegExp(_emojiRegex, "u"); + } + if (!emojiRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + validation: "emoji", + code: ZodError_1.ZodIssueCode.invalid_string, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "uuid") { + if (!uuidRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + validation: "uuid", + code: ZodError_1.ZodIssueCode.invalid_string, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "nanoid") { + if (!nanoidRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + validation: "nanoid", + code: ZodError_1.ZodIssueCode.invalid_string, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "cuid") { + if (!cuidRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + validation: "cuid", + code: ZodError_1.ZodIssueCode.invalid_string, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "cuid2") { + if (!cuid2Regex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + validation: "cuid2", + code: ZodError_1.ZodIssueCode.invalid_string, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "ulid") { + if (!ulidRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + validation: "ulid", + code: ZodError_1.ZodIssueCode.invalid_string, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "url") { + try { + new URL(input.data); + } + catch (_a) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + validation: "url", + code: ZodError_1.ZodIssueCode.invalid_string, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "regex") { + check.regex.lastIndex = 0; + const testResult = check.regex.test(input.data); + if (!testResult) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + validation: "regex", + code: ZodError_1.ZodIssueCode.invalid_string, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "trim") { + input.data = input.data.trim(); + } + else if (check.kind === "includes") { + if (!input.data.includes(check.value, check.position)) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_string, + validation: { includes: check.value, position: check.position }, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "toLowerCase") { + input.data = input.data.toLowerCase(); + } + else if (check.kind === "toUpperCase") { + input.data = input.data.toUpperCase(); + } + else if (check.kind === "startsWith") { + if (!input.data.startsWith(check.value)) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_string, + validation: { startsWith: check.value }, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "endsWith") { + if (!input.data.endsWith(check.value)) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_string, + validation: { endsWith: check.value }, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "datetime") { + const regex = datetimeRegex(check); + if (!regex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_string, + validation: "datetime", + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "date") { + const regex = dateRegex; + if (!regex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_string, + validation: "date", + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "time") { + const regex = timeRegex(check); + if (!regex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_string, + validation: "time", + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "duration") { + if (!durationRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + validation: "duration", + code: ZodError_1.ZodIssueCode.invalid_string, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "ip") { + if (!isValidIP(input.data, check.version)) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + validation: "ip", + code: ZodError_1.ZodIssueCode.invalid_string, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "base64") { + if (!base64Regex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + validation: "base64", + code: ZodError_1.ZodIssueCode.invalid_string, + message: check.message, + }); + status.dirty(); + } + } + else { + util_1.util.assertNever(check); + } + } + return { status: status.value, value: input.data }; + } + _regex(regex, validation, message) { + return this.refinement((data) => regex.test(data), { + validation, + code: ZodError_1.ZodIssueCode.invalid_string, + ...errorUtil_1.errorUtil.errToObj(message), + }); + } + _addCheck(check) { + return new ZodString({ + ...this._def, + checks: [...this._def.checks, check], + }); + } + email(message) { + return this._addCheck({ kind: "email", ...errorUtil_1.errorUtil.errToObj(message) }); + } + url(message) { + return this._addCheck({ kind: "url", ...errorUtil_1.errorUtil.errToObj(message) }); + } + emoji(message) { + return this._addCheck({ kind: "emoji", ...errorUtil_1.errorUtil.errToObj(message) }); + } + uuid(message) { + return this._addCheck({ kind: "uuid", ...errorUtil_1.errorUtil.errToObj(message) }); + } + nanoid(message) { + return this._addCheck({ kind: "nanoid", ...errorUtil_1.errorUtil.errToObj(message) }); + } + cuid(message) { + return this._addCheck({ kind: "cuid", ...errorUtil_1.errorUtil.errToObj(message) }); + } + cuid2(message) { + return this._addCheck({ kind: "cuid2", ...errorUtil_1.errorUtil.errToObj(message) }); + } + ulid(message) { + return this._addCheck({ kind: "ulid", ...errorUtil_1.errorUtil.errToObj(message) }); + } + base64(message) { + return this._addCheck({ kind: "base64", ...errorUtil_1.errorUtil.errToObj(message) }); + } + ip(options) { + return this._addCheck({ kind: "ip", ...errorUtil_1.errorUtil.errToObj(options) }); + } + datetime(options) { + var _a, _b; + if (typeof options === "string") { + return this._addCheck({ + kind: "datetime", + precision: null, + offset: false, + local: false, + message: options, + }); + } + return this._addCheck({ + kind: "datetime", + precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision, + offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false, + local: (_b = options === null || options === void 0 ? void 0 : options.local) !== null && _b !== void 0 ? _b : false, + ...errorUtil_1.errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message), + }); + } + date(message) { + return this._addCheck({ kind: "date", message }); + } + time(options) { + if (typeof options === "string") { + return this._addCheck({ + kind: "time", + precision: null, + message: options, + }); + } + return this._addCheck({ + kind: "time", + precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision, + ...errorUtil_1.errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message), + }); + } + duration(message) { + return this._addCheck({ kind: "duration", ...errorUtil_1.errorUtil.errToObj(message) }); + } + regex(regex, message) { + return this._addCheck({ + kind: "regex", + regex: regex, + ...errorUtil_1.errorUtil.errToObj(message), + }); + } + includes(value, options) { + return this._addCheck({ + kind: "includes", + value: value, + position: options === null || options === void 0 ? void 0 : options.position, + ...errorUtil_1.errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message), + }); + } + startsWith(value, message) { + return this._addCheck({ + kind: "startsWith", + value: value, + ...errorUtil_1.errorUtil.errToObj(message), + }); + } + endsWith(value, message) { + return this._addCheck({ + kind: "endsWith", + value: value, + ...errorUtil_1.errorUtil.errToObj(message), + }); + } + min(minLength, message) { + return this._addCheck({ + kind: "min", + value: minLength, + ...errorUtil_1.errorUtil.errToObj(message), + }); + } + max(maxLength, message) { + return this._addCheck({ + kind: "max", + value: maxLength, + ...errorUtil_1.errorUtil.errToObj(message), + }); + } + length(len, message) { + return this._addCheck({ + kind: "length", + value: len, + ...errorUtil_1.errorUtil.errToObj(message), + }); + } + /** + * @deprecated Use z.string().min(1) instead. + * @see {@link ZodString.min} + */ + nonempty(message) { + return this.min(1, errorUtil_1.errorUtil.errToObj(message)); + } + trim() { + return new ZodString({ + ...this._def, + checks: [...this._def.checks, { kind: "trim" }], + }); + } + toLowerCase() { + return new ZodString({ + ...this._def, + checks: [...this._def.checks, { kind: "toLowerCase" }], + }); + } + toUpperCase() { + return new ZodString({ + ...this._def, + checks: [...this._def.checks, { kind: "toUpperCase" }], + }); + } + get isDatetime() { + return !!this._def.checks.find((ch) => ch.kind === "datetime"); + } + get isDate() { + return !!this._def.checks.find((ch) => ch.kind === "date"); + } + get isTime() { + return !!this._def.checks.find((ch) => ch.kind === "time"); + } + get isDuration() { + return !!this._def.checks.find((ch) => ch.kind === "duration"); + } + get isEmail() { + return !!this._def.checks.find((ch) => ch.kind === "email"); + } + get isURL() { + return !!this._def.checks.find((ch) => ch.kind === "url"); + } + get isEmoji() { + return !!this._def.checks.find((ch) => ch.kind === "emoji"); + } + get isUUID() { + return !!this._def.checks.find((ch) => ch.kind === "uuid"); + } + get isNANOID() { + return !!this._def.checks.find((ch) => ch.kind === "nanoid"); + } + get isCUID() { + return !!this._def.checks.find((ch) => ch.kind === "cuid"); + } + get isCUID2() { + return !!this._def.checks.find((ch) => ch.kind === "cuid2"); + } + get isULID() { + return !!this._def.checks.find((ch) => ch.kind === "ulid"); + } + get isIP() { + return !!this._def.checks.find((ch) => ch.kind === "ip"); + } + get isBase64() { + return !!this._def.checks.find((ch) => ch.kind === "base64"); + } + get minLength() { + let min = null; + for (const ch of this._def.checks) { + if (ch.kind === "min") { + if (min === null || ch.value > min) + min = ch.value; + } + } + return min; + } + get maxLength() { + let max = null; + for (const ch of this._def.checks) { + if (ch.kind === "max") { + if (max === null || ch.value < max) + max = ch.value; + } + } + return max; + } +} +exports.ZodString = ZodString; +ZodString.create = (params) => { + var _a; + return new ZodString({ + checks: [], + typeName: ZodFirstPartyTypeKind.ZodString, + coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false, + ...processCreateParams(params), + }); +}; +// https://stackoverflow.com/questions/3966484/why-does-modulus-operator-return-fractional-number-in-javascript/31711034#31711034 +function floatSafeRemainder(val, step) { + const valDecCount = (val.toString().split(".")[1] || "").length; + const stepDecCount = (step.toString().split(".")[1] || "").length; + const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount; + const valInt = parseInt(val.toFixed(decCount).replace(".", "")); + const stepInt = parseInt(step.toFixed(decCount).replace(".", "")); + return (valInt % stepInt) / Math.pow(10, decCount); +} +class ZodNumber extends ZodType { + constructor() { + super(...arguments); + this.min = this.gte; + this.max = this.lte; + this.step = this.multipleOf; + } + _parse(input) { + if (this._def.coerce) { + input.data = Number(input.data); + } + const parsedType = this._getType(input); + if (parsedType !== util_1.ZodParsedType.number) { + const ctx = this._getOrReturnCtx(input); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_type, + expected: util_1.ZodParsedType.number, + received: ctx.parsedType, + }); + return parseUtil_1.INVALID; + } + let ctx = undefined; + const status = new parseUtil_1.ParseStatus(); + for (const check of this._def.checks) { + if (check.kind === "int") { + if (!util_1.util.isInteger(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_type, + expected: "integer", + received: "float", + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "min") { + const tooSmall = check.inclusive + ? input.data < check.value + : input.data <= check.value; + if (tooSmall) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.too_small, + minimum: check.value, + type: "number", + inclusive: check.inclusive, + exact: false, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "max") { + const tooBig = check.inclusive + ? input.data > check.value + : input.data >= check.value; + if (tooBig) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.too_big, + maximum: check.value, + type: "number", + inclusive: check.inclusive, + exact: false, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "multipleOf") { + if (floatSafeRemainder(input.data, check.value) !== 0) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.not_multiple_of, + multipleOf: check.value, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "finite") { + if (!Number.isFinite(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.not_finite, + message: check.message, + }); + status.dirty(); + } + } + else { + util_1.util.assertNever(check); + } + } + return { status: status.value, value: input.data }; + } + gte(value, message) { + return this.setLimit("min", value, true, errorUtil_1.errorUtil.toString(message)); + } + gt(value, message) { + return this.setLimit("min", value, false, errorUtil_1.errorUtil.toString(message)); + } + lte(value, message) { + return this.setLimit("max", value, true, errorUtil_1.errorUtil.toString(message)); + } + lt(value, message) { + return this.setLimit("max", value, false, errorUtil_1.errorUtil.toString(message)); + } + setLimit(kind, value, inclusive, message) { + return new ZodNumber({ + ...this._def, + checks: [ + ...this._def.checks, + { + kind, + value, + inclusive, + message: errorUtil_1.errorUtil.toString(message), + }, + ], + }); + } + _addCheck(check) { + return new ZodNumber({ + ...this._def, + checks: [...this._def.checks, check], + }); + } + int(message) { + return this._addCheck({ + kind: "int", + message: errorUtil_1.errorUtil.toString(message), + }); + } + positive(message) { + return this._addCheck({ + kind: "min", + value: 0, + inclusive: false, + message: errorUtil_1.errorUtil.toString(message), + }); + } + negative(message) { + return this._addCheck({ + kind: "max", + value: 0, + inclusive: false, + message: errorUtil_1.errorUtil.toString(message), + }); + } + nonpositive(message) { + return this._addCheck({ + kind: "max", + value: 0, + inclusive: true, + message: errorUtil_1.errorUtil.toString(message), + }); + } + nonnegative(message) { + return this._addCheck({ + kind: "min", + value: 0, + inclusive: true, + message: errorUtil_1.errorUtil.toString(message), + }); + } + multipleOf(value, message) { + return this._addCheck({ + kind: "multipleOf", + value: value, + message: errorUtil_1.errorUtil.toString(message), + }); + } + finite(message) { + return this._addCheck({ + kind: "finite", + message: errorUtil_1.errorUtil.toString(message), + }); + } + safe(message) { + return this._addCheck({ + kind: "min", + inclusive: true, + value: Number.MIN_SAFE_INTEGER, + message: errorUtil_1.errorUtil.toString(message), + })._addCheck({ + kind: "max", + inclusive: true, + value: Number.MAX_SAFE_INTEGER, + message: errorUtil_1.errorUtil.toString(message), + }); + } + get minValue() { + let min = null; + for (const ch of this._def.checks) { + if (ch.kind === "min") { + if (min === null || ch.value > min) + min = ch.value; + } + } + return min; + } + get maxValue() { + let max = null; + for (const ch of this._def.checks) { + if (ch.kind === "max") { + if (max === null || ch.value < max) + max = ch.value; + } + } + return max; + } + get isInt() { + return !!this._def.checks.find((ch) => ch.kind === "int" || + (ch.kind === "multipleOf" && util_1.util.isInteger(ch.value))); + } + get isFinite() { + let max = null, min = null; + for (const ch of this._def.checks) { + if (ch.kind === "finite" || + ch.kind === "int" || + ch.kind === "multipleOf") { + return true; + } + else if (ch.kind === "min") { + if (min === null || ch.value > min) + min = ch.value; + } + else if (ch.kind === "max") { + if (max === null || ch.value < max) + max = ch.value; + } + } + return Number.isFinite(min) && Number.isFinite(max); + } +} +exports.ZodNumber = ZodNumber; +ZodNumber.create = (params) => { + return new ZodNumber({ + checks: [], + typeName: ZodFirstPartyTypeKind.ZodNumber, + coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false, + ...processCreateParams(params), + }); +}; +class ZodBigInt extends ZodType { + constructor() { + super(...arguments); + this.min = this.gte; + this.max = this.lte; + } + _parse(input) { + if (this._def.coerce) { + input.data = BigInt(input.data); + } + const parsedType = this._getType(input); + if (parsedType !== util_1.ZodParsedType.bigint) { + const ctx = this._getOrReturnCtx(input); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_type, + expected: util_1.ZodParsedType.bigint, + received: ctx.parsedType, + }); + return parseUtil_1.INVALID; + } + let ctx = undefined; + const status = new parseUtil_1.ParseStatus(); + for (const check of this._def.checks) { + if (check.kind === "min") { + const tooSmall = check.inclusive + ? input.data < check.value + : input.data <= check.value; + if (tooSmall) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.too_small, + type: "bigint", + minimum: check.value, + inclusive: check.inclusive, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "max") { + const tooBig = check.inclusive + ? input.data > check.value + : input.data >= check.value; + if (tooBig) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.too_big, + type: "bigint", + maximum: check.value, + inclusive: check.inclusive, + message: check.message, + }); + status.dirty(); + } + } + else if (check.kind === "multipleOf") { + if (input.data % check.value !== BigInt(0)) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.not_multiple_of, + multipleOf: check.value, + message: check.message, + }); + status.dirty(); + } + } + else { + util_1.util.assertNever(check); + } + } + return { status: status.value, value: input.data }; + } + gte(value, message) { + return this.setLimit("min", value, true, errorUtil_1.errorUtil.toString(message)); + } + gt(value, message) { + return this.setLimit("min", value, false, errorUtil_1.errorUtil.toString(message)); + } + lte(value, message) { + return this.setLimit("max", value, true, errorUtil_1.errorUtil.toString(message)); + } + lt(value, message) { + return this.setLimit("max", value, false, errorUtil_1.errorUtil.toString(message)); + } + setLimit(kind, value, inclusive, message) { + return new ZodBigInt({ + ...this._def, + checks: [ + ...this._def.checks, + { + kind, + value, + inclusive, + message: errorUtil_1.errorUtil.toString(message), + }, + ], + }); + } + _addCheck(check) { + return new ZodBigInt({ + ...this._def, + checks: [...this._def.checks, check], + }); + } + positive(message) { + return this._addCheck({ + kind: "min", + value: BigInt(0), + inclusive: false, + message: errorUtil_1.errorUtil.toString(message), + }); + } + negative(message) { + return this._addCheck({ + kind: "max", + value: BigInt(0), + inclusive: false, + message: errorUtil_1.errorUtil.toString(message), + }); + } + nonpositive(message) { + return this._addCheck({ + kind: "max", + value: BigInt(0), + inclusive: true, + message: errorUtil_1.errorUtil.toString(message), + }); + } + nonnegative(message) { + return this._addCheck({ + kind: "min", + value: BigInt(0), + inclusive: true, + message: errorUtil_1.errorUtil.toString(message), + }); + } + multipleOf(value, message) { + return this._addCheck({ + kind: "multipleOf", + value, + message: errorUtil_1.errorUtil.toString(message), + }); + } + get minValue() { + let min = null; + for (const ch of this._def.checks) { + if (ch.kind === "min") { + if (min === null || ch.value > min) + min = ch.value; + } + } + return min; + } + get maxValue() { + let max = null; + for (const ch of this._def.checks) { + if (ch.kind === "max") { + if (max === null || ch.value < max) + max = ch.value; + } + } + return max; + } +} +exports.ZodBigInt = ZodBigInt; +ZodBigInt.create = (params) => { + var _a; + return new ZodBigInt({ + checks: [], + typeName: ZodFirstPartyTypeKind.ZodBigInt, + coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false, + ...processCreateParams(params), + }); +}; +class ZodBoolean extends ZodType { + _parse(input) { + if (this._def.coerce) { + input.data = Boolean(input.data); + } + const parsedType = this._getType(input); + if (parsedType !== util_1.ZodParsedType.boolean) { + const ctx = this._getOrReturnCtx(input); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_type, + expected: util_1.ZodParsedType.boolean, + received: ctx.parsedType, + }); + return parseUtil_1.INVALID; + } + return (0, parseUtil_1.OK)(input.data); + } +} +exports.ZodBoolean = ZodBoolean; +ZodBoolean.create = (params) => { + return new ZodBoolean({ + typeName: ZodFirstPartyTypeKind.ZodBoolean, + coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false, + ...processCreateParams(params), + }); +}; +class ZodDate extends ZodType { + _parse(input) { + if (this._def.coerce) { + input.data = new Date(input.data); + } + const parsedType = this._getType(input); + if (parsedType !== util_1.ZodParsedType.date) { + const ctx = this._getOrReturnCtx(input); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_type, + expected: util_1.ZodParsedType.date, + received: ctx.parsedType, + }); + return parseUtil_1.INVALID; + } + if (isNaN(input.data.getTime())) { + const ctx = this._getOrReturnCtx(input); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_date, + }); + return parseUtil_1.INVALID; + } + const status = new parseUtil_1.ParseStatus(); + let ctx = undefined; + for (const check of this._def.checks) { + if (check.kind === "min") { + if (input.data.getTime() < check.value) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.too_small, + message: check.message, + inclusive: true, + exact: false, + minimum: check.value, + type: "date", + }); + status.dirty(); + } + } + else if (check.kind === "max") { + if (input.data.getTime() > check.value) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.too_big, + message: check.message, + inclusive: true, + exact: false, + maximum: check.value, + type: "date", + }); + status.dirty(); + } + } + else { + util_1.util.assertNever(check); + } + } + return { + status: status.value, + value: new Date(input.data.getTime()), + }; + } + _addCheck(check) { + return new ZodDate({ + ...this._def, + checks: [...this._def.checks, check], + }); + } + min(minDate, message) { + return this._addCheck({ + kind: "min", + value: minDate.getTime(), + message: errorUtil_1.errorUtil.toString(message), + }); + } + max(maxDate, message) { + return this._addCheck({ + kind: "max", + value: maxDate.getTime(), + message: errorUtil_1.errorUtil.toString(message), + }); + } + get minDate() { + let min = null; + for (const ch of this._def.checks) { + if (ch.kind === "min") { + if (min === null || ch.value > min) + min = ch.value; + } + } + return min != null ? new Date(min) : null; + } + get maxDate() { + let max = null; + for (const ch of this._def.checks) { + if (ch.kind === "max") { + if (max === null || ch.value < max) + max = ch.value; + } + } + return max != null ? new Date(max) : null; + } +} +exports.ZodDate = ZodDate; +ZodDate.create = (params) => { + return new ZodDate({ + checks: [], + coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false, + typeName: ZodFirstPartyTypeKind.ZodDate, + ...processCreateParams(params), + }); +}; +class ZodSymbol extends ZodType { + _parse(input) { + const parsedType = this._getType(input); + if (parsedType !== util_1.ZodParsedType.symbol) { + const ctx = this._getOrReturnCtx(input); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_type, + expected: util_1.ZodParsedType.symbol, + received: ctx.parsedType, + }); + return parseUtil_1.INVALID; + } + return (0, parseUtil_1.OK)(input.data); + } +} +exports.ZodSymbol = ZodSymbol; +ZodSymbol.create = (params) => { + return new ZodSymbol({ + typeName: ZodFirstPartyTypeKind.ZodSymbol, + ...processCreateParams(params), + }); +}; +class ZodUndefined extends ZodType { + _parse(input) { + const parsedType = this._getType(input); + if (parsedType !== util_1.ZodParsedType.undefined) { + const ctx = this._getOrReturnCtx(input); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_type, + expected: util_1.ZodParsedType.undefined, + received: ctx.parsedType, + }); + return parseUtil_1.INVALID; + } + return (0, parseUtil_1.OK)(input.data); + } +} +exports.ZodUndefined = ZodUndefined; +ZodUndefined.create = (params) => { + return new ZodUndefined({ + typeName: ZodFirstPartyTypeKind.ZodUndefined, + ...processCreateParams(params), + }); +}; +class ZodNull extends ZodType { + _parse(input) { + const parsedType = this._getType(input); + if (parsedType !== util_1.ZodParsedType.null) { + const ctx = this._getOrReturnCtx(input); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_type, + expected: util_1.ZodParsedType.null, + received: ctx.parsedType, + }); + return parseUtil_1.INVALID; + } + return (0, parseUtil_1.OK)(input.data); + } +} +exports.ZodNull = ZodNull; +ZodNull.create = (params) => { + return new ZodNull({ + typeName: ZodFirstPartyTypeKind.ZodNull, + ...processCreateParams(params), + }); +}; +class ZodAny extends ZodType { + constructor() { + super(...arguments); + // to prevent instances of other classes from extending ZodAny. this causes issues with catchall in ZodObject. + this._any = true; + } + _parse(input) { + return (0, parseUtil_1.OK)(input.data); + } +} +exports.ZodAny = ZodAny; +ZodAny.create = (params) => { + return new ZodAny({ + typeName: ZodFirstPartyTypeKind.ZodAny, + ...processCreateParams(params), + }); +}; +class ZodUnknown extends ZodType { + constructor() { + super(...arguments); + // required + this._unknown = true; + } + _parse(input) { + return (0, parseUtil_1.OK)(input.data); + } +} +exports.ZodUnknown = ZodUnknown; +ZodUnknown.create = (params) => { + return new ZodUnknown({ + typeName: ZodFirstPartyTypeKind.ZodUnknown, + ...processCreateParams(params), + }); +}; +class ZodNever extends ZodType { + _parse(input) { + const ctx = this._getOrReturnCtx(input); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_type, + expected: util_1.ZodParsedType.never, + received: ctx.parsedType, + }); + return parseUtil_1.INVALID; + } +} +exports.ZodNever = ZodNever; +ZodNever.create = (params) => { + return new ZodNever({ + typeName: ZodFirstPartyTypeKind.ZodNever, + ...processCreateParams(params), + }); +}; +class ZodVoid extends ZodType { + _parse(input) { + const parsedType = this._getType(input); + if (parsedType !== util_1.ZodParsedType.undefined) { + const ctx = this._getOrReturnCtx(input); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_type, + expected: util_1.ZodParsedType.void, + received: ctx.parsedType, + }); + return parseUtil_1.INVALID; + } + return (0, parseUtil_1.OK)(input.data); + } +} +exports.ZodVoid = ZodVoid; +ZodVoid.create = (params) => { + return new ZodVoid({ + typeName: ZodFirstPartyTypeKind.ZodVoid, + ...processCreateParams(params), + }); +}; +class ZodArray extends ZodType { + _parse(input) { + const { ctx, status } = this._processInputParams(input); + const def = this._def; + if (ctx.parsedType !== util_1.ZodParsedType.array) { + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_type, + expected: util_1.ZodParsedType.array, + received: ctx.parsedType, + }); + return parseUtil_1.INVALID; + } + if (def.exactLength !== null) { + const tooBig = ctx.data.length > def.exactLength.value; + const tooSmall = ctx.data.length < def.exactLength.value; + if (tooBig || tooSmall) { + (0, parseUtil_1.addIssueToContext)(ctx, { + code: tooBig ? ZodError_1.ZodIssueCode.too_big : ZodError_1.ZodIssueCode.too_small, + minimum: (tooSmall ? def.exactLength.value : undefined), + maximum: (tooBig ? def.exactLength.value : undefined), + type: "array", + inclusive: true, + exact: true, + message: def.exactLength.message, + }); + status.dirty(); + } + } + if (def.minLength !== null) { + if (ctx.data.length < def.minLength.value) { + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.too_small, + minimum: def.minLength.value, + type: "array", + inclusive: true, + exact: false, + message: def.minLength.message, + }); + status.dirty(); + } + } + if (def.maxLength !== null) { + if (ctx.data.length > def.maxLength.value) { + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.too_big, + maximum: def.maxLength.value, + type: "array", + inclusive: true, + exact: false, + message: def.maxLength.message, + }); + status.dirty(); + } + } + if (ctx.common.async) { + return Promise.all([...ctx.data].map((item, i) => { + return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i)); + })).then((result) => { + return parseUtil_1.ParseStatus.mergeArray(status, result); + }); + } + const result = [...ctx.data].map((item, i) => { + return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i)); + }); + return parseUtil_1.ParseStatus.mergeArray(status, result); + } + get element() { + return this._def.type; + } + min(minLength, message) { + return new ZodArray({ + ...this._def, + minLength: { value: minLength, message: errorUtil_1.errorUtil.toString(message) }, + }); + } + max(maxLength, message) { + return new ZodArray({ + ...this._def, + maxLength: { value: maxLength, message: errorUtil_1.errorUtil.toString(message) }, + }); + } + length(len, message) { + return new ZodArray({ + ...this._def, + exactLength: { value: len, message: errorUtil_1.errorUtil.toString(message) }, + }); + } + nonempty(message) { + return this.min(1, message); + } +} +exports.ZodArray = ZodArray; +ZodArray.create = (schema, params) => { + return new ZodArray({ + type: schema, + minLength: null, + maxLength: null, + exactLength: null, + typeName: ZodFirstPartyTypeKind.ZodArray, + ...processCreateParams(params), + }); +}; +function deepPartialify(schema) { + if (schema instanceof ZodObject) { + const newShape = {}; + for (const key in schema.shape) { + const fieldSchema = schema.shape[key]; + newShape[key] = ZodOptional.create(deepPartialify(fieldSchema)); + } + return new ZodObject({ + ...schema._def, + shape: () => newShape, + }); + } + else if (schema instanceof ZodArray) { + return new ZodArray({ + ...schema._def, + type: deepPartialify(schema.element), + }); + } + else if (schema instanceof ZodOptional) { + return ZodOptional.create(deepPartialify(schema.unwrap())); + } + else if (schema instanceof ZodNullable) { + return ZodNullable.create(deepPartialify(schema.unwrap())); + } + else if (schema instanceof ZodTuple) { + return ZodTuple.create(schema.items.map((item) => deepPartialify(item))); + } + else { + return schema; + } +} +class ZodObject extends ZodType { + constructor() { + super(...arguments); + this._cached = null; + /** + * @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped. + * If you want to pass through unknown properties, use `.passthrough()` instead. + */ + this.nonstrict = this.passthrough; + // extend< + // Augmentation extends ZodRawShape, + // NewOutput extends util.flatten<{ + // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation + // ? Augmentation[k]["_output"] + // : k extends keyof Output + // ? Output[k] + // : never; + // }>, + // NewInput extends util.flatten<{ + // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation + // ? Augmentation[k]["_input"] + // : k extends keyof Input + // ? Input[k] + // : never; + // }> + // >( + // augmentation: Augmentation + // ): ZodObject< + // extendShape, + // UnknownKeys, + // Catchall, + // NewOutput, + // NewInput + // > { + // return new ZodObject({ + // ...this._def, + // shape: () => ({ + // ...this._def.shape(), + // ...augmentation, + // }), + // }) as any; + // } + /** + * @deprecated Use `.extend` instead + * */ + this.augment = this.extend; + } + _getCached() { + if (this._cached !== null) + return this._cached; + const shape = this._def.shape(); + const keys = util_1.util.objectKeys(shape); + return (this._cached = { shape, keys }); + } + _parse(input) { + const parsedType = this._getType(input); + if (parsedType !== util_1.ZodParsedType.object) { + const ctx = this._getOrReturnCtx(input); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_type, + expected: util_1.ZodParsedType.object, + received: ctx.parsedType, + }); + return parseUtil_1.INVALID; + } + const { status, ctx } = this._processInputParams(input); + const { shape, keys: shapeKeys } = this._getCached(); + const extraKeys = []; + if (!(this._def.catchall instanceof ZodNever && + this._def.unknownKeys === "strip")) { + for (const key in ctx.data) { + if (!shapeKeys.includes(key)) { + extraKeys.push(key); + } + } + } + const pairs = []; + for (const key of shapeKeys) { + const keyValidator = shape[key]; + const value = ctx.data[key]; + pairs.push({ + key: { status: "valid", value: key }, + value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)), + alwaysSet: key in ctx.data, + }); + } + if (this._def.catchall instanceof ZodNever) { + const unknownKeys = this._def.unknownKeys; + if (unknownKeys === "passthrough") { + for (const key of extraKeys) { + pairs.push({ + key: { status: "valid", value: key }, + value: { status: "valid", value: ctx.data[key] }, + }); + } + } + else if (unknownKeys === "strict") { + if (extraKeys.length > 0) { + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.unrecognized_keys, + keys: extraKeys, + }); + status.dirty(); + } + } + else if (unknownKeys === "strip") { + } + else { + throw new Error(`Internal ZodObject error: invalid unknownKeys value.`); + } + } + else { + // run catchall validation + const catchall = this._def.catchall; + for (const key of extraKeys) { + const value = ctx.data[key]; + pairs.push({ + key: { status: "valid", value: key }, + value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key) //, ctx.child(key), value, getParsedType(value) + ), + alwaysSet: key in ctx.data, + }); + } + } + if (ctx.common.async) { + return Promise.resolve() + .then(async () => { + const syncPairs = []; + for (const pair of pairs) { + const key = await pair.key; + const value = await pair.value; + syncPairs.push({ + key, + value, + alwaysSet: pair.alwaysSet, + }); + } + return syncPairs; + }) + .then((syncPairs) => { + return parseUtil_1.ParseStatus.mergeObjectSync(status, syncPairs); + }); + } + else { + return parseUtil_1.ParseStatus.mergeObjectSync(status, pairs); + } + } + get shape() { + return this._def.shape(); + } + strict(message) { + errorUtil_1.errorUtil.errToObj; + return new ZodObject({ + ...this._def, + unknownKeys: "strict", + ...(message !== undefined + ? { + errorMap: (issue, ctx) => { + var _a, _b, _c, _d; + const defaultError = (_c = (_b = (_a = this._def).errorMap) === null || _b === void 0 ? void 0 : _b.call(_a, issue, ctx).message) !== null && _c !== void 0 ? _c : ctx.defaultError; + if (issue.code === "unrecognized_keys") + return { + message: (_d = errorUtil_1.errorUtil.errToObj(message).message) !== null && _d !== void 0 ? _d : defaultError, + }; + return { + message: defaultError, + }; + }, + } + : {}), + }); + } + strip() { + return new ZodObject({ + ...this._def, + unknownKeys: "strip", + }); + } + passthrough() { + return new ZodObject({ + ...this._def, + unknownKeys: "passthrough", + }); + } + // const AugmentFactory = + // (def: Def) => + // ( + // augmentation: Augmentation + // ): ZodObject< + // extendShape, Augmentation>, + // Def["unknownKeys"], + // Def["catchall"] + // > => { + // return new ZodObject({ + // ...def, + // shape: () => ({ + // ...def.shape(), + // ...augmentation, + // }), + // }) as any; + // }; + extend(augmentation) { + return new ZodObject({ + ...this._def, + shape: () => ({ + ...this._def.shape(), + ...augmentation, + }), + }); + } + /** + * Prior to zod@1.0.12 there was a bug in the + * inferred type of merged objects. Please + * upgrade if you are experiencing issues. + */ + merge(merging) { + const merged = new ZodObject({ + unknownKeys: merging._def.unknownKeys, + catchall: merging._def.catchall, + shape: () => ({ + ...this._def.shape(), + ...merging._def.shape(), + }), + typeName: ZodFirstPartyTypeKind.ZodObject, + }); + return merged; + } + // merge< + // Incoming extends AnyZodObject, + // Augmentation extends Incoming["shape"], + // NewOutput extends { + // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation + // ? Augmentation[k]["_output"] + // : k extends keyof Output + // ? Output[k] + // : never; + // }, + // NewInput extends { + // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation + // ? Augmentation[k]["_input"] + // : k extends keyof Input + // ? Input[k] + // : never; + // } + // >( + // merging: Incoming + // ): ZodObject< + // extendShape>, + // Incoming["_def"]["unknownKeys"], + // Incoming["_def"]["catchall"], + // NewOutput, + // NewInput + // > { + // const merged: any = new ZodObject({ + // unknownKeys: merging._def.unknownKeys, + // catchall: merging._def.catchall, + // shape: () => + // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()), + // typeName: ZodFirstPartyTypeKind.ZodObject, + // }) as any; + // return merged; + // } + setKey(key, schema) { + return this.augment({ [key]: schema }); + } + // merge( + // merging: Incoming + // ): //ZodObject = (merging) => { + // ZodObject< + // extendShape>, + // Incoming["_def"]["unknownKeys"], + // Incoming["_def"]["catchall"] + // > { + // // const mergedShape = objectUtil.mergeShapes( + // // this._def.shape(), + // // merging._def.shape() + // // ); + // const merged: any = new ZodObject({ + // unknownKeys: merging._def.unknownKeys, + // catchall: merging._def.catchall, + // shape: () => + // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()), + // typeName: ZodFirstPartyTypeKind.ZodObject, + // }) as any; + // return merged; + // } + catchall(index) { + return new ZodObject({ + ...this._def, + catchall: index, + }); + } + pick(mask) { + const shape = {}; + util_1.util.objectKeys(mask).forEach((key) => { + if (mask[key] && this.shape[key]) { + shape[key] = this.shape[key]; + } + }); + return new ZodObject({ + ...this._def, + shape: () => shape, + }); + } + omit(mask) { + const shape = {}; + util_1.util.objectKeys(this.shape).forEach((key) => { + if (!mask[key]) { + shape[key] = this.shape[key]; + } + }); + return new ZodObject({ + ...this._def, + shape: () => shape, + }); + } + /** + * @deprecated + */ + deepPartial() { + return deepPartialify(this); + } + partial(mask) { + const newShape = {}; + util_1.util.objectKeys(this.shape).forEach((key) => { + const fieldSchema = this.shape[key]; + if (mask && !mask[key]) { + newShape[key] = fieldSchema; + } + else { + newShape[key] = fieldSchema.optional(); + } + }); + return new ZodObject({ + ...this._def, + shape: () => newShape, + }); + } + required(mask) { + const newShape = {}; + util_1.util.objectKeys(this.shape).forEach((key) => { + if (mask && !mask[key]) { + newShape[key] = this.shape[key]; + } + else { + const fieldSchema = this.shape[key]; + let newField = fieldSchema; + while (newField instanceof ZodOptional) { + newField = newField._def.innerType; + } + newShape[key] = newField; + } + }); + return new ZodObject({ + ...this._def, + shape: () => newShape, + }); + } + keyof() { + return createZodEnum(util_1.util.objectKeys(this.shape)); + } +} +exports.ZodObject = ZodObject; +ZodObject.create = (shape, params) => { + return new ZodObject({ + shape: () => shape, + unknownKeys: "strip", + catchall: ZodNever.create(), + typeName: ZodFirstPartyTypeKind.ZodObject, + ...processCreateParams(params), + }); +}; +ZodObject.strictCreate = (shape, params) => { + return new ZodObject({ + shape: () => shape, + unknownKeys: "strict", + catchall: ZodNever.create(), + typeName: ZodFirstPartyTypeKind.ZodObject, + ...processCreateParams(params), + }); +}; +ZodObject.lazycreate = (shape, params) => { + return new ZodObject({ + shape, + unknownKeys: "strip", + catchall: ZodNever.create(), + typeName: ZodFirstPartyTypeKind.ZodObject, + ...processCreateParams(params), + }); +}; +class ZodUnion extends ZodType { + _parse(input) { + const { ctx } = this._processInputParams(input); + const options = this._def.options; + function handleResults(results) { + // return first issue-free validation if it exists + for (const result of results) { + if (result.result.status === "valid") { + return result.result; + } + } + for (const result of results) { + if (result.result.status === "dirty") { + // add issues from dirty option + ctx.common.issues.push(...result.ctx.common.issues); + return result.result; + } + } + // return invalid + const unionErrors = results.map((result) => new ZodError_1.ZodError(result.ctx.common.issues)); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_union, + unionErrors, + }); + return parseUtil_1.INVALID; + } + if (ctx.common.async) { + return Promise.all(options.map(async (option) => { + const childCtx = { + ...ctx, + common: { + ...ctx.common, + issues: [], + }, + parent: null, + }; + return { + result: await option._parseAsync({ + data: ctx.data, + path: ctx.path, + parent: childCtx, + }), + ctx: childCtx, + }; + })).then(handleResults); + } + else { + let dirty = undefined; + const issues = []; + for (const option of options) { + const childCtx = { + ...ctx, + common: { + ...ctx.common, + issues: [], + }, + parent: null, + }; + const result = option._parseSync({ + data: ctx.data, + path: ctx.path, + parent: childCtx, + }); + if (result.status === "valid") { + return result; + } + else if (result.status === "dirty" && !dirty) { + dirty = { result, ctx: childCtx }; + } + if (childCtx.common.issues.length) { + issues.push(childCtx.common.issues); + } + } + if (dirty) { + ctx.common.issues.push(...dirty.ctx.common.issues); + return dirty.result; + } + const unionErrors = issues.map((issues) => new ZodError_1.ZodError(issues)); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_union, + unionErrors, + }); + return parseUtil_1.INVALID; + } + } + get options() { + return this._def.options; + } +} +exports.ZodUnion = ZodUnion; +ZodUnion.create = (types, params) => { + return new ZodUnion({ + options: types, + typeName: ZodFirstPartyTypeKind.ZodUnion, + ...processCreateParams(params), + }); +}; +///////////////////////////////////////////////////// +///////////////////////////////////////////////////// +////////// ////////// +////////// ZodDiscriminatedUnion ////////// +////////// ////////// +///////////////////////////////////////////////////// +///////////////////////////////////////////////////// +const getDiscriminator = (type) => { + if (type instanceof ZodLazy) { + return getDiscriminator(type.schema); + } + else if (type instanceof ZodEffects) { + return getDiscriminator(type.innerType()); + } + else if (type instanceof ZodLiteral) { + return [type.value]; + } + else if (type instanceof ZodEnum) { + return type.options; + } + else if (type instanceof ZodNativeEnum) { + // eslint-disable-next-line ban/ban + return util_1.util.objectValues(type.enum); + } + else if (type instanceof ZodDefault) { + return getDiscriminator(type._def.innerType); + } + else if (type instanceof ZodUndefined) { + return [undefined]; + } + else if (type instanceof ZodNull) { + return [null]; + } + else if (type instanceof ZodOptional) { + return [undefined, ...getDiscriminator(type.unwrap())]; + } + else if (type instanceof ZodNullable) { + return [null, ...getDiscriminator(type.unwrap())]; + } + else if (type instanceof ZodBranded) { + return getDiscriminator(type.unwrap()); + } + else if (type instanceof ZodReadonly) { + return getDiscriminator(type.unwrap()); + } + else if (type instanceof ZodCatch) { + return getDiscriminator(type._def.innerType); + } + else { + return []; + } +}; +class ZodDiscriminatedUnion extends ZodType { + _parse(input) { + const { ctx } = this._processInputParams(input); + if (ctx.parsedType !== util_1.ZodParsedType.object) { + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_type, + expected: util_1.ZodParsedType.object, + received: ctx.parsedType, + }); + return parseUtil_1.INVALID; + } + const discriminator = this.discriminator; + const discriminatorValue = ctx.data[discriminator]; + const option = this.optionsMap.get(discriminatorValue); + if (!option) { + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_union_discriminator, + options: Array.from(this.optionsMap.keys()), + path: [discriminator], + }); + return parseUtil_1.INVALID; + } + if (ctx.common.async) { + return option._parseAsync({ + data: ctx.data, + path: ctx.path, + parent: ctx, + }); + } + else { + return option._parseSync({ + data: ctx.data, + path: ctx.path, + parent: ctx, + }); + } + } + get discriminator() { + return this._def.discriminator; + } + get options() { + return this._def.options; + } + get optionsMap() { + return this._def.optionsMap; + } + /** + * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor. + * However, it only allows a union of objects, all of which need to share a discriminator property. This property must + * have a different value for each object in the union. + * @param discriminator the name of the discriminator property + * @param types an array of object schemas + * @param params + */ + static create(discriminator, options, params) { + // Get all the valid discriminator values + const optionsMap = new Map(); + // try { + for (const type of options) { + const discriminatorValues = getDiscriminator(type.shape[discriminator]); + if (!discriminatorValues.length) { + throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`); + } + for (const value of discriminatorValues) { + if (optionsMap.has(value)) { + throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`); + } + optionsMap.set(value, type); + } + } + return new ZodDiscriminatedUnion({ + typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion, + discriminator, + options, + optionsMap, + ...processCreateParams(params), + }); + } +} +exports.ZodDiscriminatedUnion = ZodDiscriminatedUnion; +function mergeValues(a, b) { + const aType = (0, util_1.getParsedType)(a); + const bType = (0, util_1.getParsedType)(b); + if (a === b) { + return { valid: true, data: a }; + } + else if (aType === util_1.ZodParsedType.object && bType === util_1.ZodParsedType.object) { + const bKeys = util_1.util.objectKeys(b); + const sharedKeys = util_1.util + .objectKeys(a) + .filter((key) => bKeys.indexOf(key) !== -1); + const newObj = { ...a, ...b }; + for (const key of sharedKeys) { + const sharedValue = mergeValues(a[key], b[key]); + if (!sharedValue.valid) { + return { valid: false }; + } + newObj[key] = sharedValue.data; + } + return { valid: true, data: newObj }; + } + else if (aType === util_1.ZodParsedType.array && bType === util_1.ZodParsedType.array) { + if (a.length !== b.length) { + return { valid: false }; + } + const newArray = []; + for (let index = 0; index < a.length; index++) { + const itemA = a[index]; + const itemB = b[index]; + const sharedValue = mergeValues(itemA, itemB); + if (!sharedValue.valid) { + return { valid: false }; + } + newArray.push(sharedValue.data); + } + return { valid: true, data: newArray }; + } + else if (aType === util_1.ZodParsedType.date && + bType === util_1.ZodParsedType.date && + +a === +b) { + return { valid: true, data: a }; + } + else { + return { valid: false }; + } +} +class ZodIntersection extends ZodType { + _parse(input) { + const { status, ctx } = this._processInputParams(input); + const handleParsed = (parsedLeft, parsedRight) => { + if ((0, parseUtil_1.isAborted)(parsedLeft) || (0, parseUtil_1.isAborted)(parsedRight)) { + return parseUtil_1.INVALID; + } + const merged = mergeValues(parsedLeft.value, parsedRight.value); + if (!merged.valid) { + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_intersection_types, + }); + return parseUtil_1.INVALID; + } + if ((0, parseUtil_1.isDirty)(parsedLeft) || (0, parseUtil_1.isDirty)(parsedRight)) { + status.dirty(); + } + return { status: status.value, value: merged.data }; + }; + if (ctx.common.async) { + return Promise.all([ + this._def.left._parseAsync({ + data: ctx.data, + path: ctx.path, + parent: ctx, + }), + this._def.right._parseAsync({ + data: ctx.data, + path: ctx.path, + parent: ctx, + }), + ]).then(([left, right]) => handleParsed(left, right)); + } + else { + return handleParsed(this._def.left._parseSync({ + data: ctx.data, + path: ctx.path, + parent: ctx, + }), this._def.right._parseSync({ + data: ctx.data, + path: ctx.path, + parent: ctx, + })); + } + } +} +exports.ZodIntersection = ZodIntersection; +ZodIntersection.create = (left, right, params) => { + return new ZodIntersection({ + left: left, + right: right, + typeName: ZodFirstPartyTypeKind.ZodIntersection, + ...processCreateParams(params), + }); +}; +class ZodTuple extends ZodType { + _parse(input) { + const { status, ctx } = this._processInputParams(input); + if (ctx.parsedType !== util_1.ZodParsedType.array) { + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_type, + expected: util_1.ZodParsedType.array, + received: ctx.parsedType, + }); + return parseUtil_1.INVALID; + } + if (ctx.data.length < this._def.items.length) { + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.too_small, + minimum: this._def.items.length, + inclusive: true, + exact: false, + type: "array", + }); + return parseUtil_1.INVALID; + } + const rest = this._def.rest; + if (!rest && ctx.data.length > this._def.items.length) { + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.too_big, + maximum: this._def.items.length, + inclusive: true, + exact: false, + type: "array", + }); + status.dirty(); + } + const items = [...ctx.data] + .map((item, itemIndex) => { + const schema = this._def.items[itemIndex] || this._def.rest; + if (!schema) + return null; + return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex)); + }) + .filter((x) => !!x); // filter nulls + if (ctx.common.async) { + return Promise.all(items).then((results) => { + return parseUtil_1.ParseStatus.mergeArray(status, results); + }); + } + else { + return parseUtil_1.ParseStatus.mergeArray(status, items); + } + } + get items() { + return this._def.items; + } + rest(rest) { + return new ZodTuple({ + ...this._def, + rest, + }); + } +} +exports.ZodTuple = ZodTuple; +ZodTuple.create = (schemas, params) => { + if (!Array.isArray(schemas)) { + throw new Error("You must pass an array of schemas to z.tuple([ ... ])"); + } + return new ZodTuple({ + items: schemas, + typeName: ZodFirstPartyTypeKind.ZodTuple, + rest: null, + ...processCreateParams(params), + }); +}; +class ZodRecord extends ZodType { + get keySchema() { + return this._def.keyType; + } + get valueSchema() { + return this._def.valueType; + } + _parse(input) { + const { status, ctx } = this._processInputParams(input); + if (ctx.parsedType !== util_1.ZodParsedType.object) { + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_type, + expected: util_1.ZodParsedType.object, + received: ctx.parsedType, + }); + return parseUtil_1.INVALID; + } + const pairs = []; + const keyType = this._def.keyType; + const valueType = this._def.valueType; + for (const key in ctx.data) { + pairs.push({ + key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)), + value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)), + alwaysSet: key in ctx.data, + }); + } + if (ctx.common.async) { + return parseUtil_1.ParseStatus.mergeObjectAsync(status, pairs); + } + else { + return parseUtil_1.ParseStatus.mergeObjectSync(status, pairs); + } + } + get element() { + return this._def.valueType; + } + static create(first, second, third) { + if (second instanceof ZodType) { + return new ZodRecord({ + keyType: first, + valueType: second, + typeName: ZodFirstPartyTypeKind.ZodRecord, + ...processCreateParams(third), + }); + } + return new ZodRecord({ + keyType: ZodString.create(), + valueType: first, + typeName: ZodFirstPartyTypeKind.ZodRecord, + ...processCreateParams(second), + }); + } +} +exports.ZodRecord = ZodRecord; +class ZodMap extends ZodType { + get keySchema() { + return this._def.keyType; + } + get valueSchema() { + return this._def.valueType; + } + _parse(input) { + const { status, ctx } = this._processInputParams(input); + if (ctx.parsedType !== util_1.ZodParsedType.map) { + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_type, + expected: util_1.ZodParsedType.map, + received: ctx.parsedType, + }); + return parseUtil_1.INVALID; + } + const keyType = this._def.keyType; + const valueType = this._def.valueType; + const pairs = [...ctx.data.entries()].map(([key, value], index) => { + return { + key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index, "key"])), + value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, "value"])), + }; + }); + if (ctx.common.async) { + const finalMap = new Map(); + return Promise.resolve().then(async () => { + for (const pair of pairs) { + const key = await pair.key; + const value = await pair.value; + if (key.status === "aborted" || value.status === "aborted") { + return parseUtil_1.INVALID; + } + if (key.status === "dirty" || value.status === "dirty") { + status.dirty(); + } + finalMap.set(key.value, value.value); + } + return { status: status.value, value: finalMap }; + }); + } + else { + const finalMap = new Map(); + for (const pair of pairs) { + const key = pair.key; + const value = pair.value; + if (key.status === "aborted" || value.status === "aborted") { + return parseUtil_1.INVALID; + } + if (key.status === "dirty" || value.status === "dirty") { + status.dirty(); + } + finalMap.set(key.value, value.value); + } + return { status: status.value, value: finalMap }; + } + } +} +exports.ZodMap = ZodMap; +ZodMap.create = (keyType, valueType, params) => { + return new ZodMap({ + valueType, + keyType, + typeName: ZodFirstPartyTypeKind.ZodMap, + ...processCreateParams(params), + }); +}; +class ZodSet extends ZodType { + _parse(input) { + const { status, ctx } = this._processInputParams(input); + if (ctx.parsedType !== util_1.ZodParsedType.set) { + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_type, + expected: util_1.ZodParsedType.set, + received: ctx.parsedType, + }); + return parseUtil_1.INVALID; + } + const def = this._def; + if (def.minSize !== null) { + if (ctx.data.size < def.minSize.value) { + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.too_small, + minimum: def.minSize.value, + type: "set", + inclusive: true, + exact: false, + message: def.minSize.message, + }); + status.dirty(); + } + } + if (def.maxSize !== null) { + if (ctx.data.size > def.maxSize.value) { + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.too_big, + maximum: def.maxSize.value, + type: "set", + inclusive: true, + exact: false, + message: def.maxSize.message, + }); + status.dirty(); + } + } + const valueType = this._def.valueType; + function finalizeSet(elements) { + const parsedSet = new Set(); + for (const element of elements) { + if (element.status === "aborted") + return parseUtil_1.INVALID; + if (element.status === "dirty") + status.dirty(); + parsedSet.add(element.value); + } + return { status: status.value, value: parsedSet }; + } + const elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i))); + if (ctx.common.async) { + return Promise.all(elements).then((elements) => finalizeSet(elements)); + } + else { + return finalizeSet(elements); + } + } + min(minSize, message) { + return new ZodSet({ + ...this._def, + minSize: { value: minSize, message: errorUtil_1.errorUtil.toString(message) }, + }); + } + max(maxSize, message) { + return new ZodSet({ + ...this._def, + maxSize: { value: maxSize, message: errorUtil_1.errorUtil.toString(message) }, + }); + } + size(size, message) { + return this.min(size, message).max(size, message); + } + nonempty(message) { + return this.min(1, message); + } +} +exports.ZodSet = ZodSet; +ZodSet.create = (valueType, params) => { + return new ZodSet({ + valueType, + minSize: null, + maxSize: null, + typeName: ZodFirstPartyTypeKind.ZodSet, + ...processCreateParams(params), + }); +}; +class ZodFunction extends ZodType { + constructor() { + super(...arguments); + this.validate = this.implement; + } + _parse(input) { + const { ctx } = this._processInputParams(input); + if (ctx.parsedType !== util_1.ZodParsedType.function) { + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_type, + expected: util_1.ZodParsedType.function, + received: ctx.parsedType, + }); + return parseUtil_1.INVALID; + } + function makeArgsIssue(args, error) { + return (0, parseUtil_1.makeIssue)({ + data: args, + path: ctx.path, + errorMaps: [ + ctx.common.contextualErrorMap, + ctx.schemaErrorMap, + (0, errors_1.getErrorMap)(), + errors_1.defaultErrorMap, + ].filter((x) => !!x), + issueData: { + code: ZodError_1.ZodIssueCode.invalid_arguments, + argumentsError: error, + }, + }); + } + function makeReturnsIssue(returns, error) { + return (0, parseUtil_1.makeIssue)({ + data: returns, + path: ctx.path, + errorMaps: [ + ctx.common.contextualErrorMap, + ctx.schemaErrorMap, + (0, errors_1.getErrorMap)(), + errors_1.defaultErrorMap, + ].filter((x) => !!x), + issueData: { + code: ZodError_1.ZodIssueCode.invalid_return_type, + returnTypeError: error, + }, + }); + } + const params = { errorMap: ctx.common.contextualErrorMap }; + const fn = ctx.data; + if (this._def.returns instanceof ZodPromise) { + // Would love a way to avoid disabling this rule, but we need + // an alias (using an arrow function was what caused 2651). + // eslint-disable-next-line @typescript-eslint/no-this-alias + const me = this; + return (0, parseUtil_1.OK)(async function (...args) { + const error = new ZodError_1.ZodError([]); + const parsedArgs = await me._def.args + .parseAsync(args, params) + .catch((e) => { + error.addIssue(makeArgsIssue(args, e)); + throw error; + }); + const result = await Reflect.apply(fn, this, parsedArgs); + const parsedReturns = await me._def.returns._def.type + .parseAsync(result, params) + .catch((e) => { + error.addIssue(makeReturnsIssue(result, e)); + throw error; + }); + return parsedReturns; + }); + } + else { + // Would love a way to avoid disabling this rule, but we need + // an alias (using an arrow function was what caused 2651). + // eslint-disable-next-line @typescript-eslint/no-this-alias + const me = this; + return (0, parseUtil_1.OK)(function (...args) { + const parsedArgs = me._def.args.safeParse(args, params); + if (!parsedArgs.success) { + throw new ZodError_1.ZodError([makeArgsIssue(args, parsedArgs.error)]); + } + const result = Reflect.apply(fn, this, parsedArgs.data); + const parsedReturns = me._def.returns.safeParse(result, params); + if (!parsedReturns.success) { + throw new ZodError_1.ZodError([makeReturnsIssue(result, parsedReturns.error)]); + } + return parsedReturns.data; + }); + } + } + parameters() { + return this._def.args; + } + returnType() { + return this._def.returns; + } + args(...items) { + return new ZodFunction({ + ...this._def, + args: ZodTuple.create(items).rest(ZodUnknown.create()), + }); + } + returns(returnType) { + return new ZodFunction({ + ...this._def, + returns: returnType, + }); + } + implement(func) { + const validatedFunc = this.parse(func); + return validatedFunc; + } + strictImplement(func) { + const validatedFunc = this.parse(func); + return validatedFunc; + } + static create(args, returns, params) { + return new ZodFunction({ + args: (args + ? args + : ZodTuple.create([]).rest(ZodUnknown.create())), + returns: returns || ZodUnknown.create(), + typeName: ZodFirstPartyTypeKind.ZodFunction, + ...processCreateParams(params), + }); + } +} +exports.ZodFunction = ZodFunction; +class ZodLazy extends ZodType { + get schema() { + return this._def.getter(); + } + _parse(input) { + const { ctx } = this._processInputParams(input); + const lazySchema = this._def.getter(); + return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx }); + } +} +exports.ZodLazy = ZodLazy; +ZodLazy.create = (getter, params) => { + return new ZodLazy({ + getter: getter, + typeName: ZodFirstPartyTypeKind.ZodLazy, + ...processCreateParams(params), + }); +}; +class ZodLiteral extends ZodType { + _parse(input) { + if (input.data !== this._def.value) { + const ctx = this._getOrReturnCtx(input); + (0, parseUtil_1.addIssueToContext)(ctx, { + received: ctx.data, + code: ZodError_1.ZodIssueCode.invalid_literal, + expected: this._def.value, + }); + return parseUtil_1.INVALID; + } + return { status: "valid", value: input.data }; + } + get value() { + return this._def.value; + } +} +exports.ZodLiteral = ZodLiteral; +ZodLiteral.create = (value, params) => { + return new ZodLiteral({ + value: value, + typeName: ZodFirstPartyTypeKind.ZodLiteral, + ...processCreateParams(params), + }); +}; +function createZodEnum(values, params) { + return new ZodEnum({ + values, + typeName: ZodFirstPartyTypeKind.ZodEnum, + ...processCreateParams(params), + }); +} +class ZodEnum extends ZodType { + constructor() { + super(...arguments); + _ZodEnum_cache.set(this, void 0); + } + _parse(input) { + if (typeof input.data !== "string") { + const ctx = this._getOrReturnCtx(input); + const expectedValues = this._def.values; + (0, parseUtil_1.addIssueToContext)(ctx, { + expected: util_1.util.joinValues(expectedValues), + received: ctx.parsedType, + code: ZodError_1.ZodIssueCode.invalid_type, + }); + return parseUtil_1.INVALID; + } + if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f")) { + __classPrivateFieldSet(this, _ZodEnum_cache, new Set(this._def.values), "f"); + } + if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f").has(input.data)) { + const ctx = this._getOrReturnCtx(input); + const expectedValues = this._def.values; + (0, parseUtil_1.addIssueToContext)(ctx, { + received: ctx.data, + code: ZodError_1.ZodIssueCode.invalid_enum_value, + options: expectedValues, + }); + return parseUtil_1.INVALID; + } + return (0, parseUtil_1.OK)(input.data); + } + get options() { + return this._def.values; + } + get enum() { + const enumValues = {}; + for (const val of this._def.values) { + enumValues[val] = val; + } + return enumValues; + } + get Values() { + const enumValues = {}; + for (const val of this._def.values) { + enumValues[val] = val; + } + return enumValues; + } + get Enum() { + const enumValues = {}; + for (const val of this._def.values) { + enumValues[val] = val; + } + return enumValues; + } + extract(values, newDef = this._def) { + return ZodEnum.create(values, { + ...this._def, + ...newDef, + }); + } + exclude(values, newDef = this._def) { + return ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), { + ...this._def, + ...newDef, + }); + } +} +exports.ZodEnum = ZodEnum; +_ZodEnum_cache = new WeakMap(); +ZodEnum.create = createZodEnum; +class ZodNativeEnum extends ZodType { + constructor() { + super(...arguments); + _ZodNativeEnum_cache.set(this, void 0); + } + _parse(input) { + const nativeEnumValues = util_1.util.getValidEnumValues(this._def.values); + const ctx = this._getOrReturnCtx(input); + if (ctx.parsedType !== util_1.ZodParsedType.string && + ctx.parsedType !== util_1.ZodParsedType.number) { + const expectedValues = util_1.util.objectValues(nativeEnumValues); + (0, parseUtil_1.addIssueToContext)(ctx, { + expected: util_1.util.joinValues(expectedValues), + received: ctx.parsedType, + code: ZodError_1.ZodIssueCode.invalid_type, + }); + return parseUtil_1.INVALID; + } + if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f")) { + __classPrivateFieldSet(this, _ZodNativeEnum_cache, new Set(util_1.util.getValidEnumValues(this._def.values)), "f"); + } + if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f").has(input.data)) { + const expectedValues = util_1.util.objectValues(nativeEnumValues); + (0, parseUtil_1.addIssueToContext)(ctx, { + received: ctx.data, + code: ZodError_1.ZodIssueCode.invalid_enum_value, + options: expectedValues, + }); + return parseUtil_1.INVALID; + } + return (0, parseUtil_1.OK)(input.data); + } + get enum() { + return this._def.values; + } +} +exports.ZodNativeEnum = ZodNativeEnum; +_ZodNativeEnum_cache = new WeakMap(); +ZodNativeEnum.create = (values, params) => { + return new ZodNativeEnum({ + values: values, + typeName: ZodFirstPartyTypeKind.ZodNativeEnum, + ...processCreateParams(params), + }); +}; +class ZodPromise extends ZodType { + unwrap() { + return this._def.type; + } + _parse(input) { + const { ctx } = this._processInputParams(input); + if (ctx.parsedType !== util_1.ZodParsedType.promise && + ctx.common.async === false) { + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_type, + expected: util_1.ZodParsedType.promise, + received: ctx.parsedType, + }); + return parseUtil_1.INVALID; + } + const promisified = ctx.parsedType === util_1.ZodParsedType.promise + ? ctx.data + : Promise.resolve(ctx.data); + return (0, parseUtil_1.OK)(promisified.then((data) => { + return this._def.type.parseAsync(data, { + path: ctx.path, + errorMap: ctx.common.contextualErrorMap, + }); + })); + } +} +exports.ZodPromise = ZodPromise; +ZodPromise.create = (schema, params) => { + return new ZodPromise({ + type: schema, + typeName: ZodFirstPartyTypeKind.ZodPromise, + ...processCreateParams(params), + }); +}; +class ZodEffects extends ZodType { + innerType() { + return this._def.schema; + } + sourceType() { + return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects + ? this._def.schema.sourceType() + : this._def.schema; + } + _parse(input) { + const { status, ctx } = this._processInputParams(input); + const effect = this._def.effect || null; + const checkCtx = { + addIssue: (arg) => { + (0, parseUtil_1.addIssueToContext)(ctx, arg); + if (arg.fatal) { + status.abort(); + } + else { + status.dirty(); + } + }, + get path() { + return ctx.path; + }, + }; + checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx); + if (effect.type === "preprocess") { + const processed = effect.transform(ctx.data, checkCtx); + if (ctx.common.async) { + return Promise.resolve(processed).then(async (processed) => { + if (status.value === "aborted") + return parseUtil_1.INVALID; + const result = await this._def.schema._parseAsync({ + data: processed, + path: ctx.path, + parent: ctx, + }); + if (result.status === "aborted") + return parseUtil_1.INVALID; + if (result.status === "dirty") + return (0, parseUtil_1.DIRTY)(result.value); + if (status.value === "dirty") + return (0, parseUtil_1.DIRTY)(result.value); + return result; + }); + } + else { + if (status.value === "aborted") + return parseUtil_1.INVALID; + const result = this._def.schema._parseSync({ + data: processed, + path: ctx.path, + parent: ctx, + }); + if (result.status === "aborted") + return parseUtil_1.INVALID; + if (result.status === "dirty") + return (0, parseUtil_1.DIRTY)(result.value); + if (status.value === "dirty") + return (0, parseUtil_1.DIRTY)(result.value); + return result; + } + } + if (effect.type === "refinement") { + const executeRefinement = (acc) => { + const result = effect.refinement(acc, checkCtx); + if (ctx.common.async) { + return Promise.resolve(result); + } + if (result instanceof Promise) { + throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead."); + } + return acc; + }; + if (ctx.common.async === false) { + const inner = this._def.schema._parseSync({ + data: ctx.data, + path: ctx.path, + parent: ctx, + }); + if (inner.status === "aborted") + return parseUtil_1.INVALID; + if (inner.status === "dirty") + status.dirty(); + // return value is ignored + executeRefinement(inner.value); + return { status: status.value, value: inner.value }; + } + else { + return this._def.schema + ._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }) + .then((inner) => { + if (inner.status === "aborted") + return parseUtil_1.INVALID; + if (inner.status === "dirty") + status.dirty(); + return executeRefinement(inner.value).then(() => { + return { status: status.value, value: inner.value }; + }); + }); + } + } + if (effect.type === "transform") { + if (ctx.common.async === false) { + const base = this._def.schema._parseSync({ + data: ctx.data, + path: ctx.path, + parent: ctx, + }); + if (!(0, parseUtil_1.isValid)(base)) + return base; + const result = effect.transform(base.value, checkCtx); + if (result instanceof Promise) { + throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`); + } + return { status: status.value, value: result }; + } + else { + return this._def.schema + ._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }) + .then((base) => { + if (!(0, parseUtil_1.isValid)(base)) + return base; + return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({ status: status.value, value: result })); + }); + } + } + util_1.util.assertNever(effect); + } +} +exports.ZodEffects = ZodEffects; +exports.ZodTransformer = ZodEffects; +ZodEffects.create = (schema, effect, params) => { + return new ZodEffects({ + schema, + typeName: ZodFirstPartyTypeKind.ZodEffects, + effect, + ...processCreateParams(params), + }); +}; +ZodEffects.createWithPreprocess = (preprocess, schema, params) => { + return new ZodEffects({ + schema, + effect: { type: "preprocess", transform: preprocess }, + typeName: ZodFirstPartyTypeKind.ZodEffects, + ...processCreateParams(params), + }); +}; +class ZodOptional extends ZodType { + _parse(input) { + const parsedType = this._getType(input); + if (parsedType === util_1.ZodParsedType.undefined) { + return (0, parseUtil_1.OK)(undefined); + } + return this._def.innerType._parse(input); + } + unwrap() { + return this._def.innerType; + } +} +exports.ZodOptional = ZodOptional; +ZodOptional.create = (type, params) => { + return new ZodOptional({ + innerType: type, + typeName: ZodFirstPartyTypeKind.ZodOptional, + ...processCreateParams(params), + }); +}; +class ZodNullable extends ZodType { + _parse(input) { + const parsedType = this._getType(input); + if (parsedType === util_1.ZodParsedType.null) { + return (0, parseUtil_1.OK)(null); + } + return this._def.innerType._parse(input); + } + unwrap() { + return this._def.innerType; + } +} +exports.ZodNullable = ZodNullable; +ZodNullable.create = (type, params) => { + return new ZodNullable({ + innerType: type, + typeName: ZodFirstPartyTypeKind.ZodNullable, + ...processCreateParams(params), + }); +}; +class ZodDefault extends ZodType { + _parse(input) { + const { ctx } = this._processInputParams(input); + let data = ctx.data; + if (ctx.parsedType === util_1.ZodParsedType.undefined) { + data = this._def.defaultValue(); + } + return this._def.innerType._parse({ + data, + path: ctx.path, + parent: ctx, + }); + } + removeDefault() { + return this._def.innerType; + } +} +exports.ZodDefault = ZodDefault; +ZodDefault.create = (type, params) => { + return new ZodDefault({ + innerType: type, + typeName: ZodFirstPartyTypeKind.ZodDefault, + defaultValue: typeof params.default === "function" + ? params.default + : () => params.default, + ...processCreateParams(params), + }); +}; +class ZodCatch extends ZodType { + _parse(input) { + const { ctx } = this._processInputParams(input); + // newCtx is used to not collect issues from inner types in ctx + const newCtx = { + ...ctx, + common: { + ...ctx.common, + issues: [], + }, + }; + const result = this._def.innerType._parse({ + data: newCtx.data, + path: newCtx.path, + parent: { + ...newCtx, + }, + }); + if ((0, parseUtil_1.isAsync)(result)) { + return result.then((result) => { + return { + status: "valid", + value: result.status === "valid" + ? result.value + : this._def.catchValue({ + get error() { + return new ZodError_1.ZodError(newCtx.common.issues); + }, + input: newCtx.data, + }), + }; + }); + } + else { + return { + status: "valid", + value: result.status === "valid" + ? result.value + : this._def.catchValue({ + get error() { + return new ZodError_1.ZodError(newCtx.common.issues); + }, + input: newCtx.data, + }), + }; + } + } + removeCatch() { + return this._def.innerType; + } +} +exports.ZodCatch = ZodCatch; +ZodCatch.create = (type, params) => { + return new ZodCatch({ + innerType: type, + typeName: ZodFirstPartyTypeKind.ZodCatch, + catchValue: typeof params.catch === "function" ? params.catch : () => params.catch, + ...processCreateParams(params), + }); +}; +class ZodNaN extends ZodType { + _parse(input) { + const parsedType = this._getType(input); + if (parsedType !== util_1.ZodParsedType.nan) { + const ctx = this._getOrReturnCtx(input); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_type, + expected: util_1.ZodParsedType.nan, + received: ctx.parsedType, + }); + return parseUtil_1.INVALID; + } + return { status: "valid", value: input.data }; + } +} +exports.ZodNaN = ZodNaN; +ZodNaN.create = (params) => { + return new ZodNaN({ + typeName: ZodFirstPartyTypeKind.ZodNaN, + ...processCreateParams(params), + }); +}; +exports.BRAND = Symbol("zod_brand"); +class ZodBranded extends ZodType { + _parse(input) { + const { ctx } = this._processInputParams(input); + const data = ctx.data; + return this._def.type._parse({ + data, + path: ctx.path, + parent: ctx, + }); + } + unwrap() { + return this._def.type; + } +} +exports.ZodBranded = ZodBranded; +class ZodPipeline extends ZodType { + _parse(input) { + const { status, ctx } = this._processInputParams(input); + if (ctx.common.async) { + const handleAsync = async () => { + const inResult = await this._def.in._parseAsync({ + data: ctx.data, + path: ctx.path, + parent: ctx, + }); + if (inResult.status === "aborted") + return parseUtil_1.INVALID; + if (inResult.status === "dirty") { + status.dirty(); + return (0, parseUtil_1.DIRTY)(inResult.value); + } + else { + return this._def.out._parseAsync({ + data: inResult.value, + path: ctx.path, + parent: ctx, + }); + } + }; + return handleAsync(); + } + else { + const inResult = this._def.in._parseSync({ + data: ctx.data, + path: ctx.path, + parent: ctx, + }); + if (inResult.status === "aborted") + return parseUtil_1.INVALID; + if (inResult.status === "dirty") { + status.dirty(); + return { + status: "dirty", + value: inResult.value, + }; + } + else { + return this._def.out._parseSync({ + data: inResult.value, + path: ctx.path, + parent: ctx, + }); + } + } + } + static create(a, b) { + return new ZodPipeline({ + in: a, + out: b, + typeName: ZodFirstPartyTypeKind.ZodPipeline, + }); + } +} +exports.ZodPipeline = ZodPipeline; +class ZodReadonly extends ZodType { + _parse(input) { + const result = this._def.innerType._parse(input); + const freeze = (data) => { + if ((0, parseUtil_1.isValid)(data)) { + data.value = Object.freeze(data.value); + } + return data; + }; + return (0, parseUtil_1.isAsync)(result) + ? result.then((data) => freeze(data)) + : freeze(result); + } + unwrap() { + return this._def.innerType; + } +} +exports.ZodReadonly = ZodReadonly; +ZodReadonly.create = (type, params) => { + return new ZodReadonly({ + innerType: type, + typeName: ZodFirstPartyTypeKind.ZodReadonly, + ...processCreateParams(params), + }); +}; +function custom(check, params = {}, +/** + * @deprecated + * + * Pass `fatal` into the params object instead: + * + * ```ts + * z.string().custom((val) => val.length > 5, { fatal: false }) + * ``` + * + */ +fatal) { + if (check) + return ZodAny.create().superRefine((data, ctx) => { + var _a, _b; + if (!check(data)) { + const p = typeof params === "function" + ? params(data) + : typeof params === "string" + ? { message: params } + : params; + const _fatal = (_b = (_a = p.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true; + const p2 = typeof p === "string" ? { message: p } : p; + ctx.addIssue({ code: "custom", ...p2, fatal: _fatal }); + } + }); + return ZodAny.create(); +} +exports.custom = custom; +exports.late = { + object: ZodObject.lazycreate, +}; +var ZodFirstPartyTypeKind; +(function (ZodFirstPartyTypeKind) { + ZodFirstPartyTypeKind["ZodString"] = "ZodString"; + ZodFirstPartyTypeKind["ZodNumber"] = "ZodNumber"; + ZodFirstPartyTypeKind["ZodNaN"] = "ZodNaN"; + ZodFirstPartyTypeKind["ZodBigInt"] = "ZodBigInt"; + ZodFirstPartyTypeKind["ZodBoolean"] = "ZodBoolean"; + ZodFirstPartyTypeKind["ZodDate"] = "ZodDate"; + ZodFirstPartyTypeKind["ZodSymbol"] = "ZodSymbol"; + ZodFirstPartyTypeKind["ZodUndefined"] = "ZodUndefined"; + ZodFirstPartyTypeKind["ZodNull"] = "ZodNull"; + ZodFirstPartyTypeKind["ZodAny"] = "ZodAny"; + ZodFirstPartyTypeKind["ZodUnknown"] = "ZodUnknown"; + ZodFirstPartyTypeKind["ZodNever"] = "ZodNever"; + ZodFirstPartyTypeKind["ZodVoid"] = "ZodVoid"; + ZodFirstPartyTypeKind["ZodArray"] = "ZodArray"; + ZodFirstPartyTypeKind["ZodObject"] = "ZodObject"; + ZodFirstPartyTypeKind["ZodUnion"] = "ZodUnion"; + ZodFirstPartyTypeKind["ZodDiscriminatedUnion"] = "ZodDiscriminatedUnion"; + ZodFirstPartyTypeKind["ZodIntersection"] = "ZodIntersection"; + ZodFirstPartyTypeKind["ZodTuple"] = "ZodTuple"; + ZodFirstPartyTypeKind["ZodRecord"] = "ZodRecord"; + ZodFirstPartyTypeKind["ZodMap"] = "ZodMap"; + ZodFirstPartyTypeKind["ZodSet"] = "ZodSet"; + ZodFirstPartyTypeKind["ZodFunction"] = "ZodFunction"; + ZodFirstPartyTypeKind["ZodLazy"] = "ZodLazy"; + ZodFirstPartyTypeKind["ZodLiteral"] = "ZodLiteral"; + ZodFirstPartyTypeKind["ZodEnum"] = "ZodEnum"; + ZodFirstPartyTypeKind["ZodEffects"] = "ZodEffects"; + ZodFirstPartyTypeKind["ZodNativeEnum"] = "ZodNativeEnum"; + ZodFirstPartyTypeKind["ZodOptional"] = "ZodOptional"; + ZodFirstPartyTypeKind["ZodNullable"] = "ZodNullable"; + ZodFirstPartyTypeKind["ZodDefault"] = "ZodDefault"; + ZodFirstPartyTypeKind["ZodCatch"] = "ZodCatch"; + ZodFirstPartyTypeKind["ZodPromise"] = "ZodPromise"; + ZodFirstPartyTypeKind["ZodBranded"] = "ZodBranded"; + ZodFirstPartyTypeKind["ZodPipeline"] = "ZodPipeline"; + ZodFirstPartyTypeKind["ZodReadonly"] = "ZodReadonly"; +})(ZodFirstPartyTypeKind = exports.ZodFirstPartyTypeKind || (exports.ZodFirstPartyTypeKind = {})); +// requires TS 4.4+ +class Class { + constructor(..._) { } +} +const instanceOfType = ( +// const instanceOfType = any>( +cls, params = { + message: `Input not instance of ${cls.name}`, +}) => custom((data) => data instanceof cls, params); +exports.instanceof = instanceOfType; +const stringType = ZodString.create; +exports.string = stringType; +const numberType = ZodNumber.create; +exports.number = numberType; +const nanType = ZodNaN.create; +exports.nan = nanType; +const bigIntType = ZodBigInt.create; +exports.bigint = bigIntType; +const booleanType = ZodBoolean.create; +exports.boolean = booleanType; +const dateType = ZodDate.create; +exports.date = dateType; +const symbolType = ZodSymbol.create; +exports.symbol = symbolType; +const undefinedType = ZodUndefined.create; +exports.undefined = undefinedType; +const nullType = ZodNull.create; +exports.null = nullType; +const anyType = ZodAny.create; +exports.any = anyType; +const unknownType = ZodUnknown.create; +exports.unknown = unknownType; +const neverType = ZodNever.create; +exports.never = neverType; +const voidType = ZodVoid.create; +exports.void = voidType; +const arrayType = ZodArray.create; +exports.array = arrayType; +const objectType = ZodObject.create; +exports.object = objectType; +const strictObjectType = ZodObject.strictCreate; +exports.strictObject = strictObjectType; +const unionType = ZodUnion.create; +exports.union = unionType; +const discriminatedUnionType = ZodDiscriminatedUnion.create; +exports.discriminatedUnion = discriminatedUnionType; +const intersectionType = ZodIntersection.create; +exports.intersection = intersectionType; +const tupleType = ZodTuple.create; +exports.tuple = tupleType; +const recordType = ZodRecord.create; +exports.record = recordType; +const mapType = ZodMap.create; +exports.map = mapType; +const setType = ZodSet.create; +exports.set = setType; +const functionType = ZodFunction.create; +exports.function = functionType; +const lazyType = ZodLazy.create; +exports.lazy = lazyType; +const literalType = ZodLiteral.create; +exports.literal = literalType; +const enumType = ZodEnum.create; +exports.enum = enumType; +const nativeEnumType = ZodNativeEnum.create; +exports.nativeEnum = nativeEnumType; +const promiseType = ZodPromise.create; +exports.promise = promiseType; +const effectsType = ZodEffects.create; +exports.effect = effectsType; +exports.transformer = effectsType; +const optionalType = ZodOptional.create; +exports.optional = optionalType; +const nullableType = ZodNullable.create; +exports.nullable = nullableType; +const preprocessType = ZodEffects.createWithPreprocess; +exports.preprocess = preprocessType; +const pipelineType = ZodPipeline.create; +exports.pipeline = pipelineType; +const ostring = () => stringType().optional(); +exports.ostring = ostring; +const onumber = () => numberType().optional(); +exports.onumber = onumber; +const oboolean = () => booleanType().optional(); +exports.oboolean = oboolean; +exports.coerce = { + string: ((arg) => ZodString.create({ ...arg, coerce: true })), + number: ((arg) => ZodNumber.create({ ...arg, coerce: true })), + boolean: ((arg) => ZodBoolean.create({ + ...arg, + coerce: true, + })), + bigint: ((arg) => ZodBigInt.create({ ...arg, coerce: true })), + date: ((arg) => ZodDate.create({ ...arg, coerce: true })), +}; +exports.NEVER = parseUtil_1.INVALID; diff --git a/front_end/third_party/mcp-sdk/zod/package.json b/front_end/third_party/mcp-sdk/zod/package.json new file mode 100644 index 0000000000..d0839517b8 --- /dev/null +++ b/front_end/third_party/mcp-sdk/zod/package.json @@ -0,0 +1,119 @@ +{ + "name": "zod", + "version": "3.23.8", + "author": "Colin McDonnell ", + "repository": { + "type": "git", + "url": "git+https://github.com/colinhacks/zod.git" + }, + "main": "./lib/index.js", + "module": "./lib/index.mjs", + "devDependencies": { + "@babel/core": "^7.22.5", + "@babel/preset-env": "^7.22.5", + "@babel/preset-typescript": "^7.22.5", + "@jest/globals": "^29.4.3", + "@rollup/plugin-typescript": "^8.2.0", + "@swc/core": "^1.3.66", + "@swc/jest": "^0.2.26", + "@types/benchmark": "^2.1.0", + "@types/jest": "^29.2.2", + "@types/node": "14", + "@typescript-eslint/eslint-plugin": "^5.15.0", + "@typescript-eslint/parser": "^5.15.0", + "babel-jest": "^29.5.0", + "benchmark": "^2.1.4", + "dependency-cruiser": "^9.19.0", + "eslint": "^8.11.0", + "eslint-config-prettier": "^8.5.0", + "eslint-plugin-ban": "^1.6.0", + "eslint-plugin-import": "^2.25.4", + "eslint-plugin-simple-import-sort": "^7.0.0", + "eslint-plugin-unused-imports": "^2.0.0", + "husky": "^7.0.4", + "jest": "^29.3.1", + "lint-staged": "^12.3.7", + "nodemon": "^2.0.15", + "prettier": "^2.6.0", + "pretty-quick": "^3.1.3", + "rollup": "^2.70.1", + "ts-jest": "^29.1.0", + "ts-morph": "^14.0.0", + "ts-node": "^10.9.1", + "tslib": "^2.3.1", + "tsx": "^3.8.0", + "typescript": "~4.5.5", + "vitest": "^0.32.2" + }, + "exports": { + ".": { + "types": "./index.d.ts", + "require": "./lib/index.js", + "import": "./lib/index.mjs" + }, + "./package.json": "./package.json", + "./locales/*": "./lib/locales/*" + }, + "bugs": { + "url": "https://github.com/colinhacks/zod/issues" + }, + "description": "TypeScript-first schema declaration and validation library with static type inference", + "files": [ + "/lib", + "/index.d.ts" + ], + "funding": "https://github.com/sponsors/colinhacks", + "homepage": "https://zod.dev", + "keywords": [ + "typescript", + "schema", + "validation", + "type", + "inference" + ], + "license": "MIT", + "lint-staged": { + "src/*.ts": [ + "eslint --cache --fix", + "prettier --ignore-unknown --write" + ], + "*.md": [ + "prettier --ignore-unknown --write" + ] + }, + "scripts": { + "prettier:check": "prettier --check src/**/*.ts deno/lib/**/*.ts *.md --no-error-on-unmatched-pattern", + "prettier:fix": "prettier --write src/**/*.ts deno/lib/**/*.ts *.md --ignore-unknown --no-error-on-unmatched-pattern", + "lint:check": "eslint --cache --ext .ts ./src", + "lint:fix": "eslint --cache --fix --ext .ts ./src", + "check": "yarn lint:check && yarn prettier:check", + "fix": "yarn lint:fix && yarn prettier:fix", + "clean": "rm -rf lib/* deno/lib/*", + "build": "yarn run clean && npm run build:cjs && npm run build:esm && npm run build:deno", + "build:deno": "node ./deno-build.mjs && cp ./README.md ./deno/lib", + "build:esm": "rollup --config ./configs/rollup.config.js", + "build:cjs": "tsc -p ./configs/tsconfig.cjs.json", + "build:types": "tsc -p ./configs/tsconfig.types.json", + "build:test": "tsc -p ./configs/tsconfig.test.json", + "test:watch": "yarn test:ts-jest --watch", + "test": "yarn test:ts-jest", + "test:babel": "jest --coverage --config ./configs/babel-jest.config.json", + "test:bun": "bun test src/", + "test:vitest": "npx vitest --config ./configs/vitest.config.ts", + "test:ts-jest": "npx jest --config ./configs/ts-jest.config.json", + "test:swc": "npx jest --config ./configs/swc-jest.config.json", + "test:deno": "cd deno && deno test", + "prepublishOnly": "npm run test && npm run build && npm run build:deno", + "play": "nodemon -e ts -w . -x tsx playground.ts", + "depcruise": "depcruise -c .dependency-cruiser.js src", + "benchmark": "tsx src/benchmarks/index.ts", + "prepare": "husky install" + }, + "sideEffects": false, + "support": { + "backing": { + "npm-funding": true + } + }, + "types": "./index.d.ts" +} From 101249f4649b31721ddb677af25bc7f004028911 Mon Sep 17 00:00:00 2001 From: Tyson Thomas Date: Thu, 11 Sep 2025 17:51:17 -0700 Subject: [PATCH 2/7] fix mcp tool display --- config/gni/devtools_grd_files.gni | 11 +- front_end/panels/ai_chat/BUILD.gn | 1 + front_end/panels/ai_chat/core/AgentNodes.ts | 9 +- .../ai_chat/core/ToolNameMapping.test.ts | 4 +- front_end/panels/ai_chat/models/ChatTypes.ts | 7 +- front_end/panels/ai_chat/ui/ChatView.ts | 207 ++++++++---------- .../panels/ai_chat/ui/ToolCallComponent.ts | 4 +- .../ai_chat/ui/message/MessageCombiner.ts | 48 +--- 8 files changed, 122 insertions(+), 169 deletions(-) diff --git a/config/gni/devtools_grd_files.gni b/config/gni/devtools_grd_files.gni index 1b427235f1..dc67c3e9aa 100644 --- a/config/gni/devtools_grd_files.gni +++ b/config/gni/devtools_grd_files.gni @@ -866,17 +866,7 @@ grd_files_bundled_sources = [ "front_end/third_party/lighthouse/lighthouse-dt-bundle.js", "front_end/third_party/lighthouse/report/report.js", "front_end/third_party/lit/lit.js", - "front_end/third_party/mcp-sdk/ajv/dist/ajv.js", - "front_end/third_party/mcp-sdk/zod/lib/index.js", - "front_end/third_party/mcp-sdk/zod/lib/index.mjs", - "front_end/third_party/mcp-sdk/eventsource-parser/package/dist/index.js", - "front_end/third_party/mcp-sdk/eventsource-parser/package/dist/stream.js", "front_end/third_party/mcp-sdk/mcp-sdk.js", - "front_end/third_party/mcp-sdk/package/dist/client/index.js", - "front_end/third_party/mcp-sdk/package/dist/client/sse.js", - "front_end/third_party/mcp-sdk/package/dist/shared/protocol.js", - "front_end/third_party/mcp-sdk/package/dist/shared/transport.js", - "front_end/third_party/mcp-sdk/package/dist/types.js", "front_end/third_party/marked/marked.js", "front_end/third_party/puppeteer-replay/puppeteer-replay.js", "front_end/third_party/puppeteer/puppeteer.js", @@ -1389,6 +1379,7 @@ grd_files_unbundled_sources = [ "front_end/panels/ai_assistance/components/ChatView.js", "front_end/panels/ai_assistance/components/ExploreWidget.js", "front_end/panels/ai_assistance/components/MarkdownRendererWithCodeBlock.js", + "front_end/panels/ai_assistance/components/ScrollPinHelper.js", "front_end/panels/ai_assistance/components/UserActionRow.js", "front_end/panels/ai_assistance/components/chatView.css.js", "front_end/panels/ai_assistance/components/exploreWidget.css.js", diff --git a/front_end/panels/ai_chat/BUILD.gn b/front_end/panels/ai_chat/BUILD.gn index 7c93ae8509..91d509e19e 100644 --- a/front_end/panels/ai_chat/BUILD.gn +++ b/front_end/panels/ai_chat/BUILD.gn @@ -207,6 +207,7 @@ _ai_chat_sources = [ "LLM/MessageSanitizer.ts", "LLM/LLMClient.ts", "tools/Tools.ts", + "tools/LLMTracingWrapper.ts", "tools/CritiqueTool.ts", "tools/FetcherTool.ts", "tools/FinalizeWithCritiqueTool.ts", diff --git a/front_end/panels/ai_chat/core/AgentNodes.ts b/front_end/panels/ai_chat/core/AgentNodes.ts index 6e291ac9b8..16152490a0 100644 --- a/front_end/panels/ai_chat/core/AgentNodes.ts +++ b/front_end/panels/ai_chat/core/AgentNodes.ts @@ -257,6 +257,10 @@ export function createAgentNode(modelName: string, provider: LLMProvider, temper tracingContext.currentToolCallId = toolCallObservationId; } + // Determine lane: agent tools render in agent lane only + const regTool = ToolRegistry.getRegisteredTool(parsedAction.name as any); + const isAgentTool = !!regTool && (regTool instanceof ConfigurableAgentTool); + newModelMessage = { entity: ChatMessageEntity.MODEL, action: 'tool', @@ -265,6 +269,7 @@ export function createAgentNode(modelName: string, provider: LLMProvider, temper toolCallId, // Add for linking with tool response isFinalAnswer: false, reasoning: response.reasoning?.summary, + uiLane: isAgentTool ? 'agent' : 'chat', }; logger.debug('AgentNode: Created tool message', { toolName: parsedAction.name, toolCallId }); @@ -732,6 +737,7 @@ export function createToolExecutorNode(state: AgentState, provider: LLMProvider, } // Create the NEW ToolResultMessage + const isAgentTool = selectedTool instanceof ConfigurableAgentTool; const toolResultMessage: ToolResultMessage = { entity: ChatMessageEntity.TOOL_RESULT, toolName, @@ -739,8 +745,7 @@ export function createToolExecutorNode(state: AgentState, provider: LLMProvider, isError, toolCallId, // Link back to the tool call for OpenAI format ...(isError && { error: resultText }), - // Mark if this is from a ConfigurableAgentTool - ...(selectedTool instanceof ConfigurableAgentTool && { isFromConfigurableAgent: true }) + uiLane: isAgentTool ? 'agent' as const : 'chat', }; logger.debug('ToolExecutorNode: Adding tool result message with toolCallId:', { toolCallId, toolResultMessage }); diff --git a/front_end/panels/ai_chat/core/ToolNameMapping.test.ts b/front_end/panels/ai_chat/core/ToolNameMapping.test.ts index 67909db51a..5786f08faa 100644 --- a/front_end/panels/ai_chat/core/ToolNameMapping.test.ts +++ b/front_end/panels/ai_chat/core/ToolNameMapping.test.ts @@ -5,7 +5,7 @@ import { createToolExecutorNode } from './AgentNodes.js'; import type { AgentState } from './State.js'; import type { Tool } from '../tools/Tools.js'; -import { ChatMessageEntity } from '../ui/ChatView.js'; +import { ChatMessageEntity } from '../models/ChatTypes.js'; /* eslint-env mocha */ @@ -66,7 +66,7 @@ describe('AgentNodes sanitized tool name mapping', () => { } } as any; - const node = createToolExecutorNode(state); + const node = createToolExecutorNode(state, 'openai', 'gpt-4', 'gpt-4-mini', 'gpt-4-mini'); const result = await node.invoke(state); // Tool execute should have been called once diff --git a/front_end/panels/ai_chat/models/ChatTypes.ts b/front_end/panels/ai_chat/models/ChatTypes.ts index fae1fe2a17..eab00a0ede 100644 --- a/front_end/panels/ai_chat/models/ChatTypes.ts +++ b/front_end/panels/ai_chat/models/ChatTypes.ts @@ -13,9 +13,15 @@ export enum ChatMessageEntity { } // Base structure for all chat messages +export type UILane = 'chat' | 'agent'; + export interface BaseChatMessage { entity: ChatMessageEntity; error?: string; + // UI routing hint: which lane should render this message + uiLane?: UILane; + // If managed by an AgentSession, provide the session id for traceability + managedByAgentSessionId?: string; } // Image input used by user messages @@ -74,4 +80,3 @@ export enum State { LOADING = 'loading', ERROR = 'error', } - diff --git a/front_end/panels/ai_chat/ui/ChatView.ts b/front_end/panels/ai_chat/ui/ChatView.ts index aaaeaa10a9..65435cfcfb 100644 --- a/front_end/panels/ai_chat/ui/ChatView.ts +++ b/front_end/panels/ai_chat/ui/ChatView.ts @@ -157,36 +157,7 @@ export class ChatView extends HTMLElement { this.#structuredController.resetLastProcessed(); } - /** - * Check if a message is part of an agent session - */ - #isPartOfAgentSession(message: ChatMessage): boolean { - // Check if there's an AgentSessionMessage in the current messages - const hasAgentSession = this.#messages.some(msg => msg.entity === ChatMessageEntity.AGENT_SESSION); - - if (!hasAgentSession) { - return false; - } - - // For ModelChatMessage tool calls, check if they're from ConfigurableAgentTool - if (message.entity === ChatMessageEntity.MODEL) { - const modelMsg = message as ModelChatMessage; - if (modelMsg.action === 'tool' && modelMsg.toolName) { - // Check if there's a corresponding tool result that's from ConfigurableAgentTool - const toolResultIndex = this.#messages.findIndex((msg) => - msg.entity === ChatMessageEntity.TOOL_RESULT && - (msg as ToolResultMessage).toolName === modelMsg.toolName && - (msg as ToolResultMessage).toolCallId === modelMsg.toolCallId - ); - if (toolResultIndex !== -1) { - const toolResult = this.#messages[toolResultIndex] as ToolResultMessage; - return toolResult.isFromConfigurableAgent === true; - } - } - } - - return false; - } + // Lane-based routing: deprecated session-heuristics removed // Scroll behavior handled by @@ -399,6 +370,10 @@ export class ChatView extends HTMLElement { // Render messages based on the combined structure #renderMessage(message: ChatMessage | (ModelChatMessage & { resultText?: string, isError?: boolean, resultError?: string, combined?: boolean }) | (ToolResultMessage & { orphaned?: boolean }), combinedIndex?: number ): Lit.TemplateResult { try { + // Lane filter: hide agent-lane items from the main chat feed + if ((message as any).uiLane === 'agent') { + return html``; + } switch (message.entity) { case ChatMessageEntity.USER: // Render User Message via dedicated renderer @@ -439,9 +414,7 @@ export class ChatView extends HTMLElement { case ChatMessageEntity.TOOL_RESULT: { const toolResultMessage = message as (ToolResultMessage & { orphaned?: boolean }); - if (toolResultMessage.isFromConfigurableAgent) { - return html``; - } + // Lane-based filter already handled above if (toolResultMessage.orphaned) { return renderToolResultMessage(toolResultMessage); } @@ -451,14 +424,7 @@ export class ChatView extends HTMLElement { { // Cast to the potentially combined type const modelMessage = message as (ModelChatMessage & { resultText?: string, isError?: boolean, resultError?: string, combined?: boolean }); - - // Hide tool calls that are part of agent sessions - if (modelMessage.action === 'tool') { - const isPartOfSession = this.#isPartOfAgentSession(modelMessage); - if (isPartOfSession) { - return html``; - } - } + // Lane filter above already hides agent-managed tool calls // Check if it's a combined message (tool call + result) or just a running tool call / final answer const isCombined = modelMessage.combined === true; @@ -497,79 +463,78 @@ export class ChatView extends HTMLElement { const icon = ToolDescriptionFormatter.getToolIcon(toolName); const descriptionData = ToolDescriptionFormatter.getToolDescription(toolName, toolArgs); - return html`` - // return html` - // - // ${toolReasoning ? html` - //
- // ${renderMarkdown(toolReasoning, this.#markdownRenderer, this.#openInAIAssistantViewer.bind(this))} - //
- // ` : Lit.nothing} - - // - //
- // - //
- //
- //
${descriptionData.action}
- //
- // - //
+ return html` + + ${toolReasoning ? html` +
+ ${renderMarkdown(toolReasoning, this.#markdownRenderer)} +
+ ` : Lit.nothing} + + +
+ +
+
+
${descriptionData.action}
+
+ +
- // - // - // ${status === 'running' ? html` - //
- // - // - // - // - // - //
- // ` : Lit.nothing} - - // - // ${modelMessage.error ? html`
Model Error: ${modelMessage.error}
` : Lit.nothing} - //
- // `; + + ${status === 'running' ? html` +
+ + + + + +
+ ` : Lit.nothing} + + + ${modelMessage.error ? html`
Model Error: ${modelMessage.error}
` : Lit.nothing} +
+ `; } default: // Should not happen, but render a fallback @@ -976,6 +941,26 @@ export class ChatView extends HTMLElement { void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#boundRender); } + /** + * Toggle visibility of tool result details + */ + #toggleToolResult(event: Event): void { + const button = event.currentTarget as HTMLElement; + const timeline = button.closest('.agent-execution-timeline'); + const items = timeline?.querySelector('.timeline-items') as HTMLElement; + const icon = button.querySelector('.toggle-icon') as HTMLElement; + + if (items) { + if (items.style.display === 'none') { + items.style.display = 'block'; + icon.textContent = '▲'; + } else { + items.style.display = 'none'; + icon.textContent = '▼'; + } + } + } + // Stable key for message list rendering to avoid node reuse glitches #messageKey(m: CombinedMessage, index: number): string { // Agent sessions keyed by sessionId to ensure distinct component instances render diff --git a/front_end/panels/ai_chat/ui/ToolCallComponent.ts b/front_end/panels/ai_chat/ui/ToolCallComponent.ts index f4cfa25f54..63d46001e6 100644 --- a/front_end/panels/ai_chat/ui/ToolCallComponent.ts +++ b/front_end/panels/ai_chat/ui/ToolCallComponent.ts @@ -18,7 +18,7 @@ export class ToolCallComponent extends HTMLElement { private toolCall: AgentMessage | null = null; private status: ToolStatus = 'running'; - private isExpanded = false; + private isExpanded = true; connectedCallback(): void { this.render(); @@ -243,4 +243,4 @@ export class ToolCallComponent extends HTMLElement { default: return 'Unknown'; } } -} \ No newline at end of file +} diff --git a/front_end/panels/ai_chat/ui/message/MessageCombiner.ts b/front_end/panels/ai_chat/ui/message/MessageCombiner.ts index 02c12e0ca5..e4d9f56dad 100644 --- a/front_end/panels/ai_chat/ui/message/MessageCombiner.ts +++ b/front_end/panels/ai_chat/ui/message/MessageCombiner.ts @@ -24,33 +24,16 @@ export type CombinedMessage = ChatMessage|CombinedModelMessage|OrphanedToolResul * - toolName equality with immediate adjacency (fallback) */ export function combineMessages(messages: ChatMessage[]): CombinedMessage[] { - // Build a set of toolCallIds that are managed by agent sessions, so we can - // hide both the model tool-call and tool-result duplicates in the main feed. - const agentManagedToolCallIds = new Set(); - - for (const msg of messages) { - if ((msg as any).entity === 'agent_session') { - const sess = (msg as AgentSessionMessage).agentSession; - if (sess && Array.isArray(sess.messages)) { - for (const am of sess.messages) { - if (am && am.content && (am.content as any).toolCallId) { - agentManagedToolCallIds.add((am.content as any).toolCallId); - } - } - } - } else if ((msg as any).entity === 'tool_result') { - const tr = msg as ToolResultMessage; - if (tr.isFromConfigurableAgent && tr.toolCallId) { - agentManagedToolCallIds.add(tr.toolCallId); - } - } - } - const result: CombinedMessage[] = []; for (let i = 0; i < messages.length; i++) { const msg = messages[i]; + // Skip agent-lane items from chat feed + if ((msg as any).uiLane === 'agent') { + continue; + } + // Keep User messages and Final Model answers as-is if (msg.entity === 'user' || (msg.entity === 'model' && (msg as ModelChatMessage).action === 'final')) { result.push(msg); @@ -60,19 +43,10 @@ export function combineMessages(messages: ChatMessage[]): CombinedMessage[] { // Handle Model tool-call messages if (msg.entity === 'model' && (msg as ModelChatMessage).action === 'tool') { const modelMsg = msg as ModelChatMessage; - // Hide model tool-call if it's managed by an agent session - if (modelMsg.toolCallId && agentManagedToolCallIds.has(modelMsg.toolCallId)) { - // If the immediate next is the paired tool_result, skip it as well - const next = messages[i + 1]; - if (next && next.entity === 'tool_result' && (next as ToolResultMessage).toolCallId === modelMsg.toolCallId) { - i++; // skip the result too - } - continue; // do not include in result - } const next = messages[i + 1]; const nextIsMatchingToolResult = Boolean( - next && next.entity === 'tool_result' && + next && (next as any).uiLane !== 'agent' && next.entity === 'tool_result' && ( // Prefer toolCallId match when available (!!(next as ToolResultMessage).toolCallId && (next as ToolResultMessage).toolCallId === modelMsg.toolCallId) || @@ -83,11 +57,6 @@ export function combineMessages(messages: ChatMessage[]): CombinedMessage[] { if (nextIsMatchingToolResult) { const tr = next as ToolResultMessage; - // If the result is agent-managed, drop both - if (tr.isFromConfigurableAgent || (tr.toolCallId && agentManagedToolCallIds.has(tr.toolCallId))) { - i++; // skip the tool-result - continue; - } const combined: CombinedModelMessage = { ...modelMsg, resultText: tr.resultText, @@ -107,10 +76,7 @@ export function combineMessages(messages: ChatMessage[]): CombinedMessage[] { // Handle orphaned tool-result messages if (msg.entity === 'tool_result') { const tr = msg as ToolResultMessage; - // Hide agent-managed tool results in all cases - if (tr.isFromConfigurableAgent || (tr.toolCallId && agentManagedToolCallIds.has(tr.toolCallId))) { - continue; - } + // Agent-lane results already skipped above const prev = messages[i - 1]; const isPrevMatchingModelCall = Boolean( prev && prev.entity === 'model' && (prev as ModelChatMessage).action === 'tool' && From baa8523fae0c499cbec4fda0f8a94eb92ebfa250 Mon Sep 17 00:00:00 2001 From: Tyson Thomas Date: Thu, 11 Sep 2025 20:35:34 -0700 Subject: [PATCH 3/7] fix tests --- .../__tests__/ChatViewAgentSessions.test.ts | 31 ++++++++++++------- .../LiveAgentSessionComponent.test.ts | 12 +++---- .../SettingsDialogOpenRouterCache.test.ts | 6 ++-- .../message/__tests__/MessageCombiner.test.ts | 27 +++++----------- 4 files changed, 37 insertions(+), 39 deletions(-) diff --git a/front_end/panels/ai_chat/ui/__tests__/ChatViewAgentSessions.test.ts b/front_end/panels/ai_chat/ui/__tests__/ChatViewAgentSessions.test.ts index ba02e34a58..eb173ed511 100644 --- a/front_end/panels/ai_chat/ui/__tests__/ChatViewAgentSessions.test.ts +++ b/front_end/panels/ai_chat/ui/__tests__/ChatViewAgentSessions.test.ts @@ -1,7 +1,7 @@ // Copyright 2025 The Chromium Authors. import '../ChatView.js'; -import {raf} from '../../../../testing/DOMHelpers.js'; +import {raf, doubleRaf} from '../../../../testing/DOMHelpers.js'; // Local enums/types to avoid TS enum imports in strip mode const ChatMessageEntity = { @@ -92,7 +92,7 @@ describe('ChatView Agent Sessions: nesting & handoffs', () => { document.body.removeChild(view); }); - it('promotes child to top-level; top-level child is suppressed (shown inline under parent)', async () => { + it('promotes child to top-level; keep top-level child and suppress inline duplication', async () => { const child = makeSession('c1'); const parent = makeSession('p1', {nestedSessions: [child]}); const view = document.createElement('devtools-chat-view') as any; @@ -104,8 +104,10 @@ describe('ChatView Agent Sessions: nesting & handoffs', () => { view.data = {messages: [makeUser('start'), makeAgentSessionMessage(parent), makeAgentSessionMessage(child)], state: 'idle', isTextInputEmpty: true, onSendMessage: () => {}, onPromptSelected: () => {}} as any; await raf(); - // New behavior: suppress duplicate top-level child when also nested - assert.strictEqual(view.getLiveAgentSessionCountForTesting(), 1); + // Allow ScheduledRender and internal flags to settle across frames + await doubleRaf(); + // New behavior: keep top-level child visible; suppress only inline duplication in parent + assert.strictEqual(view.getLiveAgentSessionCountForTesting(), 2); document.body.removeChild(view); }); @@ -255,8 +257,11 @@ describe('ChatView Agent Sessions: nesting & handoffs', () => { // Parent timeline item present const parentItems = sroot.querySelectorAll('.timeline-item'); assert.isAtLeast(parentItems.length, 1); - // Nested child timeline HTML is inlined; ensure child tool name appears - assert.include(sroot.innerHTML, 'fetch'); + // Verify nested child session exists and its shadow DOM contains the tool name + const nestedChild = sroot.querySelector('live-agent-session') as HTMLElement; + assert.isNotNull(nestedChild); + const nestedShadow = nestedChild.shadowRoot!; + assert.include((nestedShadow.innerHTML || '').toLowerCase(), 'fetch'); document.body.removeChild(view); }); @@ -312,8 +317,8 @@ describe('ChatView visibility rules: agent-managed tool calls/results are hidden // Include model tool + agent-managed tool result view.data = {messages: [ makeUser('start'), - { entity: ChatMessageEntity.MODEL, action: 'tool', toolName: 'fetch', toolCallId, isFinalAnswer: false } as any, - { entity: ChatMessageEntity.TOOL_RESULT, toolName: 'fetch', toolCallId, resultText: 'ok', isError: false, isFromConfigurableAgent: true } as any, + { entity: ChatMessageEntity.MODEL, action: 'tool', toolName: 'fetch', toolCallId, isFinalAnswer: false, uiLane: 'agent' } as any, + { entity: ChatMessageEntity.TOOL_RESULT, toolName: 'fetch', toolCallId, resultText: 'ok', isError: false, uiLane: 'agent' } as any, makeAgentSessionMessage(agent), ], state: 'idle', isTextInputEmpty: true, onSendMessage: () => {}, onPromptSelected: () => {}} as any; await raf(); @@ -345,8 +350,8 @@ describe('ChatView visibility rules: agent-managed tool calls/results are hidden const toolCallId = 't1'; view.data = {messages: [ makeUser('start'), - { entity: ChatMessageEntity.MODEL, action: 'tool', toolName: 'fetch', toolCallId, isFinalAnswer: false } as any, - { entity: ChatMessageEntity.TOOL_RESULT, toolName: 'fetch', toolCallId, resultText: 'ok', isError: false, isFromConfigurableAgent: true } as any, + { entity: ChatMessageEntity.MODEL, action: 'tool', toolName: 'fetch', toolCallId, isFinalAnswer: false, uiLane: 'agent' } as any, + { entity: ChatMessageEntity.TOOL_RESULT, toolName: 'fetch', toolCallId, resultText: 'ok', isError: false, uiLane: 'agent' } as any, { entity: ChatMessageEntity.TOOL_RESULT, toolName: 'other', resultText: 'y', isError: false } as any, makeAgentSessionMessage(makeSession('s1')), ], state: 'idle', isTextInputEmpty: true, onSendMessage: () => {}, onPromptSelected: () => {}} as any; @@ -404,14 +409,18 @@ describe('LiveAgentSessionComponent timeline rendering and interactions', () => const live = queryLive(view)[0]; const sroot = live.shadowRoot!; const toggle = sroot.querySelector('.tool-toggle') as HTMLButtonElement; + // Capture initial state, then toggle once + const before = (sroot.querySelector('.timeline-items') as HTMLElement).style.display; toggle?.click(); await raf(); + const afterToggle = (live.shadowRoot!.querySelector('.timeline-items') as HTMLElement).style.display; // Trigger re-render by adding a no-op user message view.data = {messages: [makeUser('start'), makeUser('again'), makeAgentSessionMessage(session)], state: 'idle', isTextInputEmpty: true, onSendMessage: () => {}, onPromptSelected: () => {}} as any; await raf(); const sroot2 = queryLive(view)[0].shadowRoot!; const timeline = sroot2.querySelector('.timeline-items') as HTMLElement; - assert.strictEqual(timeline.style.display, 'block'); + // Expect the toggled state to persist across re-render + assert.strictEqual(timeline.style.display, afterToggle); document.body.removeChild(view); }); diff --git a/front_end/panels/ai_chat/ui/__tests__/LiveAgentSessionComponent.test.ts b/front_end/panels/ai_chat/ui/__tests__/LiveAgentSessionComponent.test.ts index 50e78f4b33..fdbae5b28f 100644 --- a/front_end/panels/ai_chat/ui/__tests__/LiveAgentSessionComponent.test.ts +++ b/front_end/panels/ai_chat/ui/__tests__/LiveAgentSessionComponent.test.ts @@ -76,16 +76,16 @@ describe('LiveAgentSessionComponent UI elements', () => { const sroot = el.shadowRoot!; const timeline = sroot.querySelector('.timeline-items') as HTMLElement; - // Default collapsed - assert.strictEqual(timeline.style.display, 'none'); - // Click toggle + // Default expanded + assert.strictEqual(timeline.style.display, 'block'); + // Click toggle to collapse (sroot.querySelector('.tool-toggle') as HTMLButtonElement).click(); await raf(); - assert.strictEqual((el.shadowRoot!.querySelector('.timeline-items') as HTMLElement).style.display, 'block'); - // Collapse again + assert.strictEqual((el.shadowRoot!.querySelector('.timeline-items') as HTMLElement).style.display, 'none'); + // Expand again (el.shadowRoot!.querySelector('.tool-toggle') as HTMLButtonElement).click(); await raf(); - assert.strictEqual((el.shadowRoot!.querySelector('.timeline-items') as HTMLElement).style.display, 'none'); + assert.strictEqual((el.shadowRoot!.querySelector('.timeline-items') as HTMLElement).style.display, 'block'); document.body.removeChild(el); }); diff --git a/front_end/panels/ai_chat/ui/__tests__/SettingsDialogOpenRouterCache.test.ts b/front_end/panels/ai_chat/ui/__tests__/SettingsDialogOpenRouterCache.test.ts index 3f7cc6b0df..d2ad20017f 100644 --- a/front_end/panels/ai_chat/ui/__tests__/SettingsDialogOpenRouterCache.test.ts +++ b/front_end/panels/ai_chat/ui/__tests__/SettingsDialogOpenRouterCache.test.ts @@ -87,7 +87,7 @@ describe('SettingsDialog OpenRouter Cache Auto-Refresh', () => { mockLocalStorage.set('openrouter_models_cache', JSON.stringify(mockModels)); // No timestamp set - const timestamp = mockLocalStorage.get('openrouter_models_cache_timestamp'); + const timestamp = window.localStorage.getItem('openrouter_models_cache_timestamp'); assert.isNull(timestamp); }); @@ -145,7 +145,7 @@ describe('SettingsDialog OpenRouter Cache Auto-Refresh', () => { mockLocalStorage.set('openrouter_models_cache_timestamp', staleCacheTime.toString()); // No API key set - const apiKey = mockLocalStorage.get('ai_chat_openrouter_api_key'); + const apiKey = window.localStorage.getItem('ai_chat_openrouter_api_key'); assert.isNull(apiKey); // Should not attempt fetch without API key @@ -256,4 +256,4 @@ describe('SettingsDialog OpenRouter Cache Auto-Refresh', () => { assert.strictEqual(firstTimestamp, secondTimestamp); }); }); -}); \ No newline at end of file +}); diff --git a/front_end/panels/ai_chat/ui/message/__tests__/MessageCombiner.test.ts b/front_end/panels/ai_chat/ui/message/__tests__/MessageCombiner.test.ts index fc3a592a00..ad0091c72f 100644 --- a/front_end/panels/ai_chat/ui/message/__tests__/MessageCombiner.test.ts +++ b/front_end/panels/ai_chat/ui/message/__tests__/MessageCombiner.test.ts @@ -34,46 +34,35 @@ describe('MessageCombiner', () => { assert.isTrue((combined[0] as any).orphaned); }); - it('hides model tool-call and its result when agent session manages same toolCallId', () => { + it('hides model tool-call and its result when marked agent-lane', () => { const toolCallId = 'tc-123'; const messages: ChatMessage[] = [ { entity: ChatMessageEntity.USER, text: 'run agent' } as any, // Model tool call that will be managed by the agent session - { entity: ChatMessageEntity.MODEL, action: 'tool', toolName: 'fetch', toolCallId, isFinalAnswer: false } as any, - { entity: ChatMessageEntity.TOOL_RESULT, toolName: 'fetch', toolCallId, resultText: '{"ok":true}', isError: false } as any, - // Agent session includes the same tool call/result in its timeline - { entity: ChatMessageEntity.AGENT_SESSION, agentSession: { - sessionId: 's1', - agentName: 'agent', - status: 'running', - startTime: new Date(), - messages: [ - { id: 'tc', timestamp: new Date(), type: 'tool_call', content: { type: 'tool_call', toolName: 'fetch', toolArgs: { url: 'x' }, toolCallId } }, - { id: 'tr', timestamp: new Date(), type: 'tool_result', content: { type: 'tool_result', toolName: 'fetch', toolCallId, success: true, result: { ok: true } } }, - ], - nestedSessions: [], - }} as any, + { entity: ChatMessageEntity.MODEL, action: 'tool', toolName: 'fetch', toolCallId, isFinalAnswer: false, uiLane: 'agent' } as any, + { entity: ChatMessageEntity.TOOL_RESULT, toolName: 'fetch', toolCallId, resultText: '{"ok":true}', isError: false, uiLane: 'agent' } as any, + { entity: ChatMessageEntity.AGENT_SESSION, agentSession: { sessionId: 's1', agentName: 'agent', status: 'running', startTime: new Date(), messages: [], nestedSessions: [] } } as any, ]; const combined = combineMessages(messages); - // Expect: user + agent_session only (model tool+result removed) + // Expect: user + agent_session only (model tool+result removed via lane) assert.lengthOf(combined, 2); assert.strictEqual((combined[0] as any).entity, 'user'); assert.strictEqual((combined[1] as any).entity, 'agent_session'); }); - it('hides agent-managed tool_result even if it arrives before model tool-call', () => { + it('hides agent-lane tool_result even if it arrives before model tool-call', () => { const toolCallId = 'tc-outoforder'; const messages: ChatMessage[] = [ { entity: ChatMessageEntity.USER, text: 'go' } as any, // Agent-managed tool result first - { entity: ChatMessageEntity.TOOL_RESULT, toolName: 'fetch', toolCallId, resultText: '{"ok":1}', isError: false, isFromConfigurableAgent: true } as any, + { entity: ChatMessageEntity.TOOL_RESULT, toolName: 'fetch', toolCallId, resultText: '{"ok":1}', isError: false, uiLane: 'agent' } as any, // Model tool call later { entity: ChatMessageEntity.MODEL, action: 'tool', toolName: 'fetch', toolCallId, isFinalAnswer: false } as any, ]; const combined = combineMessages(messages); - // Expect: user only (both the agent-managed result and matching model call removed) + // Expect: user only (both the agent-lane result and matching model call removed) assert.lengthOf(combined, 1); assert.strictEqual((combined[0] as any).entity, 'user'); }); From 16bda85950e5f334a7543bb9859288ec33d237fc Mon Sep 17 00:00:00 2001 From: Tyson Thomas Date: Thu, 11 Sep 2025 20:58:12 -0700 Subject: [PATCH 4/7] fix test run --- config/gni/devtools_grd_files.gni | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/config/gni/devtools_grd_files.gni b/config/gni/devtools_grd_files.gni index dc67c3e9aa..ab6f6d5336 100644 --- a/config/gni/devtools_grd_files.gni +++ b/config/gni/devtools_grd_files.gni @@ -2209,6 +2209,16 @@ grd_files_unbundled_sources = [ "front_end/third_party/lit/lib/lit.js", "front_end/third_party/lit/lib/static-html.js", "front_end/third_party/marked/package/lib/marked.esm.js", + "front_end/third_party/mcp-sdk/ajv/dist/ajv.js", + "front_end/third_party/mcp-sdk/eventsource-parser/package/dist/index.js", + "front_end/third_party/mcp-sdk/eventsource-parser/package/dist/stream.js", + "front_end/third_party/mcp-sdk/package/dist/client/index.js", + "front_end/third_party/mcp-sdk/package/dist/client/sse.js", + "front_end/third_party/mcp-sdk/package/dist/shared/protocol.js", + "front_end/third_party/mcp-sdk/package/dist/shared/transport.js", + "front_end/third_party/mcp-sdk/package/dist/types.js", + "front_end/third_party/mcp-sdk/zod/lib/index.js", + "front_end/third_party/mcp-sdk/zod/lib/index.mjs", "front_end/third_party/puppeteer-replay/package/lib/main.js", "front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.js", "front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BrowserContext.js", From e6e46cfe12495d071febe5895ae2e7afcd37cb71 Mon Sep 17 00:00:00 2001 From: Tyson Thomas Date: Fri, 12 Sep 2025 22:54:11 -0700 Subject: [PATCH 5/7] more improvements --- front_end/panels/ai_chat/ui/AIChatPanel.ts | 16 +- front_end/panels/ai_chat/ui/ChatView.ts | 9 +- front_end/panels/ai_chat/ui/HelpDialog.ts | 6 +- front_end/panels/ai_chat/ui/SettingsDialog.ts | 269 ++++++++++-------- front_end/panels/ai_chat/ui/chatView.css | 27 +- front_end/panels/ai_chat/ui/input/InputBar.ts | 1 + .../panels/ai_chat/ui/message/MessageList.ts | 3 +- .../ui/message/StructuredResponseRender.ts | 4 +- .../ui/model_selector/ModelSelector.ts | 22 +- .../components/markdown_view/MarkdownView.ts | 2 +- 10 files changed, 211 insertions(+), 148 deletions(-) diff --git a/front_end/panels/ai_chat/ui/AIChatPanel.ts b/front_end/panels/ai_chat/ui/AIChatPanel.ts index 56c3741ce1..1be9f714c3 100644 --- a/front_end/panels/ai_chat/ui/AIChatPanel.ts +++ b/front_end/panels/ai_chat/ui/AIChatPanel.ts @@ -793,14 +793,11 @@ export class AIChatPanel extends UI.Panel.Panel { #setupMCPIntegration(): void { const initAndRefresh = async () => { try { - const mcpConfig = getMCPConfig(); - // Only auto-connect if both enabled and autostart are true - if (mcpConfig.enabled && mcpConfig.autostart) { - await MCPRegistry.init(); - await MCPRegistry.refresh(); - const status = MCPRegistry.getStatus(); - logger.info('MCP autostart completed', status); - } + // Always attempt to connect to MCP on startup + await MCPRegistry.init(); + await MCPRegistry.refresh(); + const status = MCPRegistry.getStatus(); + logger.info('MCP auto-connect completed', status); } catch (err) { logger.error('Failed to initialize MCP', err); } @@ -2086,7 +2083,8 @@ export class AIChatPanel extends UI.Panel.Panel { } #onHelpClick(): void { - HelpDialog.show(); + // Open external getting started docs in a new tab + UI.UIUtils.openInNewTab('https://browseroperator.io/docs/getting-started/'); } /** diff --git a/front_end/panels/ai_chat/ui/ChatView.ts b/front_end/panels/ai_chat/ui/ChatView.ts index 65435cfcfb..af673947a1 100644 --- a/front_end/panels/ai_chat/ui/ChatView.ts +++ b/front_end/panels/ai_chat/ui/ChatView.ts @@ -288,11 +288,12 @@ export class ChatView extends HTMLElement { this.#selectedPromptType = data.selectedAgentType; } - // Check if we should exit the first message view state - // We're no longer in first message view if there are user messages - const hasUserMessages = data.messages && Array.isArray(data.messages) ? + // Check if we should show the centered first-message view + // Only show it if there are no user messages AND at most one message (welcome) + const messageCount = data.messages && Array.isArray(data.messages) ? data.messages.length : 0; + const hasUserMessages = data.messages && Array.isArray(data.messages) ? data.messages.some(msg => msg && msg.entity === ChatMessageEntity.USER) : false; - this.#isFirstMessageView = !hasUserMessages; + this.#isFirstMessageView = !hasUserMessages && messageCount <= 1; // Controller owns session message upserts; no UI sync required diff --git a/front_end/panels/ai_chat/ui/HelpDialog.ts b/front_end/panels/ai_chat/ui/HelpDialog.ts index 388b877c45..8ae246d106 100644 --- a/front_end/panels/ai_chat/ui/HelpDialog.ts +++ b/front_end/panels/ai_chat/ui/HelpDialog.ts @@ -35,9 +35,9 @@ const UIStrings = { */ importantNotice: 'Important Notice', /** - *@description Alpha version warning + *@description Beta version warning */ - alphaVersionWarning: 'Alpha Version: This is an alpha version of the Browser Operator - AI Assistant feature. Do not use it for production or sensitive data.', + betaVersionWarning: 'Beta Version: This is an beta version of the Browser Operator - AI Assistant feature. Do not use it for production or sensitive data.', /** *@description Data sharing notice */ @@ -214,7 +214,7 @@ export class HelpDialog { const disclaimerWarning = document.createElement('p'); disclaimerWarning.className = 'help-disclaimer-warning'; - disclaimerWarning.textContent = i18nString(UIStrings.alphaVersionWarning); + disclaimerWarning.textContent = i18nString(UIStrings.betaVersionWarning); disclaimerSection.appendChild(disclaimerWarning); const disclaimerNote = document.createElement('p'); diff --git a/front_end/panels/ai_chat/ui/SettingsDialog.ts b/front_end/panels/ai_chat/ui/SettingsDialog.ts index 1fc5dea22c..b012fb8158 100644 --- a/front_end/panels/ai_chat/ui/SettingsDialog.ts +++ b/front_end/panels/ai_chat/ui/SettingsDialog.ts @@ -12,6 +12,7 @@ import { getMCPConfig, setMCPConfig, isMCPEnabled } from '../mcp/MCPConfig.js'; import { MCPRegistry } from '../mcp/MCPRegistry.js'; import { DEFAULT_PROVIDER_MODELS } from './AIChatPanel.js'; +import './model_selector/ModelSelector.js'; const logger = createLogger('SettingsDialog'); @@ -395,14 +396,7 @@ const UIStrings = { *@description MCP no tools message */ mcpNoTools: 'No tools discovered. Connect to an MCP server first.', - /** - *@description MCP autostart label - */ - mcpAutostart: 'Auto-connect on startup', - /** - *@description MCP autostart hint - */ - mcpAutostartHint: 'Automatically connect to MCP server when DevTools opens', + /** *@description MCP tool mode label */ @@ -451,14 +445,14 @@ export function isVectorDBEnabled(): boolean { export class SettingsDialog { // Variables to store direct references to model selectors - static #openaiMiniModelSelect: HTMLSelectElement | null = null; - static #openaiNanoModelSelect: HTMLSelectElement | null = null; - static #litellmMiniModelSelect: HTMLSelectElement | null = null; - static #litellmNanoModelSelect: HTMLSelectElement | null = null; - static #groqMiniModelSelect: HTMLSelectElement | null = null; - static #groqNanoModelSelect: HTMLSelectElement | null = null; - static #openrouterMiniModelSelect: HTMLSelectElement | null = null; - static #openrouterNanoModelSelect: HTMLSelectElement | null = null; + static #openaiMiniModelSelect: any | null = null; + static #openaiNanoModelSelect: any | null = null; + static #litellmMiniModelSelect: any | null = null; + static #litellmNanoModelSelect: any | null = null; + static #groqMiniModelSelect: any | null = null; + static #groqNanoModelSelect: any | null = null; + static #openrouterMiniModelSelect: any | null = null; + static #openrouterNanoModelSelect: any | null = null; static async show( selectedModel: string, @@ -871,10 +865,10 @@ export class SettingsDialog { // Refresh existing model selectors with new options if they exist if (SettingsDialog.#litellmMiniModelSelect) { - refreshModelSelectOptions(SettingsDialog.#litellmMiniModelSelect, allLiteLLMModels, miniModel); + refreshModelSelectOptions(SettingsDialog.#litellmMiniModelSelect, allLiteLLMModels, miniModel, i18nString(UIStrings.defaultMiniOption)); } if (SettingsDialog.#litellmNanoModelSelect) { - refreshModelSelectOptions(SettingsDialog.#litellmNanoModelSelect, allLiteLLMModels, nanoModel); + refreshModelSelectOptions(SettingsDialog.#litellmNanoModelSelect, allLiteLLMModels, nanoModel, i18nString(UIStrings.defaultNanoOption)); } if (hadWildcard && actualModelCount === 0 && !hasCustomModels) { @@ -935,27 +929,36 @@ export class SettingsDialog { customModelsSection.appendChild(customModelsList); // Helper function to refresh the model list in a select element - function refreshModelSelectOptions(select: HTMLSelectElement, models: ModelOption[], currentValue: string) { - // Remember the current value - const previousValue = select.value; - - // Remove all options except the default (first) option + function refreshModelSelectOptions(select: any, models: ModelOption[], currentValue: string, defaultLabel: string) { + // Custom component path + if (select && select.tagName && select.tagName.toLowerCase() === 'ai-model-selector') { + const previousValue = select.value || select.selected || ''; + const opts = [{ value: '', label: defaultLabel }, ...models]; + select.options = opts; + if (previousValue && opts.some((o: any) => o.value === previousValue)) { + select.value = previousValue; + } else if (currentValue && opts.some((o: any) => o.value === currentValue)) { + select.value = currentValue; + } else { + select.value = ''; + } + return; + } + + // Native for existing code paths + try { + Object.defineProperty(selectorEl, 'value', { + get() { return selectorEl.selected || ''; }, + set(v: string) { selectorEl.selected = v || ''; }, + configurable: true, + }); + } catch {} + if (onFocus) { - modelSelect.addEventListener('focus', onFocus); + selectorEl.addEventListener('model-selector-focus', onFocus); } - - return modelSelect; + + modelContainer.appendChild(selectorEl); + return selectorEl as HTMLElement; } diff --git a/front_end/panels/ai_chat/ui/chatView.css b/front_end/panels/ai_chat/ui/chatView.css index 2763ab7d5c..91cf88de37 100644 --- a/front_end/panels/ai_chat/ui/chatView.css +++ b/front_end/panels/ai_chat/ui/chatView.css @@ -11,6 +11,8 @@ overflow: hidden; font-family: var(--default-font-family); background-color: var(--sys-color-cdt-base-container); + /* Reserve space for overlayed input bar within nested scrollers */ + --ai-input-bar-reserved-space: 120px; --message-max-width: 80%; --message-horizontal-padding: var(--sys-size-5); --primary-color: var(--color-primary); @@ -41,16 +43,30 @@ ai-input-bar { width: 100%; } +/* Float input bar above content; messages scroll behind */ +.chat-view-container > ai-input-bar { + position: absolute; + left: 0; + right: 0; + bottom: 0; + z-index: 5; +} + +/* Center the input bar in first-message (centered) view */ +/* In centered view the input is rendered inside centered-content, so no overlay positioning needed */ + .chat-view-container { display: flex; flex-direction: column; height: 100%; width: 100%; position: relative; + overflow: hidden; /* Ensure only the message list scrolls */ backdrop-filter: blur(10px); transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1); } +/* Legacy selector kept for backwards compatibility (unused by ai-message-list) */ .messages-container { flex: 1 1 auto; overflow-y: auto; @@ -59,7 +75,7 @@ ai-input-bar { scroll-behavior: smooth; padding: 12px 16px; background-color: var(--color-background); - padding-bottom: calc(12px + 80px); + padding-bottom: var(--ai-input-bar-reserved-space); min-height: 100px; } @@ -84,6 +100,12 @@ ai-input-bar { animation: expandToFull 0.5s cubic-bezier(0.4, 0, 0.2, 1); } +/* In expanded (conversation) view, reserve bottom space so the floating + input bar does not overlap the last messages. */ +.chat-view-container.expanded-view { + padding-bottom: 150px; /* tune if input height changes */ +} + @keyframes expandToFull { from { opacity: 0.8; } to { opacity: 1; } @@ -531,8 +553,7 @@ ai-input-bar { display: flex; justify-content: flex-end; padding: 4px 0; - margin-top: 8px; - margin-bottom: 8px; + margin-bottom: 28px; border-top: 1px solid var(--color-details-hairline); opacity: 0.8; transition: opacity var(--transition-fast); diff --git a/front_end/panels/ai_chat/ui/input/InputBar.ts b/front_end/panels/ai_chat/ui/input/InputBar.ts index 7a9ced36c1..993d3dfd6b 100644 --- a/front_end/panels/ai_chat/ui/input/InputBar.ts +++ b/front_end/panels/ai_chat/ui/input/InputBar.ts @@ -96,6 +96,7 @@ export class InputBar extends HTMLElement { .options=${this.#modelOptions} .selected=${this.#selectedModel} .disabled=${this.#modelSelectorDisabled} + .preferAbove=${!this.#centered} @change=${(e: CustomEvent) => { const value = (e.detail as any)?.value as string | undefined; if (value) { diff --git a/front_end/panels/ai_chat/ui/message/MessageList.ts b/front_end/panels/ai_chat/ui/message/MessageList.ts index de2327f49b..4bb3d7afc9 100644 --- a/front_end/panels/ai_chat/ui/message/MessageList.ts +++ b/front_end/panels/ai_chat/ui/message/MessageList.ts @@ -65,8 +65,7 @@ export class MessageList extends HTMLElement { scroll-behavior: smooth; padding: 12px 16px; background-color: var(--color-background); - /* Reduced bottom padding since input bar is no longer sticky */ - padding-bottom: 16px; + padding-bottom: 12px; min-height: 100px; position: relative; z-index: 0; diff --git a/front_end/panels/ai_chat/ui/message/StructuredResponseRender.ts b/front_end/panels/ai_chat/ui/message/StructuredResponseRender.ts index 2127ab2bcd..0334fc58a8 100644 --- a/front_end/panels/ai_chat/ui/message/StructuredResponseRender.ts +++ b/front_end/panels/ai_chat/ui/message/StructuredResponseRender.ts @@ -39,7 +39,7 @@ export function renderStructuredResponse( ` : state.aiState === 'opened' ? html`
- +
` : html`
@@ -47,7 +47,7 @@ export function renderStructuredResponse(
${renderMarkdown(data.markdownReport, markdownRenderer, open)}
- +
`} diff --git a/front_end/panels/ai_chat/ui/model_selector/ModelSelector.ts b/front_end/panels/ai_chat/ui/model_selector/ModelSelector.ts index 0474066e93..fdfbd73b50 100644 --- a/front_end/panels/ai_chat/ui/model_selector/ModelSelector.ts +++ b/front_end/panels/ai_chat/ui/model_selector/ModelSelector.ts @@ -19,6 +19,8 @@ export class ModelSelector extends HTMLElement { #open = false; #query = ''; #highlighted = 0; + #preferAbove = false; + #forceSearchable = false; get options(): ModelOption[] { return this.#options; } set options(v: ModelOption[]) { this.#options = v || []; this.#render(); } @@ -26,6 +28,10 @@ export class ModelSelector extends HTMLElement { set selected(v: string | undefined) { this.#selected = v; this.#render(); } get disabled(): boolean { return this.#disabled; } set disabled(v: boolean) { this.#disabled = !!v; this.#render(); } + get preferAbove(): boolean { return this.#preferAbove; } + set preferAbove(v: boolean) { this.#preferAbove = !!v; this.#render(); } + get forceSearchable(): boolean { return this.#forceSearchable; } + set forceSearchable(v: boolean) { this.#forceSearchable = !!v; this.#render(); } connectedCallback(): void { this.#render(); } @@ -33,7 +39,17 @@ export class ModelSelector extends HTMLElement { this.dispatchEvent(new CustomEvent('change', { bubbles: true, detail: { value }})); } - #toggle = (e: Event) => { e.preventDefault(); if (!this.#disabled) { this.#open = !this.#open; this.#render(); } }; + #toggle = (e: Event) => { + e.preventDefault(); + if (this.#disabled) return; + const wasOpen = this.#open; + this.#open = !this.#open; + this.#render(); + if (!wasOpen && this.#open) { + // Notify host that the selector opened (used to lazily refresh models) + this.dispatchEvent(new CustomEvent('model-selector-focus', {bubbles: true})); + } + }; #onSearch = (e: Event) => { this.#query = (e.target as HTMLInputElement).value; this.#highlighted = 0; this.#render(); }; #onKeydown = (e: KeyboardEvent) => { const filtered = this.#filtered(); @@ -49,7 +65,7 @@ export class ModelSelector extends HTMLElement { return this.#options.filter(o => o.label.toLowerCase().includes(q) || o.value.toLowerCase().includes(q)); } - #isSearchable(): boolean { return (this.#options?.length || 0) >= 20; } + #isSearchable(): boolean { return this.#forceSearchable || (this.#options?.length || 0) >= 20; } #render(): void { const selectedLabel = this.#options.find(o => o.value === this.#selected)?.label || this.#selected || 'Select Model'; @@ -72,7 +88,7 @@ export class ModelSelector extends HTMLElement { ${this.#open ? '▲' : '▼'} ${this.#open ? html` -
e.stopPropagation()}> +
e.stopPropagation()}>
${filtered.map((o, i) => html` diff --git a/front_end/ui/components/markdown_view/MarkdownView.ts b/front_end/ui/components/markdown_view/MarkdownView.ts index 86dceecfa7..5422438de7 100644 --- a/front_end/ui/components/markdown_view/MarkdownView.ts +++ b/front_end/ui/components/markdown_view/MarkdownView.ts @@ -320,7 +320,7 @@ export class MarkdownLitRenderer { class="view-document-btn" @click=${() => this.openTableInViewer(token)} title="Open table in full document viewer for better viewing"> - 📊 View Full Table + 📊 View Full Screen
` : ''} From 1fad5e29f93a43f7ba2f4b8def14851224ef5b58 Mon Sep 17 00:00:00 2001 From: Tyson Thomas Date: Sat, 13 Sep 2025 07:49:42 -0700 Subject: [PATCH 6/7] add minor fixes --- config/gni/devtools_grd_files.gni | 1 + front_end/panels/ai_chat/BUILD.gn | 3 +- .../ai_chat/agent_framework/AgentRunner.ts | 1 + .../agent_framework/ConfigurableAgentTool.ts | 9 +- front_end/panels/ai_chat/core/AgentNodes.ts | 64 +++++++++---- front_end/panels/ai_chat/core/AgentService.ts | 7 ++ front_end/panels/ai_chat/core/ToolNameMap.ts | 65 ++++++++++++++ .../ai_chat/core/ToolNameMapping.test.ts | 65 +++++++------- .../core/__tests__/AgentNodesSanitize.test.ts | 80 +++++++++++++++++ front_end/panels/ai_chat/mcp/MCPConfig.ts | 12 ++- front_end/panels/ai_chat/mcp/MCPRegistry.ts | 9 ++ .../panels/ai_chat/mcp/MCPToolAdapter.ts | 4 +- front_end/panels/ai_chat/tools/Tools.ts | 1 + front_end/panels/ai_chat/ui/SettingsDialog.ts | 90 ++++++++++++------- 14 files changed, 317 insertions(+), 94 deletions(-) create mode 100644 front_end/panels/ai_chat/core/ToolNameMap.ts create mode 100644 front_end/panels/ai_chat/core/__tests__/AgentNodesSanitize.test.ts diff --git a/config/gni/devtools_grd_files.gni b/config/gni/devtools_grd_files.gni index ab6f6d5336..215f9bec14 100644 --- a/config/gni/devtools_grd_files.gni +++ b/config/gni/devtools_grd_files.gni @@ -639,6 +639,7 @@ grd_files_bundled_sources = [ "front_end/panels/ai_chat/core/AgentNodes.js", "front_end/panels/ai_chat/core/GraphHelpers.js", "front_end/panels/ai_chat/core/ToolSurfaceProvider.js", + "front_end/panels/ai_chat/core/ToolNameMap.js", "front_end/panels/ai_chat/core/StateGraph.js", "front_end/panels/ai_chat/core/Logger.js", "front_end/panels/ai_chat/core/AgentErrorHandler.js", diff --git a/front_end/panels/ai_chat/BUILD.gn b/front_end/panels/ai_chat/BUILD.gn index 91d509e19e..b1c66bc425 100644 --- a/front_end/panels/ai_chat/BUILD.gn +++ b/front_end/panels/ai_chat/BUILD.gn @@ -55,6 +55,7 @@ devtools_module("ai_chat") { "core/PageInfoManager.ts", "core/AgentNodes.ts", "core/GraphHelpers.ts", + "core/ToolNameMap.ts", "core/ToolSurfaceProvider.ts", "core/StateGraph.ts", "core/Logger.ts", @@ -189,6 +190,7 @@ _ai_chat_sources = [ "core/PageInfoManager.ts", "core/AgentNodes.ts", "core/GraphHelpers.ts", + "core/ToolNameMap.ts", "core/ToolSurfaceProvider.ts", "core/StateGraph.ts", "core/Logger.ts", @@ -359,7 +361,6 @@ ts_library("unittests") { "agent_framework/__tests__/AgentRunner.run.flows.test.ts", "mcp/MCPClientSDK.test.ts", "core/ToolSurfaceProvider.test.ts", - "core/ToolNameMapping.test.ts", ] deps = [ diff --git a/front_end/panels/ai_chat/agent_framework/AgentRunner.ts b/front_end/panels/ai_chat/agent_framework/AgentRunner.ts index 06d401ebba..a0ff010650 100644 --- a/front_end/panels/ai_chat/agent_framework/AgentRunner.ts +++ b/front_end/panels/ai_chat/agent_framework/AgentRunner.ts @@ -977,6 +977,7 @@ export class AgentRunner { logger.info(`${agentName} Executing tool: ${toolToExecute.name}`); const execTracingContext = getCurrentTracingContext(); toolResultData = await toolToExecute.execute(toolArgs as any, ({ + apiKey: config.apiKey, provider: config.provider, model: modelName, miniModel: config.miniModel, diff --git a/front_end/panels/ai_chat/agent_framework/ConfigurableAgentTool.ts b/front_end/panels/ai_chat/agent_framework/ConfigurableAgentTool.ts index a044b47a53..f13079556c 100644 --- a/front_end/panels/ai_chat/agent_framework/ConfigurableAgentTool.ts +++ b/front_end/panels/ai_chat/agent_framework/ConfigurableAgentTool.ts @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import { AgentService } from '../core/AgentService.js'; import type { Tool } from '../tools/Tools.js'; import { ChatMessageEntity, type ChatMessage } from '../models/ChatTypes.js'; import { createLogger } from '../core/Logger.js'; @@ -17,6 +16,7 @@ import { AgentRunner, type AgentRunnerConfig, type AgentRunnerHooks } from './Ag // Context passed along with agent/tool calls export interface CallCtx { + apiKey?: string, provider?: LLMProvider, model?: string, miniModel?: string, @@ -402,8 +402,8 @@ export class ConfigurableAgentTool implements Tool { console.log('[AGENT NODE DEBUG] AgentNode invoke called, messages count:', state.messages.length); logger.debug('AgentNode: Invoked with state. Last message:', @@ -126,7 +129,7 @@ export function createAgentNode(modelName: string, provider: LLMProvider, temper input: { systemPrompt: systemPrompt.substring(0, 1000) + '...', // Truncate for tracing messages: state.messages.length, - tools: getAgentToolsFromState(state).map(t => t.name), + tools: [], lastMessage: state.messages.length > 0 ? { entity: state.messages[state.messages.length - 1].entity, content: JSON.stringify(state.messages[state.messages.length - 1]).substring(0, 500) @@ -145,13 +148,32 @@ export function createAgentNode(modelName: string, provider: LLMProvider, temper const provider = this.provider as LLMProvider; // Get tools for the current agent type - const baseTools = getAgentToolsFromState(state); + const baseTools = BaseOrchestratorAgent.getAgentTools(state.selectedAgentType ?? '') as any; const selection = await ToolSurfaceProvider.select(state, baseTools, { maxToolsPerTurn: 20, maxMcpPerTurn: 8 }); // Persist selection in context so ToolExecutorNode can resolve the same set if (!state.context) { (state as any).context = {}; } (state.context as any).selectedToolNames = selection.selectedNames; const tools = selection.tools; + // Update the generation observation with the actual tool list now that selection is known + if (tracingContext?.traceId && generationId) { + try { + await this.tracingProvider.updateObservation(generationId, { + input: { + systemPrompt: systemPrompt.substring(0, 1000) + '...', + messages: state.messages.length, + tools: tools.map(t => t.name), + lastMessage: state.messages.length > 0 ? { + entity: state.messages[state.messages.length - 1].entity, + content: JSON.stringify(state.messages[state.messages.length - 1]).substring(0, 500) + } : null + } + }); + } catch (err) { + logger.warn('Failed to update generation observation with tools list', err); + } + } + // Convert ChatMessage[] to LLMMessage[] const llmMessages = this.convertChatMessagesToLLMMessages(state.messages); @@ -174,7 +196,7 @@ export function createAgentNode(modelName: string, provider: LLMProvider, temper tools: tools.map(tool => ({ type: 'function', function: { - name: tool.name, + name: ToolNameMap.getSanitized(tool.name), description: tool.description, parameters: tool.schema, } @@ -227,19 +249,20 @@ export function createAgentNode(modelName: string, provider: LLMProvider, temper let newModelMessage: ModelChatMessage; if (parsedAction.type === 'tool_call') { const toolCallId = crypto.randomUUID(); // Generate unique ID for OpenAI format + const resolvedToolName = ToolNameMap.resolveOriginal(parsedAction.name) || parsedAction.name; // Create tool-call event observation const tracingContext = state.context?.tracingContext; if (tracingContext?.traceId) { - const toolCallObservationId = `tool-call-${parsedAction.name}-${Date.now()}-${Math.random().toString(36).substring(2, 6)}`; + const toolCallObservationId = `tool-call-${resolvedToolName}-${Date.now()}-${Math.random().toString(36).substring(2, 6)}`; await this.tracingProvider.createObservation({ id: toolCallObservationId, - name: `Tool Call Decision: ${parsedAction.name}`, + name: `Tool Call Decision: ${resolvedToolName}`, type: 'event', startTime: new Date(), parentObservationId: tracingContext.currentGenerationId || tracingContext.parentObservationId, input: { - toolName: parsedAction.name, + toolName: resolvedToolName, toolArgs: parsedAction.args, toolCallId, reasoning: response.reasoning?.summary @@ -258,22 +281,22 @@ export function createAgentNode(modelName: string, provider: LLMProvider, temper } // Determine lane: agent tools render in agent lane only - const regTool = ToolRegistry.getRegisteredTool(parsedAction.name as any); + const regTool = ToolRegistry.getRegisteredTool(resolvedToolName as any); const isAgentTool = !!regTool && (regTool instanceof ConfigurableAgentTool); newModelMessage = { entity: ChatMessageEntity.MODEL, action: 'tool', - toolName: parsedAction.name, - toolArgs: parsedAction.args, - toolCallId, // Add for linking with tool response - isFinalAnswer: false, - reasoning: response.reasoning?.summary, - uiLane: isAgentTool ? 'agent' : 'chat', + toolName: resolvedToolName, + toolArgs: parsedAction.args, + toolCallId, // Add for linking with tool response + isFinalAnswer: false, + reasoning: response.reasoning?.summary, + uiLane: isAgentTool ? 'agent' : 'chat', }; - logger.debug('AgentNode: Created tool message', { toolName: parsedAction.name, toolCallId }); - if (parsedAction.name === 'finalize_with_critique') { + logger.debug('AgentNode: Created tool message', { toolName: resolvedToolName, toolCallId }); + if (resolvedToolName === 'finalize_with_critique') { logger.debug('AgentNode: finalize_with_critique call with args:', JSON.stringify(parsedAction.args)); } } else if (parsedAction.type === 'final_answer') { @@ -358,7 +381,7 @@ export function createAgentNode(modelName: string, provider: LLMProvider, temper /** * Convert ChatMessage[] to LLMMessage[] */ - private convertChatMessagesToLLMMessages(messages: ChatMessage[]): LLMMessage[] { + private convertChatMessagesToLLMMessages(messages: ChatMessage[], originalToSanitized?: Record): LLMMessage[] { const llmMessages: LLMMessage[] = []; logger.info('Converting ChatMessages to LLMMessages. Messages:', messages); for (const msg of messages) { @@ -379,6 +402,7 @@ export function createAgentNode(modelName: string, provider: LLMProvider, temper }); } else if ('action' in msg && msg.action === 'tool' && 'toolName' in msg && 'toolArgs' in msg && 'toolCallId' in msg) { // Tool call message - convert from ModelChatMessage structure + const fnName = originalToSanitized?.[msg.toolName!] || ToolNameMap.getSanitized(msg.toolName!); llmMessages.push({ role: 'assistant', content: undefined, @@ -386,7 +410,7 @@ export function createAgentNode(modelName: string, provider: LLMProvider, temper id: msg.toolCallId!, type: 'function' as const, function: { - name: msg.toolName!, + name: fnName, arguments: JSON.stringify(msg.toolArgs), } }], @@ -429,7 +453,7 @@ export function createToolExecutorNode(state: AgentState, provider: LLMProvider, } tools = resolved as any; } else { - tools = getAgentToolsFromState(state) as any; + tools = [] as unknown as ReturnType; } const toolMap = new Map[number]>(); (tools as any[]).forEach((tool: any) => toolMap.set(tool.name, tool)); @@ -566,7 +590,9 @@ export function createToolExecutorNode(state: AgentState, provider: LLMProvider, const result = await withTracingContext(executionContext, async () => { console.log(`[TOOL EXECUTION PATH 1] Inside withTracingContext for tool: ${toolName}`); + const apiKeyFromState = (state.context as any)?.apiKey; return await selectedTool.execute(toolArgs as any, { + apiKey: apiKeyFromState, provider: this.provider, model: this.modelName, miniModel: this.miniModel, diff --git a/front_end/panels/ai_chat/core/AgentService.ts b/front_end/panels/ai_chat/core/AgentService.ts index f9d775204a..cc742e7d01 100644 --- a/front_end/panels/ai_chat/core/AgentService.ts +++ b/front_end/panels/ai_chat/core/AgentService.ts @@ -197,6 +197,10 @@ export class AgentService extends Common.ObjectWrapper.ObjectWrapper<{ // Will throw error if model/provider configuration is invalid this.#graph = createAgentGraph(apiKey, modelName, selectedProvider, miniModel, nanoModel); + // Stash apiKey in state context for downstream tools that need it + if (!this.#state.context) { (this.#state as any).context = {}; } + (this.#state.context as any).apiKey = apiKey || ''; + this.#isInitialized = true; } catch (error) { logger.error('Failed to initialize agent:', error); @@ -389,6 +393,9 @@ export class AgentService extends Common.ObjectWrapper.ObjectWrapper<{ currentPageTitle, }; + // Inject API key into context for tool execution paths (ConfigurableAgentTool) + try { (state as any).context.apiKey = this.#apiKey || ''; } catch {} + console.warn('Going to invoke graph', { traceId, sessionId: this.#sessionId, diff --git a/front_end/panels/ai_chat/core/ToolNameMap.ts b/front_end/panels/ai_chat/core/ToolNameMap.ts new file mode 100644 index 0000000000..4a26083937 --- /dev/null +++ b/front_end/panels/ai_chat/core/ToolNameMap.ts @@ -0,0 +1,65 @@ +// Copyright 2025 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// A small, dependency-free utility that maintains a global mapping between +// original tool identifiers (e.g. "mcp:default:alpha") and provider-compliant +// function names (^[a-zA-Z0-9_-]{1,64}$). This avoids import cycles between +// AgentNodes and MCPRegistry. + +const originalToSanitized = new Map(); +const sanitizedToOriginal = new Map(); + +function sanitize(original: string): string { + let name = original.replace(/[^a-zA-Z0-9_-]/g, '_'); + if (!name) name = 'tool'; + if (name.length > 64) name = name.slice(0, 64); + return name; +} + +function shortHash(input: string): string { + let h = 0; + for (let i = 0; i < input.length; i++) { + h = ((h << 5) - h) + input.charCodeAt(i); + h |= 0; + } + const hex = (h >>> 0).toString(16); + return hex.slice(-6).padStart(6, '0'); +} + +export function clear(): void { + originalToSanitized.clear(); + sanitizedToOriginal.clear(); +} + +export function addMapping(original: string): string { + const existing = originalToSanitized.get(original); + if (existing) return existing; + + let candidate = sanitize(original); + if (sanitizedToOriginal.has(candidate) && sanitizedToOriginal.get(candidate) !== original) { + const suffix = shortHash(original); + const base = candidate.replace(/_+$/g, ''); + const maxBase = Math.max(1, 64 - 1 - suffix.length); + candidate = (base.length > maxBase ? base.slice(0, maxBase) : base) + '-' + suffix; + } + let unique = candidate; + let counter = 1; + while (sanitizedToOriginal.has(unique) && sanitizedToOriginal.get(unique) !== original) { + const add = `_${counter++}`; + const maxBase = Math.max(1, 64 - add.length); + unique = (candidate.length > maxBase ? candidate.slice(0, maxBase) : candidate) + add; + } + originalToSanitized.set(original, unique); + sanitizedToOriginal.set(unique, original); + return unique; +} + +export function getSanitized(original: string): string { + return addMapping(original); +} + +export function resolveOriginal(sanitized: string): string | undefined { + return sanitizedToOriginal.get(sanitized); +} + diff --git a/front_end/panels/ai_chat/core/ToolNameMapping.test.ts b/front_end/panels/ai_chat/core/ToolNameMapping.test.ts index 5786f08faa..7b835d16ce 100644 --- a/front_end/panels/ai_chat/core/ToolNameMapping.test.ts +++ b/front_end/panels/ai_chat/core/ToolNameMapping.test.ts @@ -2,10 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import { createToolExecutorNode } from './AgentNodes.js'; +import { createAgentNode, createToolExecutorNode } from './AgentNodes.js'; import type { AgentState } from './State.js'; import type { Tool } from '../tools/Tools.js'; import { ChatMessageEntity } from '../models/ChatTypes.js'; +import { ToolSurfaceProvider } from './ToolSurfaceProvider.js'; +import '../agent_framework/ConfigurableAgentTool.js'; +import { LLMClient } from '../LLM/LLMClient.js'; /* eslint-env mocha */ @@ -41,41 +44,41 @@ describe('AgentNodes sanitized tool name mapping', () => { mockLocalStorage.clear(); }); - it('resolves sanitized model tool names back to actual tool instances for execution', async () => { - // Original tool name contains invalid chars for LLM function calling + it('sanitizes function names for LLM and maps back to original tool for execution', async () => { + // Arrange tool and stubs const originalName = 'mcp:default:alpha'; - const sanitizedName = 'mcp_default_alpha'; const tool = new RecordingTool(originalName); - const state: AgentState = { - messages: [ - { - entity: ChatMessageEntity.MODEL, - action: 'tool', - toolName: sanitizedName, - toolArgs: { x: 1 }, - toolCallId: 'call-1', - isFinalAnswer: false, - } as any - ], + const originalSelect = ToolSurfaceProvider.select; + (ToolSurfaceProvider as any).select = async () => ({ tools: [tool], selectedNames: [tool.name] }); + + let capturedFnName = ''; + const originalGetInstance = (LLMClient as any).getInstance; + (LLMClient as any).getInstance = () => ({ + call: async (opts: any) => { + capturedFnName = opts.tools?.[0]?.function?.name || ''; + return { rawResponse: {} }; + }, + parseResponse: () => ({ type: 'tool_call', name: capturedFnName, args: { x: 1 } }), + }); + + const initial: AgentState = { + messages: [ { entity: ChatMessageEntity.USER, text: 'go' } as any ], agentType: 'deep-research' as any, - context: { - selectedToolNames: [sanitizedName], - selectedTools: [tool], - toolNameMap: { [sanitizedName]: originalName } - } + context: {}, } as any; - const node = createToolExecutorNode(state, 'openai', 'gpt-4', 'gpt-4-mini', 'gpt-4-mini'); - const result = await node.invoke(state); - - // Tool execute should have been called once - assert.strictEqual(tool.calls, 1); - - // Should append a tool result message - const last = result.messages[result.messages.length - 1]; - assert.strictEqual(last.entity, ChatMessageEntity.TOOL_RESULT); - assert.strictEqual((last as any).toolName, sanitizedName); - assert.ok((last as any).resultText); + try { + // Agent node should produce a MODEL tool message with original name even if provider returns sanitized + const agent = createAgentNode('gpt-4', 'openai' as any, 0); + const afterAgent = await agent.invoke(initial); + const toolMsg = afterAgent.messages[afterAgent.messages.length - 1] as any; + assert.strictEqual(toolMsg.entity, ChatMessageEntity.MODEL); + assert.strictEqual(toolMsg.action, 'tool'); + assert.strictEqual(toolMsg.toolName, originalName); + } finally { + (ToolSurfaceProvider as any).select = originalSelect; + (LLMClient as any).getInstance = originalGetInstance; + } }); }); diff --git a/front_end/panels/ai_chat/core/__tests__/AgentNodesSanitize.test.ts b/front_end/panels/ai_chat/core/__tests__/AgentNodesSanitize.test.ts new file mode 100644 index 0000000000..b0ecb3cabf --- /dev/null +++ b/front_end/panels/ai_chat/core/__tests__/AgentNodesSanitize.test.ts @@ -0,0 +1,80 @@ +// Copyright 2025 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import { createAgentNode } from '../AgentNodes.js'; +import type { AgentState } from '../State.js'; +import { ChatMessageEntity } from '../../models/ChatTypes.js'; +import { ToolSurfaceProvider } from '../ToolSurfaceProvider.js'; +import { LLMClient } from '../../LLM/LLMClient.js'; +import '../../agent_framework/ConfigurableAgentTool.js'; + +describe('AgentNodes - LLM tool name sanitization', () => { + const ORIGINAL_NAME = 'mcp:default:alpha.tool'; + let originalSelect: typeof ToolSurfaceProvider.select; + let originalGetInstance: any; + + beforeEach(() => { + // Stub ToolSurfaceProvider.select to surface our invalid tool name + originalSelect = ToolSurfaceProvider.select; + (ToolSurfaceProvider as any).select = async (_state: AgentState, _baseTools: any[]) => { + const tool = { + name: ORIGINAL_NAME, + description: 'alpha tool', + schema: { type: 'object', properties: {} }, + execute: async () => ({ ok: true }), + }; + return { tools: [tool], selectedNames: [tool.name] }; + }; + + // Stub LLMClient + originalGetInstance = (LLMClient as any).getInstance; + }); + + afterEach(() => { + // Restore stubs + (ToolSurfaceProvider as any).select = originalSelect; + (LLMClient as any).getInstance = originalGetInstance; + }); + + it('uses sanitized function names in llm.call, and maps back to original for execution', async () => { + let capturedTools: any[] = []; + // The model will request the first tool in parsed response using the sanitized name we expect + let sanitizedSeenInCall = ''; + + (LLMClient as any).getInstance = () => ({ + call: async (opts: any) => { + capturedTools = (opts.tools || []) as any[]; + // Capture the sanitized name the agent sent to the provider + const fn = (capturedTools[0] as any)?.function?.name as string; + sanitizedSeenInCall = fn; + // Return a minimal rawResponse + return { rawResponse: { usage: {} } }; + }, + parseResponse: (_resp: any) => { + // Echo back a tool_call using the same function name seen by provider + return { type: 'tool_call', name: sanitizedSeenInCall, args: { q: 1 } }; + }, + }); + + const state: AgentState = { + messages: [ { entity: ChatMessageEntity.USER, text: 'run' } as any ], + agentType: 'web_task', + context: {}, + } as any; + + const agent = createAgentNode('gpt-4.1-2025-04-14', 'openai' as any, 0); + const out = await agent.invoke(state); + + // Assert: llm.call was given sanitized function name + assert.ok(capturedTools && capturedTools.length === 1, 'tools should be passed'); + const passedName = (capturedTools[0] as any).function.name as string; + assert.match(passedName, /^[a-zA-Z0-9_-]{1,64}$/); + + // Assert: the model message added uses original tool name (mapped back) + const last = out.messages[out.messages.length - 1] as any; + assert.strictEqual(last.entity, ChatMessageEntity.MODEL); + assert.strictEqual(last.action, 'tool'); + assert.strictEqual(last.toolName, ORIGINAL_NAME); + }); +}); diff --git a/front_end/panels/ai_chat/mcp/MCPConfig.ts b/front_end/panels/ai_chat/mcp/MCPConfig.ts index 06f6735c97..8753a7c5e9 100644 --- a/front_end/panels/ai_chat/mcp/MCPConfig.ts +++ b/front_end/panels/ai_chat/mcp/MCPConfig.ts @@ -28,7 +28,7 @@ export function getMCPConfig(): MCPConfigData { try { const enabled = localStorage.getItem(KEYS.enabled) === 'true'; const endpoint = localStorage.getItem(KEYS.endpoint) || undefined; - const token = localStorage.getItem(KEYS.token) || undefined; + const token = sessionStorage.getItem(KEYS.token) || undefined; let toolAllowlist: string[] | undefined; const raw = localStorage.getItem(KEYS.allowlist); if (raw) { @@ -52,7 +52,15 @@ export function setMCPConfig(config: MCPConfigData): void { localStorage.setItem(KEYS.endpoint, config.endpoint); } if (config.token !== undefined) { - localStorage.setItem(KEYS.token, config.token); + try { + if (config.token) { + sessionStorage.setItem(KEYS.token, config.token); + } else { + sessionStorage.removeItem(KEYS.token); + } + } catch (e) { + logger.error('Failed to persist MCP token to sessionStorage', e); + } } if (config.toolAllowlist) { localStorage.setItem(KEYS.allowlist, JSON.stringify(config.toolAllowlist)); diff --git a/front_end/panels/ai_chat/mcp/MCPRegistry.ts b/front_end/panels/ai_chat/mcp/MCPRegistry.ts index 9fbeeb0c75..d095f754b4 100644 --- a/front_end/panels/ai_chat/mcp/MCPRegistry.ts +++ b/front_end/panels/ai_chat/mcp/MCPRegistry.ts @@ -1,5 +1,6 @@ import { createLogger } from '../core/Logger.js'; import { ToolRegistry } from '../agent_framework/ConfigurableAgentTool.js'; +import * as ToolNameMap from '../core/ToolNameMap.js'; import type { MCPToolDef, MCPServer } from '../../../third_party/mcp-sdk/mcp-sdk.js'; import { MCPClient } from '../../../third_party/mcp-sdk/mcp-sdk.js'; import { getMCPConfig } from './MCPConfig.js'; @@ -57,6 +58,8 @@ class RegistryImpl { this.registeredTools = []; this.lastError = undefined; this.lastErrorType = undefined; + // Reset mappings on reconnect + ToolNameMap.clear(); if (!cfg.enabled) { logger.info('MCP disabled'); @@ -110,6 +113,8 @@ class RegistryImpl { for (const def of tools) { const namespaced = `mcp:${srv.id}:${def.name}`; + // Create or reuse a stable sanitized mapping for LLM function names + ToolNameMap.addMapping(namespaced); if (allow.size > 0 && !allow.has(namespaced) && !allow.has(def.name)) { continue; } @@ -148,6 +153,10 @@ class RegistryImpl { lastDisconnected: this.lastDisconnected, }; } + + getSanitizedFunctionName(original: string): string { return ToolNameMap.getSanitized(original); } + + resolveOriginalFunctionName(sanitized: string): string | undefined { return ToolNameMap.resolveOriginal(sanitized); } } export const MCPRegistry = new RegistryImpl(); diff --git a/front_end/panels/ai_chat/mcp/MCPToolAdapter.ts b/front_end/panels/ai_chat/mcp/MCPToolAdapter.ts index bad2b54d5f..5c83debee0 100644 --- a/front_end/panels/ai_chat/mcp/MCPToolAdapter.ts +++ b/front_end/panels/ai_chat/mcp/MCPToolAdapter.ts @@ -31,8 +31,8 @@ export class MCPToolAdapter implements Tool, unknown> { async execute(args: Record): Promise { const sanitized = this.sanitize(args); - logger.info('Executing MCP tool', { name: this.name, serverId: this.serverId }); - return this.client.callTool(this.serverId, this.def.name, sanitized, { timeoutMs: 30000 }); + logger.info('Executing MCP tool', { name: this.name, serverId: this.serverId, args: sanitized }); + return this.client.callTool(this.serverId, this.def.name, args, { timeoutMs: 30000 }); } // Expose metadata for discovery/search diff --git a/front_end/panels/ai_chat/tools/Tools.ts b/front_end/panels/ai_chat/tools/Tools.ts index b3b22b3809..bb5f2a7ff3 100644 --- a/front_end/panels/ai_chat/tools/Tools.ts +++ b/front_end/panels/ai_chat/tools/Tools.ts @@ -52,6 +52,7 @@ export interface Tool, TResult = unknown> { * Context passed into tools for LLM-related choices without relying on UI. */ export interface LLMContext { + apiKey?: string; provider: LLMProvider; model: string; getVisionCapability?: (model: string) => Promise | boolean; diff --git a/front_end/panels/ai_chat/ui/SettingsDialog.ts b/front_end/panels/ai_chat/ui/SettingsDialog.ts index b012fb8158..fc0739d252 100644 --- a/front_end/panels/ai_chat/ui/SettingsDialog.ts +++ b/front_end/panels/ai_chat/ui/SettingsDialog.ts @@ -529,17 +529,8 @@ export class SettingsDialog { providerHint.textContent = i18nString(UIStrings.providerHint); providerSection.appendChild(providerHint); - // Determine current provider: prefer the provider for the currently selected model if available - const storedProvider = localStorage.getItem(PROVIDER_SELECTION_KEY) || 'openai'; - let currentProvider = storedProvider as 'openai' | 'litellm' | 'groq' | 'openrouter'; - try { - const selectedModelOption = modelOptions.find(opt => opt.value === selectedModel); - if (selectedModelOption && selectedModelOption.type) { - currentProvider = selectedModelOption.type as 'openai' | 'litellm' | 'groq' | 'openrouter'; - } - } catch (e) { - // Fallback silently to storedProvider - } + // Use the stored provider from localStorage + const currentProvider = (localStorage.getItem(PROVIDER_SELECTION_KEY) || 'openai') as 'openai' | 'litellm' | 'groq' | 'openrouter'; // Create provider selection dropdown const providerSelect = document.createElement('select'); @@ -1423,10 +1414,14 @@ export class SettingsDialog { const defaults = DEFAULT_PROVIDER_MODELS[provider] || DEFAULT_PROVIDER_MODELS.openai; const defaultModel = modelType === 'mini' ? defaults.mini : defaults.nano; - // Return default if it exists in provider models, otherwise return current model - return defaultModel && providerModels.some(model => model.value === defaultModel) - ? defaultModel - : currentModel; + // Return default if it exists in provider models + if (defaultModel && providerModels.some(model => model.value === defaultModel)) { + return defaultModel; + } + + // If no valid model found, return empty string to indicate no selection + // The UI should handle this by showing a placeholder or the first available option + return ''; } // Function to update Groq model selectors @@ -2568,22 +2563,21 @@ export class SettingsDialog { return date.toLocaleString(); }; - const formatMCPError = (error: string, errorType?: string): string => { - if (!errorType) return error; - + const formatMCPError = (error: string, errorType?: string): {message: string, hint?: string} => { + if (!errorType) return {message: error}; switch (errorType) { case 'connection': - return `Connection failed: ${error}
Check if the MCP server is running and the endpoint URL is correct.`; + return {message: `Connection failed: ${error}`, hint: 'Check if the MCP server is running and the endpoint URL is correct.'}; case 'authentication': - return `Authentication failed: ${error}
Verify your auth token is correct and has not expired.`; + return {message: `Authentication failed: ${error}`, hint: 'Verify your auth token is correct and has not expired.'}; case 'configuration': - return `Configuration error: ${error}
Check your endpoint URL format (should be ws:// or wss://).`; + return {message: `Configuration error: ${error}`, hint: 'Check your endpoint URL format (should be ws:// or wss://).'}; case 'network': - return `Network error: ${error}
Check your internet connection and firewall settings.`; + return {message: `Network error: ${error}`, hint: 'Check your internet connection and firewall settings.'}; case 'server_error': - return `Server error: ${error}
The MCP server encountered an internal error. Contact the server administrator.`; + return {message: `Server error: ${error}`, hint: 'The MCP server encountered an internal error. Contact the server administrator.'}; default: - return error; + return {message: error}; } }; @@ -2593,7 +2587,7 @@ export class SettingsDialog { mcpStatusDot.style.backgroundColor = 'var(--color-text-disabled)'; mcpStatusText.textContent = 'Disabled'; mcpStatusText.style.color = 'var(--color-text-disabled)'; - mcpStatusDetails.innerHTML = ''; + mcpStatusDetails.textContent = ''; return; } const anyConnected = status.servers.some(s => s.connected); @@ -2603,27 +2597,57 @@ export class SettingsDialog { mcpStatusText.textContent = `Connected (${toolCount} tools)`; mcpStatusText.style.color = 'var(--color-accent-green)'; - let detailsHtml = ''; + // Safely build details content without using innerHTML + mcpStatusDetails.textContent = ''; if (status.lastConnected) { - detailsHtml += `Last connected: ${formatTimestamp(status.lastConnected)}
`; + const line = document.createElement('div'); + line.textContent = `Last connected: ${formatTimestamp(status.lastConnected)}`; + mcpStatusDetails.appendChild(line); } if (status.lastError) { - detailsHtml += `${formatMCPError(status.lastError, status.lastErrorType)}`; + const {message, hint} = formatMCPError(status.lastError, status.lastErrorType); + const errLine = document.createElement('div'); + const errSpan = document.createElement('span'); + errSpan.style.color = 'var(--color-error-text)'; + errSpan.textContent = message; + errLine.appendChild(errSpan); + mcpStatusDetails.appendChild(errLine); + if (hint) { + const hintLine = document.createElement('div'); + hintLine.style.color = 'var(--color-text-secondary)'; + hintLine.style.fontSize = '12px'; + hintLine.textContent = hint; + mcpStatusDetails.appendChild(hintLine); + } } - mcpStatusDetails.innerHTML = detailsHtml; } else { mcpStatusDot.style.backgroundColor = 'var(--color-text-disabled)'; mcpStatusText.textContent = 'Not connected'; mcpStatusText.style.color = 'var(--color-text-disabled)'; - let detailsHtml = ''; + // Safely build details content without using innerHTML + mcpStatusDetails.textContent = ''; if (status.lastDisconnected) { - detailsHtml += `Last disconnected: ${formatTimestamp(status.lastDisconnected)}
`; + const line = document.createElement('div'); + line.textContent = `Last disconnected: ${formatTimestamp(status.lastDisconnected)}`; + mcpStatusDetails.appendChild(line); } if (status.lastError) { - detailsHtml += `${formatMCPError(status.lastError, status.lastErrorType)}`; + const {message, hint} = formatMCPError(status.lastError, status.lastErrorType); + const errLine = document.createElement('div'); + const errSpan = document.createElement('span'); + errSpan.style.color = 'var(--color-error-text)'; + errSpan.textContent = message; + errLine.appendChild(errSpan); + mcpStatusDetails.appendChild(errLine); + if (hint) { + const hintLine = document.createElement('div'); + hintLine.style.color = 'var(--color-text-secondary)'; + hintLine.style.fontSize = '12px'; + hintLine.textContent = hint; + mcpStatusDetails.appendChild(hintLine); + } } - mcpStatusDetails.innerHTML = detailsHtml; } }; updateMCPStatus(); From cdd9df9db04332a972f96eee242c9d575e0e2b40 Mon Sep 17 00:00:00 2001 From: Tyson Thomas Date: Sat, 13 Sep 2025 08:07:39 -0700 Subject: [PATCH 7/7] fix typo --- front_end/panels/ai_chat/ui/HelpDialog.ts | 2 +- front_end/panels/ai_chat/ui/SettingsDialog.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/front_end/panels/ai_chat/ui/HelpDialog.ts b/front_end/panels/ai_chat/ui/HelpDialog.ts index 8ae246d106..05f2b11ac6 100644 --- a/front_end/panels/ai_chat/ui/HelpDialog.ts +++ b/front_end/panels/ai_chat/ui/HelpDialog.ts @@ -37,7 +37,7 @@ const UIStrings = { /** *@description Beta version warning */ - betaVersionWarning: 'Beta Version: This is an beta version of the Browser Operator - AI Assistant feature. Do not use it for production or sensitive data.', + betaVersionWarning: 'Beta Version: This is a beta version of the Browser Operator - AI Assistant feature. Do not use it for production or sensitive data.', /** *@description Data sharing notice */ diff --git a/front_end/panels/ai_chat/ui/SettingsDialog.ts b/front_end/panels/ai_chat/ui/SettingsDialog.ts index fc0739d252..04f1a28451 100644 --- a/front_end/panels/ai_chat/ui/SettingsDialog.ts +++ b/front_end/panels/ai_chat/ui/SettingsDialog.ts @@ -3070,7 +3070,7 @@ export class SettingsDialog { disclaimerText.classList.add('settings-disclaimer'); disclaimerText.innerHTML = `

- Beta Version: This is an beta version of the Browser Operator - AI Assistant feature. + Beta Version: This is a beta version of the Browser Operator - AI Assistant feature.

Data Sharing: When using this feature, your browser data and conversation content will be sent to the AI model for processing.