@weavelogic/knowledge-graph-agent 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +686 -304
- package/dist/_virtual/_commonjsHelpers.js +7 -0
- package/dist/_virtual/_commonjsHelpers.js.map +1 -0
- package/dist/_virtual/additionalItems.js +5 -0
- package/dist/_virtual/additionalItems.js.map +1 -0
- package/dist/_virtual/additionalProperties.js +5 -0
- package/dist/_virtual/additionalProperties.js.map +1 -0
- package/dist/_virtual/ajv.js +6 -0
- package/dist/_virtual/ajv.js.map +1 -0
- package/dist/_virtual/ajv2.js +5 -0
- package/dist/_virtual/ajv2.js.map +1 -0
- package/dist/_virtual/allOf.js +5 -0
- package/dist/_virtual/allOf.js.map +1 -0
- package/dist/_virtual/anyOf.js +5 -0
- package/dist/_virtual/anyOf.js.map +1 -0
- package/dist/_virtual/applicability.js +5 -0
- package/dist/_virtual/applicability.js.map +1 -0
- package/dist/_virtual/boolSchema.js +5 -0
- package/dist/_virtual/boolSchema.js.map +1 -0
- package/dist/_virtual/code.js +5 -0
- package/dist/_virtual/code.js.map +1 -0
- package/dist/_virtual/code2.js +5 -0
- package/dist/_virtual/code2.js.map +1 -0
- package/dist/_virtual/const.js +5 -0
- package/dist/_virtual/const.js.map +1 -0
- package/dist/_virtual/contains.js +5 -0
- package/dist/_virtual/contains.js.map +1 -0
- package/dist/_virtual/core.js +5 -0
- package/dist/_virtual/core.js.map +1 -0
- package/dist/_virtual/dataType.js +5 -0
- package/dist/_virtual/dataType.js.map +1 -0
- package/dist/_virtual/defaults.js +5 -0
- package/dist/_virtual/defaults.js.map +1 -0
- package/dist/_virtual/dependencies.js +5 -0
- package/dist/_virtual/dependencies.js.map +1 -0
- package/dist/_virtual/draft7.js +5 -0
- package/dist/_virtual/draft7.js.map +1 -0
- package/dist/_virtual/enum.js +5 -0
- package/dist/_virtual/enum.js.map +1 -0
- package/dist/_virtual/equal.js +5 -0
- package/dist/_virtual/equal.js.map +1 -0
- package/dist/_virtual/errors.js +5 -0
- package/dist/_virtual/errors.js.map +1 -0
- package/dist/_virtual/format.js +5 -0
- package/dist/_virtual/format.js.map +1 -0
- package/dist/_virtual/formats.js +5 -0
- package/dist/_virtual/formats.js.map +1 -0
- package/dist/_virtual/id.js +5 -0
- package/dist/_virtual/id.js.map +1 -0
- package/dist/_virtual/if.js +5 -0
- package/dist/_virtual/if.js.map +1 -0
- package/dist/_virtual/index.js +8 -0
- package/dist/_virtual/index.js.map +1 -0
- package/dist/_virtual/index10.js +5 -0
- package/dist/_virtual/index10.js.map +1 -0
- package/dist/_virtual/index11.js +5 -0
- package/dist/_virtual/index11.js.map +1 -0
- package/dist/_virtual/index12.js +5 -0
- package/dist/_virtual/index12.js.map +1 -0
- package/dist/_virtual/index2.js +5 -0
- package/dist/_virtual/index2.js.map +1 -0
- package/dist/_virtual/index3.js +5 -0
- package/dist/_virtual/index3.js.map +1 -0
- package/dist/_virtual/index4.js +5 -0
- package/dist/_virtual/index4.js.map +1 -0
- package/dist/_virtual/index5.js +5 -0
- package/dist/_virtual/index5.js.map +1 -0
- package/dist/_virtual/index6.js +5 -0
- package/dist/_virtual/index6.js.map +1 -0
- package/dist/_virtual/index7.js +5 -0
- package/dist/_virtual/index7.js.map +1 -0
- package/dist/_virtual/index8.js +5 -0
- package/dist/_virtual/index8.js.map +1 -0
- package/dist/_virtual/index9.js +5 -0
- package/dist/_virtual/index9.js.map +1 -0
- package/dist/_virtual/items.js +5 -0
- package/dist/_virtual/items.js.map +1 -0
- package/dist/_virtual/items2020.js +5 -0
- package/dist/_virtual/items2020.js.map +1 -0
- package/dist/_virtual/keyword.js +5 -0
- package/dist/_virtual/keyword.js.map +1 -0
- package/dist/_virtual/limit.js +5 -0
- package/dist/_virtual/limit.js.map +1 -0
- package/dist/_virtual/limitItems.js +5 -0
- package/dist/_virtual/limitItems.js.map +1 -0
- package/dist/_virtual/limitLength.js +5 -0
- package/dist/_virtual/limitLength.js.map +1 -0
- package/dist/_virtual/limitNumber.js +5 -0
- package/dist/_virtual/limitNumber.js.map +1 -0
- package/dist/_virtual/limitProperties.js +5 -0
- package/dist/_virtual/limitProperties.js.map +1 -0
- package/dist/_virtual/metadata.js +5 -0
- package/dist/_virtual/metadata.js.map +1 -0
- package/dist/_virtual/multipleOf.js +5 -0
- package/dist/_virtual/multipleOf.js.map +1 -0
- package/dist/_virtual/names.js +5 -0
- package/dist/_virtual/names.js.map +1 -0
- package/dist/_virtual/not.js +5 -0
- package/dist/_virtual/not.js.map +1 -0
- package/dist/_virtual/oneOf.js +5 -0
- package/dist/_virtual/oneOf.js.map +1 -0
- package/dist/_virtual/pattern.js +5 -0
- package/dist/_virtual/pattern.js.map +1 -0
- package/dist/_virtual/patternProperties.js +5 -0
- package/dist/_virtual/patternProperties.js.map +1 -0
- package/dist/_virtual/prefixItems.js +5 -0
- package/dist/_virtual/prefixItems.js.map +1 -0
- package/dist/_virtual/properties.js +5 -0
- package/dist/_virtual/properties.js.map +1 -0
- package/dist/_virtual/propertyNames.js +5 -0
- package/dist/_virtual/propertyNames.js.map +1 -0
- package/dist/_virtual/ref.js +5 -0
- package/dist/_virtual/ref.js.map +1 -0
- package/dist/_virtual/ref_error.js +5 -0
- package/dist/_virtual/ref_error.js.map +1 -0
- package/dist/_virtual/required.js +5 -0
- package/dist/_virtual/required.js.map +1 -0
- package/dist/_virtual/resolve.js +5 -0
- package/dist/_virtual/resolve.js.map +1 -0
- package/dist/_virtual/rules.js +5 -0
- package/dist/_virtual/rules.js.map +1 -0
- package/dist/_virtual/scope.js +5 -0
- package/dist/_virtual/scope.js.map +1 -0
- package/dist/_virtual/subschema.js +5 -0
- package/dist/_virtual/subschema.js.map +1 -0
- package/dist/_virtual/thenElse.js +5 -0
- package/dist/_virtual/thenElse.js.map +1 -0
- package/dist/_virtual/types.js +5 -0
- package/dist/_virtual/types.js.map +1 -0
- package/dist/_virtual/ucs2length.js +5 -0
- package/dist/_virtual/ucs2length.js.map +1 -0
- package/dist/_virtual/uniqueItems.js +5 -0
- package/dist/_virtual/uniqueItems.js.map +1 -0
- package/dist/_virtual/uri.js +5 -0
- package/dist/_virtual/uri.js.map +1 -0
- package/dist/_virtual/util.js +5 -0
- package/dist/_virtual/util.js.map +1 -0
- package/dist/_virtual/validation_error.js +5 -0
- package/dist/_virtual/validation_error.js.map +1 -0
- package/dist/agents/analyst-agent.d.ts +230 -0
- package/dist/agents/analyst-agent.d.ts.map +1 -0
- package/dist/agents/analyst-agent.js +793 -0
- package/dist/agents/analyst-agent.js.map +1 -0
- package/dist/agents/architect-agent.d.ts +248 -0
- package/dist/agents/architect-agent.d.ts.map +1 -0
- package/dist/agents/architect-agent.js +685 -0
- package/dist/agents/architect-agent.js.map +1 -0
- package/dist/agents/base-agent.d.ts +169 -0
- package/dist/agents/base-agent.d.ts.map +1 -0
- package/dist/agents/base-agent.js +441 -0
- package/dist/agents/base-agent.js.map +1 -0
- package/dist/agents/coder-agent.d.ts +191 -0
- package/dist/agents/coder-agent.d.ts.map +1 -0
- package/dist/agents/coder-agent.js +1008 -0
- package/dist/agents/coder-agent.js.map +1 -0
- package/dist/agents/index.d.ts +18 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/index.js +40 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/registry.d.ts +213 -0
- package/dist/agents/registry.d.ts.map +1 -0
- package/dist/agents/registry.js +419 -0
- package/dist/agents/registry.js.map +1 -0
- package/dist/agents/researcher-agent.d.ts +226 -0
- package/dist/agents/researcher-agent.d.ts.map +1 -0
- package/dist/agents/researcher-agent.js +572 -0
- package/dist/agents/researcher-agent.js.map +1 -0
- package/dist/agents/rules-engine.d.ts +320 -0
- package/dist/agents/rules-engine.d.ts.map +1 -0
- package/dist/agents/rules-engine.js +552 -0
- package/dist/agents/rules-engine.js.map +1 -0
- package/dist/agents/tester-agent.d.ts +219 -0
- package/dist/agents/tester-agent.d.ts.map +1 -0
- package/dist/agents/tester-agent.js +683 -0
- package/dist/agents/tester-agent.js.map +1 -0
- package/dist/agents/types.d.ts +425 -0
- package/dist/agents/types.d.ts.map +1 -0
- package/dist/agents/types.js +57 -0
- package/dist/agents/types.js.map +1 -0
- package/dist/caching/index.d.ts +55 -0
- package/dist/caching/index.d.ts.map +1 -0
- package/dist/caching/index.js +206 -0
- package/dist/caching/index.js.map +1 -0
- package/dist/caching/lru-cache.d.ts +254 -0
- package/dist/caching/lru-cache.d.ts.map +1 -0
- package/dist/caching/types.d.ts +95 -0
- package/dist/caching/types.d.ts.map +1 -0
- package/dist/chunking/chunker.d.ts +94 -0
- package/dist/chunking/chunker.d.ts.map +1 -0
- package/dist/chunking/index.d.ts +125 -0
- package/dist/chunking/index.d.ts.map +1 -0
- package/dist/chunking/index.js +283 -0
- package/dist/chunking/index.js.map +1 -0
- package/dist/chunking/types.d.ts +92 -0
- package/dist/chunking/types.d.ts.map +1 -0
- package/dist/cli/commands/commit.d.ts +11 -0
- package/dist/cli/commands/commit.d.ts.map +1 -0
- package/dist/cli/commands/commit.js +379 -0
- package/dist/cli/commands/commit.js.map +1 -0
- package/dist/cli/commands/config.d.ts +8 -0
- package/dist/cli/commands/config.d.ts.map +1 -0
- package/dist/cli/commands/config.js +107 -0
- package/dist/cli/commands/config.js.map +1 -0
- package/dist/cli/commands/cultivate.d.ts +16 -0
- package/dist/cli/commands/cultivate.d.ts.map +1 -0
- package/dist/cli/commands/cultivate.js +254 -0
- package/dist/cli/commands/cultivate.js.map +1 -0
- package/dist/cli/commands/diagnostics.d.ts +8 -0
- package/dist/cli/commands/diagnostics.d.ts.map +1 -0
- package/dist/cli/commands/diagnostics.js +140 -0
- package/dist/cli/commands/diagnostics.js.map +1 -0
- package/dist/cli/commands/generate.d.ts +13 -0
- package/dist/cli/commands/generate.d.ts.map +1 -0
- package/dist/cli/commands/init-primitives.d.ts +19 -0
- package/dist/cli/commands/init-primitives.d.ts.map +1 -0
- package/dist/cli/commands/init-primitives.js +208 -0
- package/dist/cli/commands/init-primitives.js.map +1 -0
- package/dist/cli/commands/sop.d.ts +14 -0
- package/dist/cli/commands/sop.d.ts.map +1 -0
- package/dist/cli/commands/sop.js +598 -0
- package/dist/cli/commands/sop.js.map +1 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +40 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/config/index.d.ts +153 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +141 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/manager.d.ts +136 -0
- package/dist/config/manager.d.ts.map +1 -0
- package/dist/config/types.d.ts +127 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/core/cache.d.ts +185 -0
- package/dist/core/cache.d.ts.map +1 -0
- package/dist/core/cache.js +435 -0
- package/dist/core/cache.js.map +1 -0
- package/dist/cultivation/deep-analyzer.d.ts +129 -0
- package/dist/cultivation/deep-analyzer.d.ts.map +1 -0
- package/dist/cultivation/deep-analyzer.js +322 -0
- package/dist/cultivation/deep-analyzer.js.map +1 -0
- package/dist/cultivation/index.d.ts +13 -0
- package/dist/cultivation/index.d.ts.map +1 -0
- package/dist/cultivation/seed-generator.d.ts +92 -0
- package/dist/cultivation/seed-generator.d.ts.map +1 -0
- package/dist/cultivation/seed-generator.js +1033 -0
- package/dist/cultivation/seed-generator.js.map +1 -0
- package/dist/cultivation/types.d.ts +230 -0
- package/dist/cultivation/types.d.ts.map +1 -0
- package/dist/generators/claude-md.d.ts +7 -0
- package/dist/generators/claude-md.d.ts.map +1 -1
- package/dist/generators/claude-md.js.map +1 -1
- package/dist/generators/docs-init.d.ts +6 -0
- package/dist/generators/docs-init.d.ts.map +1 -1
- package/dist/generators/docs-init.js.map +1 -1
- package/dist/health/checks.d.ts +135 -0
- package/dist/health/checks.d.ts.map +1 -0
- package/dist/health/index.d.ts +119 -0
- package/dist/health/index.d.ts.map +1 -0
- package/dist/health/index.js +191 -0
- package/dist/health/index.js.map +1 -0
- package/dist/health/monitor.d.ts +146 -0
- package/dist/health/monitor.d.ts.map +1 -0
- package/dist/health/types.d.ts +135 -0
- package/dist/health/types.d.ts.map +1 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +173 -1
- package/dist/index.js.map +1 -1
- package/dist/integrations/auto-commit.d.ts +175 -0
- package/dist/integrations/auto-commit.d.ts.map +1 -0
- package/dist/integrations/auto-commit.js +399 -0
- package/dist/integrations/auto-commit.js.map +1 -0
- package/dist/integrations/git.d.ts +299 -0
- package/dist/integrations/git.d.ts.map +1 -0
- package/dist/integrations/git.js +465 -0
- package/dist/integrations/git.js.map +1 -0
- package/dist/mcp-server/bin.d.ts +11 -0
- package/dist/mcp-server/bin.d.ts.map +1 -0
- package/dist/mcp-server/handlers/index.d.ts +57 -0
- package/dist/mcp-server/handlers/index.d.ts.map +1 -0
- package/dist/mcp-server/handlers/index.js +235 -0
- package/dist/mcp-server/handlers/index.js.map +1 -0
- package/dist/mcp-server/index.d.ts +28 -0
- package/dist/mcp-server/index.d.ts.map +1 -0
- package/dist/mcp-server/server.d.ts +133 -0
- package/dist/mcp-server/server.d.ts.map +1 -0
- package/dist/mcp-server/server.js +280 -0
- package/dist/mcp-server/server.js.map +1 -0
- package/dist/mcp-server/tools/agents/index.d.ts +10 -0
- package/dist/mcp-server/tools/agents/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/agents/list.d.ts +19 -0
- package/dist/mcp-server/tools/agents/list.d.ts.map +1 -0
- package/dist/mcp-server/tools/agents/spawn.d.ts +19 -0
- package/dist/mcp-server/tools/agents/spawn.d.ts.map +1 -0
- package/dist/mcp-server/tools/graph/generate.d.ts +21 -0
- package/dist/mcp-server/tools/graph/generate.d.ts.map +1 -0
- package/dist/mcp-server/tools/graph/index.d.ts +11 -0
- package/dist/mcp-server/tools/graph/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/graph/query.d.ts +22 -0
- package/dist/mcp-server/tools/graph/query.d.ts.map +1 -0
- package/dist/mcp-server/tools/graph/stats.d.ts +22 -0
- package/dist/mcp-server/tools/graph/stats.d.ts.map +1 -0
- package/dist/mcp-server/tools/health.d.ts +21 -0
- package/dist/mcp-server/tools/health.d.ts.map +1 -0
- package/dist/mcp-server/tools/index.d.ts +13 -0
- package/dist/mcp-server/tools/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/registry.d.ts +90 -0
- package/dist/mcp-server/tools/registry.d.ts.map +1 -0
- package/dist/mcp-server/tools/registry.js +663 -0
- package/dist/mcp-server/tools/registry.js.map +1 -0
- package/dist/mcp-server/tools/search/index.d.ts +10 -0
- package/dist/mcp-server/tools/search/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/search/nodes.d.ts +22 -0
- package/dist/mcp-server/tools/search/nodes.d.ts.map +1 -0
- package/dist/mcp-server/tools/search/tags.d.ts +22 -0
- package/dist/mcp-server/tools/search/tags.d.ts.map +1 -0
- package/dist/mcp-server/types/index.d.ts +286 -0
- package/dist/mcp-server/types/index.d.ts.map +1 -0
- package/dist/memory/index.d.ts +10 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/vault-sync.d.ts +212 -0
- package/dist/memory/vault-sync.d.ts.map +1 -0
- package/dist/memory/vault-sync.js +463 -0
- package/dist/memory/vault-sync.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js +296 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js +71 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js +26 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js +407 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js +1332 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js.map +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js +71 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js.map +1 -0
- package/dist/node_modules/ajv/dist/ajv.js +84 -0
- package/dist/node_modules/ajv/dist/ajv.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/codegen/code.js +160 -0
- package/dist/node_modules/ajv/dist/compile/codegen/code.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/codegen/index.js +728 -0
- package/dist/node_modules/ajv/dist/compile/codegen/index.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/codegen/scope.js +152 -0
- package/dist/node_modules/ajv/dist/compile/codegen/scope.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/errors.js +131 -0
- package/dist/node_modules/ajv/dist/compile/errors.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/index.js +234 -0
- package/dist/node_modules/ajv/dist/compile/index.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/names.js +44 -0
- package/dist/node_modules/ajv/dist/compile/names.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/ref_error.js +22 -0
- package/dist/node_modules/ajv/dist/compile/ref_error.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/resolve.js +163 -0
- package/dist/node_modules/ajv/dist/compile/resolve.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/rules.js +35 -0
- package/dist/node_modules/ajv/dist/compile/rules.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/util.js +173 -0
- package/dist/node_modules/ajv/dist/compile/util.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/validate/applicability.js +27 -0
- package/dist/node_modules/ajv/dist/compile/validate/applicability.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/validate/boolSchema.js +58 -0
- package/dist/node_modules/ajv/dist/compile/validate/boolSchema.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/validate/dataType.js +193 -0
- package/dist/node_modules/ajv/dist/compile/validate/dataType.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/validate/defaults.js +43 -0
- package/dist/node_modules/ajv/dist/compile/validate/defaults.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/validate/index.js +522 -0
- package/dist/node_modules/ajv/dist/compile/validate/index.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/validate/keyword.js +126 -0
- package/dist/node_modules/ajv/dist/compile/validate/keyword.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/validate/subschema.js +89 -0
- package/dist/node_modules/ajv/dist/compile/validate/subschema.js.map +1 -0
- package/dist/node_modules/ajv/dist/core.js +628 -0
- package/dist/node_modules/ajv/dist/core.js.map +1 -0
- package/dist/node_modules/ajv/dist/refs/data.json.js +24 -0
- package/dist/node_modules/ajv/dist/refs/data.json.js.map +1 -0
- package/dist/node_modules/ajv/dist/refs/json-schema-draft-07.json.js +25 -0
- package/dist/node_modules/ajv/dist/refs/json-schema-draft-07.json.js.map +1 -0
- package/dist/node_modules/ajv/dist/runtime/equal.js +16 -0
- package/dist/node_modules/ajv/dist/runtime/equal.js.map +1 -0
- package/dist/node_modules/ajv/dist/runtime/ucs2length.js +30 -0
- package/dist/node_modules/ajv/dist/runtime/ucs2length.js.map +1 -0
- package/dist/node_modules/ajv/dist/runtime/uri.js +16 -0
- package/dist/node_modules/ajv/dist/runtime/uri.js.map +1 -0
- package/dist/node_modules/ajv/dist/runtime/validation_error.js +20 -0
- package/dist/node_modules/ajv/dist/runtime/validation_error.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +59 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +114 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/allOf.js +32 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +22 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/contains.js +100 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/contains.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +103 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/if.js +75 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/if.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/index.js +68 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/index.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/items.js +64 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/items.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/items2020.js +43 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/not.js +36 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/not.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +64 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +81 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +22 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/properties.js +66 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +49 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +23 -0
- package/dist/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/code.js +140 -0
- package/dist/node_modules/ajv/dist/vocabularies/code.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/core/id.js +19 -0
- package/dist/node_modules/ajv/dist/vocabularies/core/id.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/core/index.js +27 -0
- package/dist/node_modules/ajv/dist/vocabularies/core/index.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/core/ref.js +132 -0
- package/dist/node_modules/ajv/dist/vocabularies/core/ref.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/discriminator/index.js +114 -0
- package/dist/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/discriminator/types.js +18 -0
- package/dist/node_modules/ajv/dist/vocabularies/discriminator/types.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/draft7.js +31 -0
- package/dist/node_modules/ajv/dist/vocabularies/draft7.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/format/format.js +95 -0
- package/dist/node_modules/ajv/dist/vocabularies/format/format.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/format/index.js +16 -0
- package/dist/node_modules/ajv/dist/vocabularies/format/index.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/metadata.js +27 -0
- package/dist/node_modules/ajv/dist/vocabularies/metadata.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/const.js +36 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/const.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/enum.js +56 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/enum.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/index.js +52 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/index.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitItems.js +34 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitLength.js +39 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +37 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +34 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +33 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/pattern.js +34 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/pattern.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/required.js +89 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/required.js.map +1 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +75 -0
- package/dist/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map +1 -0
- package/dist/node_modules/ajv-formats/dist/formats.js +209 -0
- package/dist/node_modules/ajv-formats/dist/formats.js.map +1 -0
- package/dist/node_modules/ajv-formats/dist/index.js +51 -0
- package/dist/node_modules/ajv-formats/dist/index.js.map +1 -0
- package/dist/node_modules/ajv-formats/dist/limit.js +80 -0
- package/dist/node_modules/ajv-formats/dist/limit.js.map +1 -0
- package/dist/node_modules/fast-deep-equal/index.js +39 -0
- package/dist/node_modules/fast-deep-equal/index.js.map +1 -0
- package/dist/node_modules/fast-uri/index.js +261 -0
- package/dist/node_modules/fast-uri/index.js.map +1 -0
- package/dist/node_modules/fast-uri/lib/schemes.js +215 -0
- package/dist/node_modules/fast-uri/lib/schemes.js.map +1 -0
- package/dist/node_modules/fast-uri/lib/utils.js +261 -0
- package/dist/node_modules/fast-uri/lib/utils.js.map +1 -0
- package/dist/node_modules/json-schema-traverse/index.js +92 -0
- package/dist/node_modules/json-schema-traverse/index.js.map +1 -0
- package/dist/node_modules/zod/v4/classic/errors.js +37 -0
- package/dist/node_modules/zod/v4/classic/errors.js.map +1 -0
- package/dist/node_modules/zod/v4/classic/iso.js +43 -0
- package/dist/node_modules/zod/v4/classic/iso.js.map +1 -0
- package/dist/node_modules/zod/v4/classic/parse.js +13 -0
- package/dist/node_modules/zod/v4/classic/parse.js.map +1 -0
- package/dist/node_modules/zod/v4/classic/schemas.js +688 -0
- package/dist/node_modules/zod/v4/classic/schemas.js.map +1 -0
- package/dist/node_modules/zod/v4/core/api.js +492 -0
- package/dist/node_modules/zod/v4/core/api.js.map +1 -0
- package/dist/node_modules/zod/v4/core/checks.js +405 -0
- package/dist/node_modules/zod/v4/core/checks.js.map +1 -0
- package/dist/node_modules/zod/v4/core/core.js +58 -0
- package/dist/node_modules/zod/v4/core/core.js.map +1 -0
- package/dist/node_modules/zod/v4/core/doc.js +38 -0
- package/dist/node_modules/zod/v4/core/doc.js.map +1 -0
- package/dist/node_modules/zod/v4/core/errors.js +82 -0
- package/dist/node_modules/zod/v4/core/errors.js.map +1 -0
- package/dist/node_modules/zod/v4/core/parse.js +60 -0
- package/dist/node_modules/zod/v4/core/parse.js.map +1 -0
- package/dist/node_modules/zod/v4/core/regexes.js +87 -0
- package/dist/node_modules/zod/v4/core/regexes.js.map +1 -0
- package/dist/node_modules/zod/v4/core/registries.js +52 -0
- package/dist/node_modules/zod/v4/core/registries.js.map +1 -0
- package/dist/node_modules/zod/v4/core/schemas.js +1283 -0
- package/dist/node_modules/zod/v4/core/schemas.js.map +1 -0
- package/dist/node_modules/zod/v4/core/util.js +341 -0
- package/dist/node_modules/zod/v4/core/util.js.map +1 -0
- package/dist/node_modules/zod/v4/core/versions.js +9 -0
- package/dist/node_modules/zod/v4/core/versions.js.map +1 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/string.js +2 -0
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/string.js.map +1 -0
- package/dist/reasoning/index.d.ts +74 -0
- package/dist/reasoning/index.d.ts.map +1 -0
- package/dist/reasoning/index.js +124 -0
- package/dist/reasoning/index.js.map +1 -0
- package/dist/reasoning/tracker.d.ts +210 -0
- package/dist/reasoning/tracker.d.ts.map +1 -0
- package/dist/reasoning/types.d.ts +146 -0
- package/dist/reasoning/types.d.ts.map +1 -0
- package/dist/recovery/backup.d.ts +110 -0
- package/dist/recovery/backup.d.ts.map +1 -0
- package/dist/recovery/index.d.ts +70 -0
- package/dist/recovery/index.d.ts.map +1 -0
- package/dist/recovery/index.js +186 -0
- package/dist/recovery/index.js.map +1 -0
- package/dist/recovery/integrity.d.ts +74 -0
- package/dist/recovery/integrity.d.ts.map +1 -0
- package/dist/recovery/types.d.ts +94 -0
- package/dist/recovery/types.d.ts.map +1 -0
- package/dist/services/index.d.ts +130 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +134 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/manager.d.ts +140 -0
- package/dist/services/manager.d.ts.map +1 -0
- package/dist/services/types.d.ts +106 -0
- package/dist/services/types.d.ts.map +1 -0
- package/dist/services/watchers.d.ts +95 -0
- package/dist/services/watchers.d.ts.map +1 -0
- package/dist/sops/compliance-checker.d.ts +83 -0
- package/dist/sops/compliance-checker.d.ts.map +1 -0
- package/dist/sops/compliance-checker.js +399 -0
- package/dist/sops/compliance-checker.js.map +1 -0
- package/dist/sops/gap-analyzer.d.ts +124 -0
- package/dist/sops/gap-analyzer.d.ts.map +1 -0
- package/dist/sops/gap-analyzer.js +313 -0
- package/dist/sops/gap-analyzer.js.map +1 -0
- package/dist/sops/index.d.ts +14 -0
- package/dist/sops/index.d.ts.map +1 -0
- package/dist/sops/overlay-manager.d.ts +115 -0
- package/dist/sops/overlay-manager.d.ts.map +1 -0
- package/dist/sops/overlay-manager.js +394 -0
- package/dist/sops/overlay-manager.js.map +1 -0
- package/dist/sops/registry.d.ts +73 -0
- package/dist/sops/registry.d.ts.map +1 -0
- package/dist/sops/registry.js +919 -0
- package/dist/sops/registry.js.map +1 -0
- package/dist/sops/types.d.ts +377 -0
- package/dist/sops/types.d.ts.map +1 -0
- package/dist/sops/types.js +46 -0
- package/dist/sops/types.js.map +1 -0
- package/dist/utils/error-recovery.d.ts +230 -0
- package/dist/utils/error-recovery.d.ts.map +1 -0
- package/dist/utils/error-recovery.js +228 -0
- package/dist/utils/error-recovery.js.map +1 -0
- package/dist/utils/error-taxonomy.d.ts +149 -0
- package/dist/utils/error-taxonomy.d.ts.map +1 -0
- package/dist/utils/error-taxonomy.js +260 -0
- package/dist/utils/error-taxonomy.js.map +1 -0
- package/dist/utils/index.d.ts +11 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/logger.d.ts +139 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +311 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/workflows/index.d.ts +11 -0
- package/dist/workflows/index.d.ts.map +1 -0
- package/dist/workflows/registry.d.ts +118 -0
- package/dist/workflows/registry.d.ts.map +1 -0
- package/dist/workflows/registry.js +575 -0
- package/dist/workflows/registry.js.map +1 -0
- package/dist/workflows/types.d.ts +322 -0
- package/dist/workflows/types.d.ts.map +1 -0
- package/dist/workflows/types.js +16 -0
- package/dist/workflows/types.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,1332 @@
|
|
|
1
|
+
import { custom, union, string, number, looseObject, object, record, unknown, literal, optional, array, intersection, boolean, preprocess, enum as _enum, discriminatedUnion } from "../../../../zod/v4/classic/schemas.js";
|
|
2
|
+
const LATEST_PROTOCOL_VERSION = "2025-06-18";
|
|
3
|
+
const SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, "2025-03-26", "2024-11-05", "2024-10-07"];
|
|
4
|
+
const JSONRPC_VERSION = "2.0";
|
|
5
|
+
const AssertObjectSchema = custom((v) => v !== null && (typeof v === "object" || typeof v === "function"));
|
|
6
|
+
const ProgressTokenSchema = union([string(), number().int()]);
|
|
7
|
+
const CursorSchema = string();
|
|
8
|
+
const RequestMetaSchema = looseObject({
|
|
9
|
+
/**
|
|
10
|
+
* If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.
|
|
11
|
+
*/
|
|
12
|
+
progressToken: ProgressTokenSchema.optional()
|
|
13
|
+
});
|
|
14
|
+
const BaseRequestParamsSchema = looseObject({
|
|
15
|
+
/**
|
|
16
|
+
* See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage.
|
|
17
|
+
*/
|
|
18
|
+
_meta: RequestMetaSchema.optional()
|
|
19
|
+
});
|
|
20
|
+
const RequestSchema = object({
|
|
21
|
+
method: string(),
|
|
22
|
+
params: BaseRequestParamsSchema.optional()
|
|
23
|
+
});
|
|
24
|
+
const NotificationsParamsSchema = looseObject({
|
|
25
|
+
/**
|
|
26
|
+
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
27
|
+
* for notes on _meta usage.
|
|
28
|
+
*/
|
|
29
|
+
_meta: record(string(), unknown()).optional()
|
|
30
|
+
});
|
|
31
|
+
const NotificationSchema = object({
|
|
32
|
+
method: string(),
|
|
33
|
+
params: NotificationsParamsSchema.optional()
|
|
34
|
+
});
|
|
35
|
+
const ResultSchema = looseObject({
|
|
36
|
+
/**
|
|
37
|
+
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
38
|
+
* for notes on _meta usage.
|
|
39
|
+
*/
|
|
40
|
+
_meta: record(string(), unknown()).optional()
|
|
41
|
+
});
|
|
42
|
+
const RequestIdSchema = union([string(), number().int()]);
|
|
43
|
+
const JSONRPCRequestSchema = object({
|
|
44
|
+
jsonrpc: literal(JSONRPC_VERSION),
|
|
45
|
+
id: RequestIdSchema,
|
|
46
|
+
...RequestSchema.shape
|
|
47
|
+
}).strict();
|
|
48
|
+
const isJSONRPCRequest = (value) => JSONRPCRequestSchema.safeParse(value).success;
|
|
49
|
+
const JSONRPCNotificationSchema = object({
|
|
50
|
+
jsonrpc: literal(JSONRPC_VERSION),
|
|
51
|
+
...NotificationSchema.shape
|
|
52
|
+
}).strict();
|
|
53
|
+
const isJSONRPCNotification = (value) => JSONRPCNotificationSchema.safeParse(value).success;
|
|
54
|
+
const JSONRPCResponseSchema = object({
|
|
55
|
+
jsonrpc: literal(JSONRPC_VERSION),
|
|
56
|
+
id: RequestIdSchema,
|
|
57
|
+
result: ResultSchema
|
|
58
|
+
}).strict();
|
|
59
|
+
const isJSONRPCResponse = (value) => JSONRPCResponseSchema.safeParse(value).success;
|
|
60
|
+
var ErrorCode;
|
|
61
|
+
(function(ErrorCode2) {
|
|
62
|
+
ErrorCode2[ErrorCode2["ConnectionClosed"] = -32e3] = "ConnectionClosed";
|
|
63
|
+
ErrorCode2[ErrorCode2["RequestTimeout"] = -32001] = "RequestTimeout";
|
|
64
|
+
ErrorCode2[ErrorCode2["ParseError"] = -32700] = "ParseError";
|
|
65
|
+
ErrorCode2[ErrorCode2["InvalidRequest"] = -32600] = "InvalidRequest";
|
|
66
|
+
ErrorCode2[ErrorCode2["MethodNotFound"] = -32601] = "MethodNotFound";
|
|
67
|
+
ErrorCode2[ErrorCode2["InvalidParams"] = -32602] = "InvalidParams";
|
|
68
|
+
ErrorCode2[ErrorCode2["InternalError"] = -32603] = "InternalError";
|
|
69
|
+
ErrorCode2[ErrorCode2["UrlElicitationRequired"] = -32042] = "UrlElicitationRequired";
|
|
70
|
+
})(ErrorCode || (ErrorCode = {}));
|
|
71
|
+
const JSONRPCErrorSchema = object({
|
|
72
|
+
jsonrpc: literal(JSONRPC_VERSION),
|
|
73
|
+
id: RequestIdSchema,
|
|
74
|
+
error: object({
|
|
75
|
+
/**
|
|
76
|
+
* The error type that occurred.
|
|
77
|
+
*/
|
|
78
|
+
code: number().int(),
|
|
79
|
+
/**
|
|
80
|
+
* A short description of the error. The message SHOULD be limited to a concise single sentence.
|
|
81
|
+
*/
|
|
82
|
+
message: string(),
|
|
83
|
+
/**
|
|
84
|
+
* Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).
|
|
85
|
+
*/
|
|
86
|
+
data: optional(unknown())
|
|
87
|
+
})
|
|
88
|
+
}).strict();
|
|
89
|
+
const isJSONRPCError = (value) => JSONRPCErrorSchema.safeParse(value).success;
|
|
90
|
+
union([JSONRPCRequestSchema, JSONRPCNotificationSchema, JSONRPCResponseSchema, JSONRPCErrorSchema]);
|
|
91
|
+
const EmptyResultSchema = ResultSchema.strict();
|
|
92
|
+
const CancelledNotificationParamsSchema = NotificationsParamsSchema.extend({
|
|
93
|
+
/**
|
|
94
|
+
* The ID of the request to cancel.
|
|
95
|
+
*
|
|
96
|
+
* This MUST correspond to the ID of a request previously issued in the same direction.
|
|
97
|
+
*/
|
|
98
|
+
requestId: RequestIdSchema,
|
|
99
|
+
/**
|
|
100
|
+
* An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.
|
|
101
|
+
*/
|
|
102
|
+
reason: string().optional()
|
|
103
|
+
});
|
|
104
|
+
const CancelledNotificationSchema = NotificationSchema.extend({
|
|
105
|
+
method: literal("notifications/cancelled"),
|
|
106
|
+
params: CancelledNotificationParamsSchema
|
|
107
|
+
});
|
|
108
|
+
const IconSchema = object({
|
|
109
|
+
/**
|
|
110
|
+
* URL or data URI for the icon.
|
|
111
|
+
*/
|
|
112
|
+
src: string(),
|
|
113
|
+
/**
|
|
114
|
+
* Optional MIME type for the icon.
|
|
115
|
+
*/
|
|
116
|
+
mimeType: string().optional(),
|
|
117
|
+
/**
|
|
118
|
+
* Optional array of strings that specify sizes at which the icon can be used.
|
|
119
|
+
* Each string should be in WxH format (e.g., `"48x48"`, `"96x96"`) or `"any"` for scalable formats like SVG.
|
|
120
|
+
*
|
|
121
|
+
* If not provided, the client should assume that the icon can be used at any size.
|
|
122
|
+
*/
|
|
123
|
+
sizes: array(string()).optional()
|
|
124
|
+
});
|
|
125
|
+
const IconsSchema = object({
|
|
126
|
+
/**
|
|
127
|
+
* Optional set of sized icons that the client can display in a user interface.
|
|
128
|
+
*
|
|
129
|
+
* Clients that support rendering icons MUST support at least the following MIME types:
|
|
130
|
+
* - `image/png` - PNG images (safe, universal compatibility)
|
|
131
|
+
* - `image/jpeg` (and `image/jpg`) - JPEG images (safe, universal compatibility)
|
|
132
|
+
*
|
|
133
|
+
* Clients that support rendering icons SHOULD also support:
|
|
134
|
+
* - `image/svg+xml` - SVG images (scalable but requires security precautions)
|
|
135
|
+
* - `image/webp` - WebP images (modern, efficient format)
|
|
136
|
+
*/
|
|
137
|
+
icons: array(IconSchema).optional()
|
|
138
|
+
});
|
|
139
|
+
const BaseMetadataSchema = object({
|
|
140
|
+
/** Intended for programmatic or logical use, but used as a display name in past specs or fallback */
|
|
141
|
+
name: string(),
|
|
142
|
+
/**
|
|
143
|
+
* Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
|
|
144
|
+
* even by those unfamiliar with domain-specific terminology.
|
|
145
|
+
*
|
|
146
|
+
* If not provided, the name should be used for display (except for Tool,
|
|
147
|
+
* where `annotations.title` should be given precedence over using `name`,
|
|
148
|
+
* if present).
|
|
149
|
+
*/
|
|
150
|
+
title: string().optional()
|
|
151
|
+
});
|
|
152
|
+
const ImplementationSchema = BaseMetadataSchema.extend({
|
|
153
|
+
...BaseMetadataSchema.shape,
|
|
154
|
+
...IconsSchema.shape,
|
|
155
|
+
version: string(),
|
|
156
|
+
/**
|
|
157
|
+
* An optional URL of the website for this implementation.
|
|
158
|
+
*/
|
|
159
|
+
websiteUrl: string().optional()
|
|
160
|
+
});
|
|
161
|
+
const FormElicitationCapabilitySchema = intersection(object({
|
|
162
|
+
applyDefaults: boolean().optional()
|
|
163
|
+
}), record(string(), unknown()));
|
|
164
|
+
const ElicitationCapabilitySchema = preprocess((value) => {
|
|
165
|
+
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
166
|
+
if (Object.keys(value).length === 0) {
|
|
167
|
+
return { form: {} };
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return value;
|
|
171
|
+
}, intersection(object({
|
|
172
|
+
form: FormElicitationCapabilitySchema.optional(),
|
|
173
|
+
url: AssertObjectSchema.optional()
|
|
174
|
+
}), record(string(), unknown()).optional()));
|
|
175
|
+
const ClientCapabilitiesSchema = object({
|
|
176
|
+
/**
|
|
177
|
+
* Experimental, non-standard capabilities that the client supports.
|
|
178
|
+
*/
|
|
179
|
+
experimental: record(string(), AssertObjectSchema).optional(),
|
|
180
|
+
/**
|
|
181
|
+
* Present if the client supports sampling from an LLM.
|
|
182
|
+
*/
|
|
183
|
+
sampling: object({
|
|
184
|
+
/**
|
|
185
|
+
* Present if the client supports context inclusion via includeContext parameter.
|
|
186
|
+
* If not declared, servers SHOULD only use `includeContext: "none"` (or omit it).
|
|
187
|
+
*/
|
|
188
|
+
context: AssertObjectSchema.optional(),
|
|
189
|
+
/**
|
|
190
|
+
* Present if the client supports tool use via tools and toolChoice parameters.
|
|
191
|
+
*/
|
|
192
|
+
tools: AssertObjectSchema.optional()
|
|
193
|
+
}).optional(),
|
|
194
|
+
/**
|
|
195
|
+
* Present if the client supports eliciting user input.
|
|
196
|
+
*/
|
|
197
|
+
elicitation: ElicitationCapabilitySchema.optional(),
|
|
198
|
+
/**
|
|
199
|
+
* Present if the client supports listing roots.
|
|
200
|
+
*/
|
|
201
|
+
roots: object({
|
|
202
|
+
/**
|
|
203
|
+
* Whether the client supports issuing notifications for changes to the roots list.
|
|
204
|
+
*/
|
|
205
|
+
listChanged: boolean().optional()
|
|
206
|
+
}).optional()
|
|
207
|
+
});
|
|
208
|
+
const InitializeRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
209
|
+
/**
|
|
210
|
+
* The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well.
|
|
211
|
+
*/
|
|
212
|
+
protocolVersion: string(),
|
|
213
|
+
capabilities: ClientCapabilitiesSchema,
|
|
214
|
+
clientInfo: ImplementationSchema
|
|
215
|
+
});
|
|
216
|
+
const InitializeRequestSchema = RequestSchema.extend({
|
|
217
|
+
method: literal("initialize"),
|
|
218
|
+
params: InitializeRequestParamsSchema
|
|
219
|
+
});
|
|
220
|
+
const ServerCapabilitiesSchema = object({
|
|
221
|
+
/**
|
|
222
|
+
* Experimental, non-standard capabilities that the server supports.
|
|
223
|
+
*/
|
|
224
|
+
experimental: record(string(), AssertObjectSchema).optional(),
|
|
225
|
+
/**
|
|
226
|
+
* Present if the server supports sending log messages to the client.
|
|
227
|
+
*/
|
|
228
|
+
logging: AssertObjectSchema.optional(),
|
|
229
|
+
/**
|
|
230
|
+
* Present if the server supports sending completions to the client.
|
|
231
|
+
*/
|
|
232
|
+
completions: AssertObjectSchema.optional(),
|
|
233
|
+
/**
|
|
234
|
+
* Present if the server offers any prompt templates.
|
|
235
|
+
*/
|
|
236
|
+
prompts: optional(object({
|
|
237
|
+
/**
|
|
238
|
+
* Whether this server supports issuing notifications for changes to the prompt list.
|
|
239
|
+
*/
|
|
240
|
+
listChanged: optional(boolean())
|
|
241
|
+
})),
|
|
242
|
+
/**
|
|
243
|
+
* Present if the server offers any resources to read.
|
|
244
|
+
*/
|
|
245
|
+
resources: object({
|
|
246
|
+
/**
|
|
247
|
+
* Whether this server supports clients subscribing to resource updates.
|
|
248
|
+
*/
|
|
249
|
+
subscribe: boolean().optional(),
|
|
250
|
+
/**
|
|
251
|
+
* Whether this server supports issuing notifications for changes to the resource list.
|
|
252
|
+
*/
|
|
253
|
+
listChanged: boolean().optional()
|
|
254
|
+
}).optional(),
|
|
255
|
+
/**
|
|
256
|
+
* Present if the server offers any tools to call.
|
|
257
|
+
*/
|
|
258
|
+
tools: object({
|
|
259
|
+
/**
|
|
260
|
+
* Whether this server supports issuing notifications for changes to the tool list.
|
|
261
|
+
*/
|
|
262
|
+
listChanged: boolean().optional()
|
|
263
|
+
}).optional()
|
|
264
|
+
});
|
|
265
|
+
const InitializeResultSchema = ResultSchema.extend({
|
|
266
|
+
/**
|
|
267
|
+
* 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.
|
|
268
|
+
*/
|
|
269
|
+
protocolVersion: string(),
|
|
270
|
+
capabilities: ServerCapabilitiesSchema,
|
|
271
|
+
serverInfo: ImplementationSchema,
|
|
272
|
+
/**
|
|
273
|
+
* Instructions describing how to use the server and its features.
|
|
274
|
+
*
|
|
275
|
+
* 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.
|
|
276
|
+
*/
|
|
277
|
+
instructions: string().optional()
|
|
278
|
+
});
|
|
279
|
+
const InitializedNotificationSchema = NotificationSchema.extend({
|
|
280
|
+
method: literal("notifications/initialized")
|
|
281
|
+
});
|
|
282
|
+
const PingRequestSchema = RequestSchema.extend({
|
|
283
|
+
method: literal("ping")
|
|
284
|
+
});
|
|
285
|
+
const ProgressSchema = object({
|
|
286
|
+
/**
|
|
287
|
+
* The progress thus far. This should increase every time progress is made, even if the total is unknown.
|
|
288
|
+
*/
|
|
289
|
+
progress: number(),
|
|
290
|
+
/**
|
|
291
|
+
* Total number of items to process (or total progress required), if known.
|
|
292
|
+
*/
|
|
293
|
+
total: optional(number()),
|
|
294
|
+
/**
|
|
295
|
+
* An optional message describing the current progress.
|
|
296
|
+
*/
|
|
297
|
+
message: optional(string())
|
|
298
|
+
});
|
|
299
|
+
const ProgressNotificationParamsSchema = object({
|
|
300
|
+
...NotificationsParamsSchema.shape,
|
|
301
|
+
...ProgressSchema.shape,
|
|
302
|
+
/**
|
|
303
|
+
* The progress token which was given in the initial request, used to associate this notification with the request that is proceeding.
|
|
304
|
+
*/
|
|
305
|
+
progressToken: ProgressTokenSchema
|
|
306
|
+
});
|
|
307
|
+
const ProgressNotificationSchema = NotificationSchema.extend({
|
|
308
|
+
method: literal("notifications/progress"),
|
|
309
|
+
params: ProgressNotificationParamsSchema
|
|
310
|
+
});
|
|
311
|
+
const PaginatedRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
312
|
+
/**
|
|
313
|
+
* An opaque token representing the current pagination position.
|
|
314
|
+
* If provided, the server should return results starting after this cursor.
|
|
315
|
+
*/
|
|
316
|
+
cursor: CursorSchema.optional()
|
|
317
|
+
});
|
|
318
|
+
const PaginatedRequestSchema = RequestSchema.extend({
|
|
319
|
+
params: PaginatedRequestParamsSchema.optional()
|
|
320
|
+
});
|
|
321
|
+
const PaginatedResultSchema = ResultSchema.extend({
|
|
322
|
+
/**
|
|
323
|
+
* An opaque token representing the pagination position after the last returned result.
|
|
324
|
+
* If present, there may be more results available.
|
|
325
|
+
*/
|
|
326
|
+
nextCursor: optional(CursorSchema)
|
|
327
|
+
});
|
|
328
|
+
const ResourceContentsSchema = object({
|
|
329
|
+
/**
|
|
330
|
+
* The URI of this resource.
|
|
331
|
+
*/
|
|
332
|
+
uri: string(),
|
|
333
|
+
/**
|
|
334
|
+
* The MIME type of this resource, if known.
|
|
335
|
+
*/
|
|
336
|
+
mimeType: optional(string()),
|
|
337
|
+
/**
|
|
338
|
+
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
339
|
+
* for notes on _meta usage.
|
|
340
|
+
*/
|
|
341
|
+
_meta: record(string(), unknown()).optional()
|
|
342
|
+
});
|
|
343
|
+
const TextResourceContentsSchema = ResourceContentsSchema.extend({
|
|
344
|
+
/**
|
|
345
|
+
* The text of the item. This must only be set if the item can actually be represented as text (not binary data).
|
|
346
|
+
*/
|
|
347
|
+
text: string()
|
|
348
|
+
});
|
|
349
|
+
const Base64Schema = string().refine((val) => {
|
|
350
|
+
try {
|
|
351
|
+
atob(val);
|
|
352
|
+
return true;
|
|
353
|
+
} catch (_a) {
|
|
354
|
+
return false;
|
|
355
|
+
}
|
|
356
|
+
}, { message: "Invalid Base64 string" });
|
|
357
|
+
const BlobResourceContentsSchema = ResourceContentsSchema.extend({
|
|
358
|
+
/**
|
|
359
|
+
* A base64-encoded string representing the binary data of the item.
|
|
360
|
+
*/
|
|
361
|
+
blob: Base64Schema
|
|
362
|
+
});
|
|
363
|
+
const ResourceSchema = object({
|
|
364
|
+
...BaseMetadataSchema.shape,
|
|
365
|
+
...IconsSchema.shape,
|
|
366
|
+
/**
|
|
367
|
+
* The URI of this resource.
|
|
368
|
+
*/
|
|
369
|
+
uri: string(),
|
|
370
|
+
/**
|
|
371
|
+
* A description of what this resource represents.
|
|
372
|
+
*
|
|
373
|
+
* 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.
|
|
374
|
+
*/
|
|
375
|
+
description: optional(string()),
|
|
376
|
+
/**
|
|
377
|
+
* The MIME type of this resource, if known.
|
|
378
|
+
*/
|
|
379
|
+
mimeType: optional(string()),
|
|
380
|
+
/**
|
|
381
|
+
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
382
|
+
* for notes on _meta usage.
|
|
383
|
+
*/
|
|
384
|
+
_meta: optional(looseObject({}))
|
|
385
|
+
});
|
|
386
|
+
const ResourceTemplateSchema = object({
|
|
387
|
+
...BaseMetadataSchema.shape,
|
|
388
|
+
...IconsSchema.shape,
|
|
389
|
+
/**
|
|
390
|
+
* A URI template (according to RFC 6570) that can be used to construct resource URIs.
|
|
391
|
+
*/
|
|
392
|
+
uriTemplate: string(),
|
|
393
|
+
/**
|
|
394
|
+
* A description of what this template is for.
|
|
395
|
+
*
|
|
396
|
+
* 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.
|
|
397
|
+
*/
|
|
398
|
+
description: optional(string()),
|
|
399
|
+
/**
|
|
400
|
+
* 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.
|
|
401
|
+
*/
|
|
402
|
+
mimeType: optional(string()),
|
|
403
|
+
/**
|
|
404
|
+
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
405
|
+
* for notes on _meta usage.
|
|
406
|
+
*/
|
|
407
|
+
_meta: optional(looseObject({}))
|
|
408
|
+
});
|
|
409
|
+
const ListResourcesRequestSchema = PaginatedRequestSchema.extend({
|
|
410
|
+
method: literal("resources/list")
|
|
411
|
+
});
|
|
412
|
+
const ListResourcesResultSchema = PaginatedResultSchema.extend({
|
|
413
|
+
resources: array(ResourceSchema)
|
|
414
|
+
});
|
|
415
|
+
const ListResourceTemplatesRequestSchema = PaginatedRequestSchema.extend({
|
|
416
|
+
method: literal("resources/templates/list")
|
|
417
|
+
});
|
|
418
|
+
const ListResourceTemplatesResultSchema = PaginatedResultSchema.extend({
|
|
419
|
+
resourceTemplates: array(ResourceTemplateSchema)
|
|
420
|
+
});
|
|
421
|
+
const ResourceRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
422
|
+
/**
|
|
423
|
+
* The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it.
|
|
424
|
+
*
|
|
425
|
+
* @format uri
|
|
426
|
+
*/
|
|
427
|
+
uri: string()
|
|
428
|
+
});
|
|
429
|
+
const ReadResourceRequestParamsSchema = ResourceRequestParamsSchema;
|
|
430
|
+
const ReadResourceRequestSchema = RequestSchema.extend({
|
|
431
|
+
method: literal("resources/read"),
|
|
432
|
+
params: ReadResourceRequestParamsSchema
|
|
433
|
+
});
|
|
434
|
+
const ReadResourceResultSchema = ResultSchema.extend({
|
|
435
|
+
contents: array(union([TextResourceContentsSchema, BlobResourceContentsSchema]))
|
|
436
|
+
});
|
|
437
|
+
const ResourceListChangedNotificationSchema = NotificationSchema.extend({
|
|
438
|
+
method: literal("notifications/resources/list_changed")
|
|
439
|
+
});
|
|
440
|
+
const SubscribeRequestParamsSchema = ResourceRequestParamsSchema;
|
|
441
|
+
const SubscribeRequestSchema = RequestSchema.extend({
|
|
442
|
+
method: literal("resources/subscribe"),
|
|
443
|
+
params: SubscribeRequestParamsSchema
|
|
444
|
+
});
|
|
445
|
+
const UnsubscribeRequestParamsSchema = ResourceRequestParamsSchema;
|
|
446
|
+
const UnsubscribeRequestSchema = RequestSchema.extend({
|
|
447
|
+
method: literal("resources/unsubscribe"),
|
|
448
|
+
params: UnsubscribeRequestParamsSchema
|
|
449
|
+
});
|
|
450
|
+
const ResourceUpdatedNotificationParamsSchema = NotificationsParamsSchema.extend({
|
|
451
|
+
/**
|
|
452
|
+
* The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.
|
|
453
|
+
*/
|
|
454
|
+
uri: string()
|
|
455
|
+
});
|
|
456
|
+
const ResourceUpdatedNotificationSchema = NotificationSchema.extend({
|
|
457
|
+
method: literal("notifications/resources/updated"),
|
|
458
|
+
params: ResourceUpdatedNotificationParamsSchema
|
|
459
|
+
});
|
|
460
|
+
const PromptArgumentSchema = object({
|
|
461
|
+
/**
|
|
462
|
+
* The name of the argument.
|
|
463
|
+
*/
|
|
464
|
+
name: string(),
|
|
465
|
+
/**
|
|
466
|
+
* A human-readable description of the argument.
|
|
467
|
+
*/
|
|
468
|
+
description: optional(string()),
|
|
469
|
+
/**
|
|
470
|
+
* Whether this argument must be provided.
|
|
471
|
+
*/
|
|
472
|
+
required: optional(boolean())
|
|
473
|
+
});
|
|
474
|
+
const PromptSchema = object({
|
|
475
|
+
...BaseMetadataSchema.shape,
|
|
476
|
+
...IconsSchema.shape,
|
|
477
|
+
/**
|
|
478
|
+
* An optional description of what this prompt provides
|
|
479
|
+
*/
|
|
480
|
+
description: optional(string()),
|
|
481
|
+
/**
|
|
482
|
+
* A list of arguments to use for templating the prompt.
|
|
483
|
+
*/
|
|
484
|
+
arguments: optional(array(PromptArgumentSchema)),
|
|
485
|
+
/**
|
|
486
|
+
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
487
|
+
* for notes on _meta usage.
|
|
488
|
+
*/
|
|
489
|
+
_meta: optional(looseObject({}))
|
|
490
|
+
});
|
|
491
|
+
const ListPromptsRequestSchema = PaginatedRequestSchema.extend({
|
|
492
|
+
method: literal("prompts/list")
|
|
493
|
+
});
|
|
494
|
+
const ListPromptsResultSchema = PaginatedResultSchema.extend({
|
|
495
|
+
prompts: array(PromptSchema)
|
|
496
|
+
});
|
|
497
|
+
const GetPromptRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
498
|
+
/**
|
|
499
|
+
* The name of the prompt or prompt template.
|
|
500
|
+
*/
|
|
501
|
+
name: string(),
|
|
502
|
+
/**
|
|
503
|
+
* Arguments to use for templating the prompt.
|
|
504
|
+
*/
|
|
505
|
+
arguments: record(string(), string()).optional()
|
|
506
|
+
});
|
|
507
|
+
const GetPromptRequestSchema = RequestSchema.extend({
|
|
508
|
+
method: literal("prompts/get"),
|
|
509
|
+
params: GetPromptRequestParamsSchema
|
|
510
|
+
});
|
|
511
|
+
const TextContentSchema = object({
|
|
512
|
+
type: literal("text"),
|
|
513
|
+
/**
|
|
514
|
+
* The text content of the message.
|
|
515
|
+
*/
|
|
516
|
+
text: string(),
|
|
517
|
+
/**
|
|
518
|
+
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
519
|
+
* for notes on _meta usage.
|
|
520
|
+
*/
|
|
521
|
+
_meta: record(string(), unknown()).optional()
|
|
522
|
+
});
|
|
523
|
+
const ImageContentSchema = object({
|
|
524
|
+
type: literal("image"),
|
|
525
|
+
/**
|
|
526
|
+
* The base64-encoded image data.
|
|
527
|
+
*/
|
|
528
|
+
data: Base64Schema,
|
|
529
|
+
/**
|
|
530
|
+
* The MIME type of the image. Different providers may support different image types.
|
|
531
|
+
*/
|
|
532
|
+
mimeType: string(),
|
|
533
|
+
/**
|
|
534
|
+
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
535
|
+
* for notes on _meta usage.
|
|
536
|
+
*/
|
|
537
|
+
_meta: record(string(), unknown()).optional()
|
|
538
|
+
});
|
|
539
|
+
const AudioContentSchema = object({
|
|
540
|
+
type: literal("audio"),
|
|
541
|
+
/**
|
|
542
|
+
* The base64-encoded audio data.
|
|
543
|
+
*/
|
|
544
|
+
data: Base64Schema,
|
|
545
|
+
/**
|
|
546
|
+
* The MIME type of the audio. Different providers may support different audio types.
|
|
547
|
+
*/
|
|
548
|
+
mimeType: string(),
|
|
549
|
+
/**
|
|
550
|
+
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
551
|
+
* for notes on _meta usage.
|
|
552
|
+
*/
|
|
553
|
+
_meta: record(string(), unknown()).optional()
|
|
554
|
+
});
|
|
555
|
+
const ToolUseContentSchema = object({
|
|
556
|
+
type: literal("tool_use"),
|
|
557
|
+
/**
|
|
558
|
+
* The name of the tool to invoke.
|
|
559
|
+
* Must match a tool name from the request's tools array.
|
|
560
|
+
*/
|
|
561
|
+
name: string(),
|
|
562
|
+
/**
|
|
563
|
+
* Unique identifier for this tool call.
|
|
564
|
+
* Used to correlate with ToolResultContent in subsequent messages.
|
|
565
|
+
*/
|
|
566
|
+
id: string(),
|
|
567
|
+
/**
|
|
568
|
+
* Arguments to pass to the tool.
|
|
569
|
+
* Must conform to the tool's inputSchema.
|
|
570
|
+
*/
|
|
571
|
+
input: object({}).passthrough(),
|
|
572
|
+
/**
|
|
573
|
+
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
574
|
+
* for notes on _meta usage.
|
|
575
|
+
*/
|
|
576
|
+
_meta: optional(object({}).passthrough())
|
|
577
|
+
}).passthrough();
|
|
578
|
+
const EmbeddedResourceSchema = object({
|
|
579
|
+
type: literal("resource"),
|
|
580
|
+
resource: union([TextResourceContentsSchema, BlobResourceContentsSchema]),
|
|
581
|
+
/**
|
|
582
|
+
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
583
|
+
* for notes on _meta usage.
|
|
584
|
+
*/
|
|
585
|
+
_meta: record(string(), unknown()).optional()
|
|
586
|
+
});
|
|
587
|
+
const ResourceLinkSchema = ResourceSchema.extend({
|
|
588
|
+
type: literal("resource_link")
|
|
589
|
+
});
|
|
590
|
+
const ContentBlockSchema = union([
|
|
591
|
+
TextContentSchema,
|
|
592
|
+
ImageContentSchema,
|
|
593
|
+
AudioContentSchema,
|
|
594
|
+
ResourceLinkSchema,
|
|
595
|
+
EmbeddedResourceSchema
|
|
596
|
+
]);
|
|
597
|
+
const PromptMessageSchema = object({
|
|
598
|
+
role: _enum(["user", "assistant"]),
|
|
599
|
+
content: ContentBlockSchema
|
|
600
|
+
});
|
|
601
|
+
const GetPromptResultSchema = ResultSchema.extend({
|
|
602
|
+
/**
|
|
603
|
+
* An optional description for the prompt.
|
|
604
|
+
*/
|
|
605
|
+
description: optional(string()),
|
|
606
|
+
messages: array(PromptMessageSchema)
|
|
607
|
+
});
|
|
608
|
+
const PromptListChangedNotificationSchema = NotificationSchema.extend({
|
|
609
|
+
method: literal("notifications/prompts/list_changed")
|
|
610
|
+
});
|
|
611
|
+
const ToolAnnotationsSchema = object({
|
|
612
|
+
/**
|
|
613
|
+
* A human-readable title for the tool.
|
|
614
|
+
*/
|
|
615
|
+
title: string().optional(),
|
|
616
|
+
/**
|
|
617
|
+
* If true, the tool does not modify its environment.
|
|
618
|
+
*
|
|
619
|
+
* Default: false
|
|
620
|
+
*/
|
|
621
|
+
readOnlyHint: boolean().optional(),
|
|
622
|
+
/**
|
|
623
|
+
* If true, the tool may perform destructive updates to its environment.
|
|
624
|
+
* If false, the tool performs only additive updates.
|
|
625
|
+
*
|
|
626
|
+
* (This property is meaningful only when `readOnlyHint == false`)
|
|
627
|
+
*
|
|
628
|
+
* Default: true
|
|
629
|
+
*/
|
|
630
|
+
destructiveHint: boolean().optional(),
|
|
631
|
+
/**
|
|
632
|
+
* If true, calling the tool repeatedly with the same arguments
|
|
633
|
+
* will have no additional effect on the its environment.
|
|
634
|
+
*
|
|
635
|
+
* (This property is meaningful only when `readOnlyHint == false`)
|
|
636
|
+
*
|
|
637
|
+
* Default: false
|
|
638
|
+
*/
|
|
639
|
+
idempotentHint: boolean().optional(),
|
|
640
|
+
/**
|
|
641
|
+
* If true, this tool may interact with an "open world" of external
|
|
642
|
+
* entities. If false, the tool's domain of interaction is closed.
|
|
643
|
+
* For example, the world of a web search tool is open, whereas that
|
|
644
|
+
* of a memory tool is not.
|
|
645
|
+
*
|
|
646
|
+
* Default: true
|
|
647
|
+
*/
|
|
648
|
+
openWorldHint: boolean().optional()
|
|
649
|
+
});
|
|
650
|
+
const ToolSchema = object({
|
|
651
|
+
...BaseMetadataSchema.shape,
|
|
652
|
+
...IconsSchema.shape,
|
|
653
|
+
/**
|
|
654
|
+
* A human-readable description of the tool.
|
|
655
|
+
*/
|
|
656
|
+
description: string().optional(),
|
|
657
|
+
/**
|
|
658
|
+
* A JSON Schema 2020-12 object defining the expected parameters for the tool.
|
|
659
|
+
* Must have type: 'object' at the root level per MCP spec.
|
|
660
|
+
*/
|
|
661
|
+
inputSchema: object({
|
|
662
|
+
type: literal("object"),
|
|
663
|
+
properties: record(string(), AssertObjectSchema).optional(),
|
|
664
|
+
required: array(string()).optional()
|
|
665
|
+
}).catchall(unknown()),
|
|
666
|
+
/**
|
|
667
|
+
* An optional JSON Schema 2020-12 object defining the structure of the tool's output
|
|
668
|
+
* returned in the structuredContent field of a CallToolResult.
|
|
669
|
+
* Must have type: 'object' at the root level per MCP spec.
|
|
670
|
+
*/
|
|
671
|
+
outputSchema: object({
|
|
672
|
+
type: literal("object"),
|
|
673
|
+
properties: record(string(), AssertObjectSchema).optional(),
|
|
674
|
+
required: array(string()).optional()
|
|
675
|
+
}).catchall(unknown()).optional(),
|
|
676
|
+
/**
|
|
677
|
+
* Optional additional tool information.
|
|
678
|
+
*/
|
|
679
|
+
annotations: optional(ToolAnnotationsSchema),
|
|
680
|
+
/**
|
|
681
|
+
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
682
|
+
* for notes on _meta usage.
|
|
683
|
+
*/
|
|
684
|
+
_meta: record(string(), unknown()).optional()
|
|
685
|
+
});
|
|
686
|
+
const ListToolsRequestSchema = PaginatedRequestSchema.extend({
|
|
687
|
+
method: literal("tools/list")
|
|
688
|
+
});
|
|
689
|
+
const ListToolsResultSchema = PaginatedResultSchema.extend({
|
|
690
|
+
tools: array(ToolSchema)
|
|
691
|
+
});
|
|
692
|
+
const CallToolResultSchema = ResultSchema.extend({
|
|
693
|
+
/**
|
|
694
|
+
* A list of content objects that represent the result of the tool call.
|
|
695
|
+
*
|
|
696
|
+
* If the Tool does not define an outputSchema, this field MUST be present in the result.
|
|
697
|
+
* For backwards compatibility, this field is always present, but it may be empty.
|
|
698
|
+
*/
|
|
699
|
+
content: array(ContentBlockSchema).default([]),
|
|
700
|
+
/**
|
|
701
|
+
* An object containing structured tool output.
|
|
702
|
+
*
|
|
703
|
+
* If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema.
|
|
704
|
+
*/
|
|
705
|
+
structuredContent: record(string(), unknown()).optional(),
|
|
706
|
+
/**
|
|
707
|
+
* Whether the tool call ended in an error.
|
|
708
|
+
*
|
|
709
|
+
* If not set, this is assumed to be false (the call was successful).
|
|
710
|
+
*
|
|
711
|
+
* Any errors that originate from the tool SHOULD be reported inside the result
|
|
712
|
+
* object, with `isError` set to true, _not_ as an MCP protocol-level error
|
|
713
|
+
* response. Otherwise, the LLM would not be able to see that an error occurred
|
|
714
|
+
* and self-correct.
|
|
715
|
+
*
|
|
716
|
+
* However, any errors in _finding_ the tool, an error indicating that the
|
|
717
|
+
* server does not support tool calls, or any other exceptional conditions,
|
|
718
|
+
* should be reported as an MCP error response.
|
|
719
|
+
*/
|
|
720
|
+
isError: optional(boolean())
|
|
721
|
+
});
|
|
722
|
+
CallToolResultSchema.or(ResultSchema.extend({
|
|
723
|
+
toolResult: unknown()
|
|
724
|
+
}));
|
|
725
|
+
const CallToolRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
726
|
+
/**
|
|
727
|
+
* The name of the tool to call.
|
|
728
|
+
*/
|
|
729
|
+
name: string(),
|
|
730
|
+
/**
|
|
731
|
+
* Arguments to pass to the tool.
|
|
732
|
+
*/
|
|
733
|
+
arguments: optional(record(string(), unknown()))
|
|
734
|
+
});
|
|
735
|
+
const CallToolRequestSchema = RequestSchema.extend({
|
|
736
|
+
method: literal("tools/call"),
|
|
737
|
+
params: CallToolRequestParamsSchema
|
|
738
|
+
});
|
|
739
|
+
const ToolListChangedNotificationSchema = NotificationSchema.extend({
|
|
740
|
+
method: literal("notifications/tools/list_changed")
|
|
741
|
+
});
|
|
742
|
+
const LoggingLevelSchema = _enum(["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]);
|
|
743
|
+
const SetLevelRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
744
|
+
/**
|
|
745
|
+
* 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.
|
|
746
|
+
*/
|
|
747
|
+
level: LoggingLevelSchema
|
|
748
|
+
});
|
|
749
|
+
const SetLevelRequestSchema = RequestSchema.extend({
|
|
750
|
+
method: literal("logging/setLevel"),
|
|
751
|
+
params: SetLevelRequestParamsSchema
|
|
752
|
+
});
|
|
753
|
+
const LoggingMessageNotificationParamsSchema = NotificationsParamsSchema.extend({
|
|
754
|
+
/**
|
|
755
|
+
* The severity of this log message.
|
|
756
|
+
*/
|
|
757
|
+
level: LoggingLevelSchema,
|
|
758
|
+
/**
|
|
759
|
+
* An optional name of the logger issuing this message.
|
|
760
|
+
*/
|
|
761
|
+
logger: string().optional(),
|
|
762
|
+
/**
|
|
763
|
+
* The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here.
|
|
764
|
+
*/
|
|
765
|
+
data: unknown()
|
|
766
|
+
});
|
|
767
|
+
const LoggingMessageNotificationSchema = NotificationSchema.extend({
|
|
768
|
+
method: literal("notifications/message"),
|
|
769
|
+
params: LoggingMessageNotificationParamsSchema
|
|
770
|
+
});
|
|
771
|
+
const ModelHintSchema = object({
|
|
772
|
+
/**
|
|
773
|
+
* A hint for a model name.
|
|
774
|
+
*/
|
|
775
|
+
name: string().optional()
|
|
776
|
+
});
|
|
777
|
+
const ModelPreferencesSchema = object({
|
|
778
|
+
/**
|
|
779
|
+
* Optional hints to use for model selection.
|
|
780
|
+
*/
|
|
781
|
+
hints: optional(array(ModelHintSchema)),
|
|
782
|
+
/**
|
|
783
|
+
* How much to prioritize cost when selecting a model.
|
|
784
|
+
*/
|
|
785
|
+
costPriority: optional(number().min(0).max(1)),
|
|
786
|
+
/**
|
|
787
|
+
* How much to prioritize sampling speed (latency) when selecting a model.
|
|
788
|
+
*/
|
|
789
|
+
speedPriority: optional(number().min(0).max(1)),
|
|
790
|
+
/**
|
|
791
|
+
* How much to prioritize intelligence and capabilities when selecting a model.
|
|
792
|
+
*/
|
|
793
|
+
intelligencePriority: optional(number().min(0).max(1))
|
|
794
|
+
});
|
|
795
|
+
const ToolChoiceSchema = object({
|
|
796
|
+
/**
|
|
797
|
+
* Controls when tools are used:
|
|
798
|
+
* - "auto": Model decides whether to use tools (default)
|
|
799
|
+
* - "required": Model MUST use at least one tool before completing
|
|
800
|
+
* - "none": Model MUST NOT use any tools
|
|
801
|
+
*/
|
|
802
|
+
mode: optional(_enum(["auto", "required", "none"]))
|
|
803
|
+
});
|
|
804
|
+
const ToolResultContentSchema = object({
|
|
805
|
+
type: literal("tool_result"),
|
|
806
|
+
toolUseId: string().describe("The unique identifier for the corresponding tool call."),
|
|
807
|
+
content: array(ContentBlockSchema).default([]),
|
|
808
|
+
structuredContent: object({}).passthrough().optional(),
|
|
809
|
+
isError: optional(boolean()),
|
|
810
|
+
/**
|
|
811
|
+
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
812
|
+
* for notes on _meta usage.
|
|
813
|
+
*/
|
|
814
|
+
_meta: optional(object({}).passthrough())
|
|
815
|
+
}).passthrough();
|
|
816
|
+
const SamplingMessageContentBlockSchema = discriminatedUnion("type", [
|
|
817
|
+
TextContentSchema,
|
|
818
|
+
ImageContentSchema,
|
|
819
|
+
AudioContentSchema,
|
|
820
|
+
ToolUseContentSchema,
|
|
821
|
+
ToolResultContentSchema
|
|
822
|
+
]);
|
|
823
|
+
const SamplingMessageSchema = object({
|
|
824
|
+
role: _enum(["user", "assistant"]),
|
|
825
|
+
content: union([SamplingMessageContentBlockSchema, array(SamplingMessageContentBlockSchema)]),
|
|
826
|
+
/**
|
|
827
|
+
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
828
|
+
* for notes on _meta usage.
|
|
829
|
+
*/
|
|
830
|
+
_meta: optional(object({}).passthrough())
|
|
831
|
+
}).passthrough();
|
|
832
|
+
const CreateMessageRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
833
|
+
messages: array(SamplingMessageSchema),
|
|
834
|
+
/**
|
|
835
|
+
* The server's preferences for which model to select. The client MAY modify or omit this request.
|
|
836
|
+
*/
|
|
837
|
+
modelPreferences: ModelPreferencesSchema.optional(),
|
|
838
|
+
/**
|
|
839
|
+
* An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.
|
|
840
|
+
*/
|
|
841
|
+
systemPrompt: string().optional(),
|
|
842
|
+
/**
|
|
843
|
+
* A request to include context from one or more MCP servers (including the caller), to be attached to the prompt.
|
|
844
|
+
* The client MAY ignore this request.
|
|
845
|
+
*
|
|
846
|
+
* Default is "none". Values "thisServer" and "allServers" are soft-deprecated. Servers SHOULD only use these values if the client
|
|
847
|
+
* declares ClientCapabilities.sampling.context. These values may be removed in future spec releases.
|
|
848
|
+
*/
|
|
849
|
+
includeContext: _enum(["none", "thisServer", "allServers"]).optional(),
|
|
850
|
+
temperature: number().optional(),
|
|
851
|
+
/**
|
|
852
|
+
* The requested maximum number of tokens to sample (to prevent runaway completions).
|
|
853
|
+
*
|
|
854
|
+
* The client MAY choose to sample fewer tokens than the requested maximum.
|
|
855
|
+
*/
|
|
856
|
+
maxTokens: number().int(),
|
|
857
|
+
stopSequences: array(string()).optional(),
|
|
858
|
+
/**
|
|
859
|
+
* Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.
|
|
860
|
+
*/
|
|
861
|
+
metadata: AssertObjectSchema.optional(),
|
|
862
|
+
/**
|
|
863
|
+
* Tools that the model may use during generation.
|
|
864
|
+
* The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.
|
|
865
|
+
*/
|
|
866
|
+
tools: optional(array(ToolSchema)),
|
|
867
|
+
/**
|
|
868
|
+
* Controls how the model uses tools.
|
|
869
|
+
* The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.
|
|
870
|
+
* Default is `{ mode: "auto" }`.
|
|
871
|
+
*/
|
|
872
|
+
toolChoice: optional(ToolChoiceSchema)
|
|
873
|
+
});
|
|
874
|
+
const CreateMessageRequestSchema = RequestSchema.extend({
|
|
875
|
+
method: literal("sampling/createMessage"),
|
|
876
|
+
params: CreateMessageRequestParamsSchema
|
|
877
|
+
});
|
|
878
|
+
const CreateMessageResultSchema = ResultSchema.extend({
|
|
879
|
+
/**
|
|
880
|
+
* The name of the model that generated the message.
|
|
881
|
+
*/
|
|
882
|
+
model: string(),
|
|
883
|
+
/**
|
|
884
|
+
* The reason why sampling stopped, if known.
|
|
885
|
+
*
|
|
886
|
+
* Standard values:
|
|
887
|
+
* - "endTurn": Natural end of the assistant's turn
|
|
888
|
+
* - "stopSequence": A stop sequence was encountered
|
|
889
|
+
* - "maxTokens": Maximum token limit was reached
|
|
890
|
+
* - "toolUse": The model wants to use one or more tools
|
|
891
|
+
*
|
|
892
|
+
* This field is an open string to allow for provider-specific stop reasons.
|
|
893
|
+
*/
|
|
894
|
+
stopReason: optional(_enum(["endTurn", "stopSequence", "maxTokens", "toolUse"]).or(string())),
|
|
895
|
+
role: _enum(["user", "assistant"]),
|
|
896
|
+
/**
|
|
897
|
+
* Response content. May be ToolUseContent if stopReason is "toolUse".
|
|
898
|
+
*/
|
|
899
|
+
content: union([SamplingMessageContentBlockSchema, array(SamplingMessageContentBlockSchema)])
|
|
900
|
+
});
|
|
901
|
+
const BooleanSchemaSchema = object({
|
|
902
|
+
type: literal("boolean"),
|
|
903
|
+
title: string().optional(),
|
|
904
|
+
description: string().optional(),
|
|
905
|
+
default: boolean().optional()
|
|
906
|
+
});
|
|
907
|
+
const StringSchemaSchema = object({
|
|
908
|
+
type: literal("string"),
|
|
909
|
+
title: string().optional(),
|
|
910
|
+
description: string().optional(),
|
|
911
|
+
minLength: number().optional(),
|
|
912
|
+
maxLength: number().optional(),
|
|
913
|
+
format: _enum(["email", "uri", "date", "date-time"]).optional(),
|
|
914
|
+
default: string().optional()
|
|
915
|
+
});
|
|
916
|
+
const NumberSchemaSchema = object({
|
|
917
|
+
type: _enum(["number", "integer"]),
|
|
918
|
+
title: string().optional(),
|
|
919
|
+
description: string().optional(),
|
|
920
|
+
minimum: number().optional(),
|
|
921
|
+
maximum: number().optional(),
|
|
922
|
+
default: number().optional()
|
|
923
|
+
});
|
|
924
|
+
const UntitledSingleSelectEnumSchemaSchema = object({
|
|
925
|
+
type: literal("string"),
|
|
926
|
+
title: string().optional(),
|
|
927
|
+
description: string().optional(),
|
|
928
|
+
enum: array(string()),
|
|
929
|
+
default: string().optional()
|
|
930
|
+
});
|
|
931
|
+
const TitledSingleSelectEnumSchemaSchema = object({
|
|
932
|
+
type: literal("string"),
|
|
933
|
+
title: string().optional(),
|
|
934
|
+
description: string().optional(),
|
|
935
|
+
oneOf: array(object({
|
|
936
|
+
const: string(),
|
|
937
|
+
title: string()
|
|
938
|
+
})),
|
|
939
|
+
default: string().optional()
|
|
940
|
+
});
|
|
941
|
+
const LegacyTitledEnumSchemaSchema = object({
|
|
942
|
+
type: literal("string"),
|
|
943
|
+
title: string().optional(),
|
|
944
|
+
description: string().optional(),
|
|
945
|
+
enum: array(string()),
|
|
946
|
+
enumNames: array(string()).optional(),
|
|
947
|
+
default: string().optional()
|
|
948
|
+
});
|
|
949
|
+
const SingleSelectEnumSchemaSchema = union([UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema]);
|
|
950
|
+
const UntitledMultiSelectEnumSchemaSchema = object({
|
|
951
|
+
type: literal("array"),
|
|
952
|
+
title: string().optional(),
|
|
953
|
+
description: string().optional(),
|
|
954
|
+
minItems: number().optional(),
|
|
955
|
+
maxItems: number().optional(),
|
|
956
|
+
items: object({
|
|
957
|
+
type: literal("string"),
|
|
958
|
+
enum: array(string())
|
|
959
|
+
}),
|
|
960
|
+
default: array(string()).optional()
|
|
961
|
+
});
|
|
962
|
+
const TitledMultiSelectEnumSchemaSchema = object({
|
|
963
|
+
type: literal("array"),
|
|
964
|
+
title: string().optional(),
|
|
965
|
+
description: string().optional(),
|
|
966
|
+
minItems: number().optional(),
|
|
967
|
+
maxItems: number().optional(),
|
|
968
|
+
items: object({
|
|
969
|
+
anyOf: array(object({
|
|
970
|
+
const: string(),
|
|
971
|
+
title: string()
|
|
972
|
+
}))
|
|
973
|
+
}),
|
|
974
|
+
default: array(string()).optional()
|
|
975
|
+
});
|
|
976
|
+
const MultiSelectEnumSchemaSchema = union([UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema]);
|
|
977
|
+
const EnumSchemaSchema = union([LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema]);
|
|
978
|
+
const PrimitiveSchemaDefinitionSchema = union([EnumSchemaSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema]);
|
|
979
|
+
const ElicitRequestFormParamsSchema = BaseRequestParamsSchema.extend({
|
|
980
|
+
/**
|
|
981
|
+
* The elicitation mode.
|
|
982
|
+
*
|
|
983
|
+
* Optional for backward compatibility. Clients MUST treat missing mode as "form".
|
|
984
|
+
*/
|
|
985
|
+
mode: literal("form").optional(),
|
|
986
|
+
/**
|
|
987
|
+
* The message to present to the user describing what information is being requested.
|
|
988
|
+
*/
|
|
989
|
+
message: string(),
|
|
990
|
+
/**
|
|
991
|
+
* A restricted subset of JSON Schema.
|
|
992
|
+
* Only top-level properties are allowed, without nesting.
|
|
993
|
+
*/
|
|
994
|
+
requestedSchema: object({
|
|
995
|
+
type: literal("object"),
|
|
996
|
+
properties: record(string(), PrimitiveSchemaDefinitionSchema),
|
|
997
|
+
required: array(string()).optional()
|
|
998
|
+
})
|
|
999
|
+
});
|
|
1000
|
+
const ElicitRequestURLParamsSchema = BaseRequestParamsSchema.extend({
|
|
1001
|
+
/**
|
|
1002
|
+
* The elicitation mode.
|
|
1003
|
+
*/
|
|
1004
|
+
mode: literal("url"),
|
|
1005
|
+
/**
|
|
1006
|
+
* The message to present to the user explaining why the interaction is needed.
|
|
1007
|
+
*/
|
|
1008
|
+
message: string(),
|
|
1009
|
+
/**
|
|
1010
|
+
* The ID of the elicitation, which must be unique within the context of the server.
|
|
1011
|
+
* The client MUST treat this ID as an opaque value.
|
|
1012
|
+
*/
|
|
1013
|
+
elicitationId: string(),
|
|
1014
|
+
/**
|
|
1015
|
+
* The URL that the user should navigate to.
|
|
1016
|
+
*/
|
|
1017
|
+
url: string().url()
|
|
1018
|
+
});
|
|
1019
|
+
const ElicitRequestParamsSchema = union([ElicitRequestFormParamsSchema, ElicitRequestURLParamsSchema]);
|
|
1020
|
+
const ElicitRequestSchema = RequestSchema.extend({
|
|
1021
|
+
method: literal("elicitation/create"),
|
|
1022
|
+
params: ElicitRequestParamsSchema
|
|
1023
|
+
});
|
|
1024
|
+
const ElicitationCompleteNotificationParamsSchema = NotificationsParamsSchema.extend({
|
|
1025
|
+
/**
|
|
1026
|
+
* The ID of the elicitation that completed.
|
|
1027
|
+
*/
|
|
1028
|
+
elicitationId: string()
|
|
1029
|
+
});
|
|
1030
|
+
const ElicitationCompleteNotificationSchema = NotificationSchema.extend({
|
|
1031
|
+
method: literal("notifications/elicitation/complete"),
|
|
1032
|
+
params: ElicitationCompleteNotificationParamsSchema
|
|
1033
|
+
});
|
|
1034
|
+
const ElicitResultSchema = ResultSchema.extend({
|
|
1035
|
+
/**
|
|
1036
|
+
* The user action in response to the elicitation.
|
|
1037
|
+
* - "accept": User submitted the form/confirmed the action
|
|
1038
|
+
* - "decline": User explicitly decline the action
|
|
1039
|
+
* - "cancel": User dismissed without making an explicit choice
|
|
1040
|
+
*/
|
|
1041
|
+
action: _enum(["accept", "decline", "cancel"]),
|
|
1042
|
+
/**
|
|
1043
|
+
* The submitted form data, only present when action is "accept".
|
|
1044
|
+
* Contains values matching the requested schema.
|
|
1045
|
+
*/
|
|
1046
|
+
content: record(string(), union([string(), number(), boolean(), array(string())])).optional()
|
|
1047
|
+
});
|
|
1048
|
+
const ResourceTemplateReferenceSchema = object({
|
|
1049
|
+
type: literal("ref/resource"),
|
|
1050
|
+
/**
|
|
1051
|
+
* The URI or URI template of the resource.
|
|
1052
|
+
*/
|
|
1053
|
+
uri: string()
|
|
1054
|
+
});
|
|
1055
|
+
const PromptReferenceSchema = object({
|
|
1056
|
+
type: literal("ref/prompt"),
|
|
1057
|
+
/**
|
|
1058
|
+
* The name of the prompt or prompt template
|
|
1059
|
+
*/
|
|
1060
|
+
name: string()
|
|
1061
|
+
});
|
|
1062
|
+
const CompleteRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
1063
|
+
ref: union([PromptReferenceSchema, ResourceTemplateReferenceSchema]),
|
|
1064
|
+
/**
|
|
1065
|
+
* The argument's information
|
|
1066
|
+
*/
|
|
1067
|
+
argument: object({
|
|
1068
|
+
/**
|
|
1069
|
+
* The name of the argument
|
|
1070
|
+
*/
|
|
1071
|
+
name: string(),
|
|
1072
|
+
/**
|
|
1073
|
+
* The value of the argument to use for completion matching.
|
|
1074
|
+
*/
|
|
1075
|
+
value: string()
|
|
1076
|
+
}),
|
|
1077
|
+
context: object({
|
|
1078
|
+
/**
|
|
1079
|
+
* Previously-resolved variables in a URI template or prompt.
|
|
1080
|
+
*/
|
|
1081
|
+
arguments: record(string(), string()).optional()
|
|
1082
|
+
}).optional()
|
|
1083
|
+
});
|
|
1084
|
+
const CompleteRequestSchema = RequestSchema.extend({
|
|
1085
|
+
method: literal("completion/complete"),
|
|
1086
|
+
params: CompleteRequestParamsSchema
|
|
1087
|
+
});
|
|
1088
|
+
const CompleteResultSchema = ResultSchema.extend({
|
|
1089
|
+
completion: looseObject({
|
|
1090
|
+
/**
|
|
1091
|
+
* An array of completion values. Must not exceed 100 items.
|
|
1092
|
+
*/
|
|
1093
|
+
values: array(string()).max(100),
|
|
1094
|
+
/**
|
|
1095
|
+
* The total number of completion options available. This can exceed the number of values actually sent in the response.
|
|
1096
|
+
*/
|
|
1097
|
+
total: optional(number().int()),
|
|
1098
|
+
/**
|
|
1099
|
+
* Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown.
|
|
1100
|
+
*/
|
|
1101
|
+
hasMore: optional(boolean())
|
|
1102
|
+
})
|
|
1103
|
+
});
|
|
1104
|
+
const RootSchema = object({
|
|
1105
|
+
/**
|
|
1106
|
+
* The URI identifying the root. This *must* start with file:// for now.
|
|
1107
|
+
*/
|
|
1108
|
+
uri: string().startsWith("file://"),
|
|
1109
|
+
/**
|
|
1110
|
+
* An optional name for the root.
|
|
1111
|
+
*/
|
|
1112
|
+
name: string().optional(),
|
|
1113
|
+
/**
|
|
1114
|
+
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
1115
|
+
* for notes on _meta usage.
|
|
1116
|
+
*/
|
|
1117
|
+
_meta: record(string(), unknown()).optional()
|
|
1118
|
+
});
|
|
1119
|
+
const ListRootsRequestSchema = RequestSchema.extend({
|
|
1120
|
+
method: literal("roots/list")
|
|
1121
|
+
});
|
|
1122
|
+
const ListRootsResultSchema = ResultSchema.extend({
|
|
1123
|
+
roots: array(RootSchema)
|
|
1124
|
+
});
|
|
1125
|
+
const RootsListChangedNotificationSchema = NotificationSchema.extend({
|
|
1126
|
+
method: literal("notifications/roots/list_changed")
|
|
1127
|
+
});
|
|
1128
|
+
union([
|
|
1129
|
+
PingRequestSchema,
|
|
1130
|
+
InitializeRequestSchema,
|
|
1131
|
+
CompleteRequestSchema,
|
|
1132
|
+
SetLevelRequestSchema,
|
|
1133
|
+
GetPromptRequestSchema,
|
|
1134
|
+
ListPromptsRequestSchema,
|
|
1135
|
+
ListResourcesRequestSchema,
|
|
1136
|
+
ListResourceTemplatesRequestSchema,
|
|
1137
|
+
ReadResourceRequestSchema,
|
|
1138
|
+
SubscribeRequestSchema,
|
|
1139
|
+
UnsubscribeRequestSchema,
|
|
1140
|
+
CallToolRequestSchema,
|
|
1141
|
+
ListToolsRequestSchema
|
|
1142
|
+
]);
|
|
1143
|
+
union([
|
|
1144
|
+
CancelledNotificationSchema,
|
|
1145
|
+
ProgressNotificationSchema,
|
|
1146
|
+
InitializedNotificationSchema,
|
|
1147
|
+
RootsListChangedNotificationSchema
|
|
1148
|
+
]);
|
|
1149
|
+
union([EmptyResultSchema, CreateMessageResultSchema, ElicitResultSchema, ListRootsResultSchema]);
|
|
1150
|
+
union([PingRequestSchema, CreateMessageRequestSchema, ElicitRequestSchema, ListRootsRequestSchema]);
|
|
1151
|
+
union([
|
|
1152
|
+
CancelledNotificationSchema,
|
|
1153
|
+
ProgressNotificationSchema,
|
|
1154
|
+
LoggingMessageNotificationSchema,
|
|
1155
|
+
ResourceUpdatedNotificationSchema,
|
|
1156
|
+
ResourceListChangedNotificationSchema,
|
|
1157
|
+
ToolListChangedNotificationSchema,
|
|
1158
|
+
PromptListChangedNotificationSchema,
|
|
1159
|
+
ElicitationCompleteNotificationSchema
|
|
1160
|
+
]);
|
|
1161
|
+
union([
|
|
1162
|
+
EmptyResultSchema,
|
|
1163
|
+
InitializeResultSchema,
|
|
1164
|
+
CompleteResultSchema,
|
|
1165
|
+
GetPromptResultSchema,
|
|
1166
|
+
ListPromptsResultSchema,
|
|
1167
|
+
ListResourcesResultSchema,
|
|
1168
|
+
ListResourceTemplatesResultSchema,
|
|
1169
|
+
ReadResourceResultSchema,
|
|
1170
|
+
CallToolResultSchema,
|
|
1171
|
+
ListToolsResultSchema
|
|
1172
|
+
]);
|
|
1173
|
+
class McpError extends Error {
|
|
1174
|
+
constructor(code, message, data) {
|
|
1175
|
+
super(`MCP error ${code}: ${message}`);
|
|
1176
|
+
this.code = code;
|
|
1177
|
+
this.data = data;
|
|
1178
|
+
this.name = "McpError";
|
|
1179
|
+
}
|
|
1180
|
+
/**
|
|
1181
|
+
* Factory method to create the appropriate error type based on the error code and data
|
|
1182
|
+
*/
|
|
1183
|
+
static fromError(code, message, data) {
|
|
1184
|
+
if (code === ErrorCode.UrlElicitationRequired && data) {
|
|
1185
|
+
const errorData = data;
|
|
1186
|
+
if (errorData.elicitations) {
|
|
1187
|
+
return new UrlElicitationRequiredError(errorData.elicitations, message);
|
|
1188
|
+
}
|
|
1189
|
+
}
|
|
1190
|
+
return new McpError(code, message, data);
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1193
|
+
class UrlElicitationRequiredError extends McpError {
|
|
1194
|
+
constructor(elicitations, message = `URL elicitation${elicitations.length > 1 ? "s" : ""} required`) {
|
|
1195
|
+
super(ErrorCode.UrlElicitationRequired, message, {
|
|
1196
|
+
elicitations
|
|
1197
|
+
});
|
|
1198
|
+
}
|
|
1199
|
+
get elicitations() {
|
|
1200
|
+
var _a, _b;
|
|
1201
|
+
return (_b = (_a = this.data) === null || _a === void 0 ? void 0 : _a.elicitations) !== null && _b !== void 0 ? _b : [];
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
export {
|
|
1205
|
+
AudioContentSchema,
|
|
1206
|
+
BaseMetadataSchema,
|
|
1207
|
+
BlobResourceContentsSchema,
|
|
1208
|
+
BooleanSchemaSchema,
|
|
1209
|
+
CallToolRequestParamsSchema,
|
|
1210
|
+
CallToolRequestSchema,
|
|
1211
|
+
CallToolResultSchema,
|
|
1212
|
+
CancelledNotificationParamsSchema,
|
|
1213
|
+
CancelledNotificationSchema,
|
|
1214
|
+
ClientCapabilitiesSchema,
|
|
1215
|
+
CompleteRequestParamsSchema,
|
|
1216
|
+
CompleteRequestSchema,
|
|
1217
|
+
CompleteResultSchema,
|
|
1218
|
+
ContentBlockSchema,
|
|
1219
|
+
CreateMessageRequestParamsSchema,
|
|
1220
|
+
CreateMessageRequestSchema,
|
|
1221
|
+
CreateMessageResultSchema,
|
|
1222
|
+
CursorSchema,
|
|
1223
|
+
ElicitRequestFormParamsSchema,
|
|
1224
|
+
ElicitRequestParamsSchema,
|
|
1225
|
+
ElicitRequestSchema,
|
|
1226
|
+
ElicitRequestURLParamsSchema,
|
|
1227
|
+
ElicitResultSchema,
|
|
1228
|
+
ElicitationCompleteNotificationParamsSchema,
|
|
1229
|
+
ElicitationCompleteNotificationSchema,
|
|
1230
|
+
EmbeddedResourceSchema,
|
|
1231
|
+
EmptyResultSchema,
|
|
1232
|
+
EnumSchemaSchema,
|
|
1233
|
+
ErrorCode,
|
|
1234
|
+
GetPromptRequestParamsSchema,
|
|
1235
|
+
GetPromptRequestSchema,
|
|
1236
|
+
GetPromptResultSchema,
|
|
1237
|
+
IconSchema,
|
|
1238
|
+
IconsSchema,
|
|
1239
|
+
ImageContentSchema,
|
|
1240
|
+
ImplementationSchema,
|
|
1241
|
+
InitializeRequestParamsSchema,
|
|
1242
|
+
InitializeRequestSchema,
|
|
1243
|
+
InitializeResultSchema,
|
|
1244
|
+
InitializedNotificationSchema,
|
|
1245
|
+
JSONRPCErrorSchema,
|
|
1246
|
+
JSONRPCNotificationSchema,
|
|
1247
|
+
JSONRPCRequestSchema,
|
|
1248
|
+
JSONRPCResponseSchema,
|
|
1249
|
+
JSONRPC_VERSION,
|
|
1250
|
+
LATEST_PROTOCOL_VERSION,
|
|
1251
|
+
LegacyTitledEnumSchemaSchema,
|
|
1252
|
+
ListPromptsRequestSchema,
|
|
1253
|
+
ListPromptsResultSchema,
|
|
1254
|
+
ListResourceTemplatesRequestSchema,
|
|
1255
|
+
ListResourceTemplatesResultSchema,
|
|
1256
|
+
ListResourcesRequestSchema,
|
|
1257
|
+
ListResourcesResultSchema,
|
|
1258
|
+
ListRootsRequestSchema,
|
|
1259
|
+
ListRootsResultSchema,
|
|
1260
|
+
ListToolsRequestSchema,
|
|
1261
|
+
ListToolsResultSchema,
|
|
1262
|
+
LoggingLevelSchema,
|
|
1263
|
+
LoggingMessageNotificationParamsSchema,
|
|
1264
|
+
LoggingMessageNotificationSchema,
|
|
1265
|
+
McpError,
|
|
1266
|
+
ModelHintSchema,
|
|
1267
|
+
ModelPreferencesSchema,
|
|
1268
|
+
MultiSelectEnumSchemaSchema,
|
|
1269
|
+
NotificationSchema,
|
|
1270
|
+
NumberSchemaSchema,
|
|
1271
|
+
PaginatedRequestParamsSchema,
|
|
1272
|
+
PaginatedRequestSchema,
|
|
1273
|
+
PaginatedResultSchema,
|
|
1274
|
+
PingRequestSchema,
|
|
1275
|
+
PrimitiveSchemaDefinitionSchema,
|
|
1276
|
+
ProgressNotificationParamsSchema,
|
|
1277
|
+
ProgressNotificationSchema,
|
|
1278
|
+
ProgressSchema,
|
|
1279
|
+
ProgressTokenSchema,
|
|
1280
|
+
PromptArgumentSchema,
|
|
1281
|
+
PromptListChangedNotificationSchema,
|
|
1282
|
+
PromptMessageSchema,
|
|
1283
|
+
PromptReferenceSchema,
|
|
1284
|
+
PromptSchema,
|
|
1285
|
+
ReadResourceRequestParamsSchema,
|
|
1286
|
+
ReadResourceRequestSchema,
|
|
1287
|
+
ReadResourceResultSchema,
|
|
1288
|
+
RequestIdSchema,
|
|
1289
|
+
RequestSchema,
|
|
1290
|
+
ResourceContentsSchema,
|
|
1291
|
+
ResourceLinkSchema,
|
|
1292
|
+
ResourceListChangedNotificationSchema,
|
|
1293
|
+
ResourceRequestParamsSchema,
|
|
1294
|
+
ResourceSchema,
|
|
1295
|
+
ResourceTemplateReferenceSchema,
|
|
1296
|
+
ResourceTemplateSchema,
|
|
1297
|
+
ResourceUpdatedNotificationParamsSchema,
|
|
1298
|
+
ResourceUpdatedNotificationSchema,
|
|
1299
|
+
ResultSchema,
|
|
1300
|
+
RootSchema,
|
|
1301
|
+
RootsListChangedNotificationSchema,
|
|
1302
|
+
SUPPORTED_PROTOCOL_VERSIONS,
|
|
1303
|
+
SamplingMessageContentBlockSchema,
|
|
1304
|
+
SamplingMessageSchema,
|
|
1305
|
+
ServerCapabilitiesSchema,
|
|
1306
|
+
SetLevelRequestParamsSchema,
|
|
1307
|
+
SetLevelRequestSchema,
|
|
1308
|
+
SingleSelectEnumSchemaSchema,
|
|
1309
|
+
StringSchemaSchema,
|
|
1310
|
+
SubscribeRequestParamsSchema,
|
|
1311
|
+
SubscribeRequestSchema,
|
|
1312
|
+
TextContentSchema,
|
|
1313
|
+
TextResourceContentsSchema,
|
|
1314
|
+
TitledMultiSelectEnumSchemaSchema,
|
|
1315
|
+
TitledSingleSelectEnumSchemaSchema,
|
|
1316
|
+
ToolAnnotationsSchema,
|
|
1317
|
+
ToolChoiceSchema,
|
|
1318
|
+
ToolListChangedNotificationSchema,
|
|
1319
|
+
ToolResultContentSchema,
|
|
1320
|
+
ToolSchema,
|
|
1321
|
+
ToolUseContentSchema,
|
|
1322
|
+
UnsubscribeRequestParamsSchema,
|
|
1323
|
+
UnsubscribeRequestSchema,
|
|
1324
|
+
UntitledMultiSelectEnumSchemaSchema,
|
|
1325
|
+
UntitledSingleSelectEnumSchemaSchema,
|
|
1326
|
+
UrlElicitationRequiredError,
|
|
1327
|
+
isJSONRPCError,
|
|
1328
|
+
isJSONRPCNotification,
|
|
1329
|
+
isJSONRPCRequest,
|
|
1330
|
+
isJSONRPCResponse
|
|
1331
|
+
};
|
|
1332
|
+
//# sourceMappingURL=types.js.map
|