effect 4.0.7 → 4.1.1
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 +31 -1
- package/THIRD_PARTY_NOTICES.md +62 -0
- package/dist/BigDecimal.d.ts +139 -7
- package/dist/BigDecimal.d.ts.map +1 -1
- package/dist/BigDecimal.js +86 -14
- package/dist/BigDecimal.js.map +1 -1
- package/dist/Channel.d.ts +12 -6
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +9 -3
- package/dist/Channel.js.map +1 -1
- package/dist/Config.d.ts +7 -1
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js.map +1 -1
- package/dist/Context.d.ts +18 -1
- package/dist/Context.d.ts.map +1 -1
- package/dist/Context.js +27 -8
- package/dist/Context.js.map +1 -1
- package/dist/Cron.d.ts +81 -11
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +101 -26
- package/dist/Cron.js.map +1 -1
- package/dist/Duration.d.ts +78 -0
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +123 -0
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +164 -7
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +11 -1
- package/dist/Effect.js.map +1 -1
- package/dist/Equal.d.ts +2 -2
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equal.js +3 -3
- package/dist/Equal.js.map +1 -1
- package/dist/FileSystem.d.ts +59 -4
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +9 -2
- package/dist/FileSystem.js.map +1 -1
- package/dist/Glob.d.ts +165 -0
- package/dist/Glob.d.ts.map +1 -0
- package/dist/Glob.js +127 -0
- package/dist/Glob.js.map +1 -0
- package/dist/Hash.d.ts +3 -2
- package/dist/Hash.d.ts.map +1 -1
- package/dist/Hash.js +5 -4
- package/dist/Hash.js.map +1 -1
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +11 -8
- package/dist/Iterable.js.map +1 -1
- package/dist/Match.d.ts +86 -0
- package/dist/Match.d.ts.map +1 -1
- package/dist/Match.js +72 -0
- package/dist/Match.js.map +1 -1
- package/dist/Path.d.ts.map +1 -1
- package/dist/Path.js +5 -1
- package/dist/Path.js.map +1 -1
- package/dist/Pool.d.ts +51 -0
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +61 -10
- package/dist/Pool.js.map +1 -1
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +3 -3
- package/dist/Random.js.map +1 -1
- package/dist/RcMap.d.ts.map +1 -1
- package/dist/RcMap.js +8 -2
- package/dist/RcMap.js.map +1 -1
- package/dist/Schedule.d.ts +18 -1
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +7 -2
- package/dist/Schedule.js.map +1 -1
- package/dist/Schema.d.ts +668 -42
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +652 -1
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaGetter.d.ts +6 -1
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +22 -11
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +18 -2
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +20 -2
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +10 -5
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +8 -5
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/ScopedCache.d.ts.map +1 -1
- package/dist/ScopedCache.js +5 -7
- package/dist/ScopedCache.js.map +1 -1
- package/dist/Semaphore.d.ts +130 -0
- package/dist/Semaphore.d.ts.map +1 -1
- package/dist/Semaphore.js +40 -0
- package/dist/Semaphore.js.map +1 -1
- package/dist/Stream.d.ts +13 -4
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +9 -0
- package/dist/Stream.js.map +1 -1
- package/dist/Terminal.d.ts +18 -1
- package/dist/Terminal.d.ts.map +1 -1
- package/dist/Terminal.js +1 -1
- package/dist/Terminal.js.map +1 -1
- package/dist/ai/AiError.d.ts +43 -116
- package/dist/ai/AiError.d.ts.map +1 -1
- package/dist/ai/AiError.js +53 -72
- package/dist/ai/AiError.js.map +1 -1
- package/dist/ai/Decision.d.ts +196 -15
- package/dist/ai/Decision.d.ts.map +1 -1
- package/dist/ai/Decision.js +130 -0
- package/dist/ai/Decision.js.map +1 -1
- package/dist/ai/DecisionModel.d.ts +54 -13
- package/dist/ai/DecisionModel.d.ts.map +1 -1
- package/dist/ai/DecisionModel.js +123 -12
- package/dist/ai/DecisionModel.js.map +1 -1
- package/dist/ai/McpClient.d.ts +171 -19
- package/dist/ai/McpClient.d.ts.map +1 -1
- package/dist/ai/McpClient.js +277 -66
- package/dist/ai/McpClient.js.map +1 -1
- package/dist/ai/McpSchema.d.ts +108 -0
- package/dist/ai/McpSchema.d.ts.map +1 -1
- package/dist/ai/McpSchema.js +99 -0
- package/dist/ai/McpSchema.js.map +1 -1
- package/dist/ai/McpServer.d.ts +744 -29
- package/dist/ai/McpServer.d.ts.map +1 -1
- package/dist/ai/McpServer.js +763 -136
- package/dist/ai/McpServer.js.map +1 -1
- package/dist/ai/McpTest.d.ts +130 -0
- package/dist/ai/McpTest.d.ts.map +1 -0
- package/dist/ai/McpTest.js +237 -0
- package/dist/ai/McpTest.js.map +1 -0
- package/dist/ai/Prompt.d.ts.map +1 -1
- package/dist/ai/Prompt.js +20 -11
- package/dist/ai/Prompt.js.map +1 -1
- package/dist/ai/Response.d.ts +1 -25
- package/dist/ai/Response.d.ts.map +1 -1
- package/dist/ai/Response.js +1 -10
- package/dist/ai/Response.js.map +1 -1
- package/dist/ai/Tool.d.ts +19 -1
- package/dist/ai/Tool.d.ts.map +1 -1
- package/dist/ai/Tool.js +5 -7
- package/dist/ai/Tool.js.map +1 -1
- package/dist/ai/index.d.ts +5 -0
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +5 -0
- package/dist/ai/index.js.map +1 -1
- package/dist/ai/internal/mcpCore.js +89 -15
- package/dist/ai/internal/mcpCore.js.map +1 -1
- package/dist/ai/internal/mcpProtocol/v2024_11_05.js +7 -6
- package/dist/ai/internal/mcpProtocol/v2024_11_05.js.map +1 -1
- package/dist/ai/internal/mcpProtocol/v2025_03_26.js +7 -6
- package/dist/ai/internal/mcpProtocol/v2025_03_26.js.map +1 -1
- package/dist/ai/internal/mcpProtocol/v2025_06_18.js +7 -6
- package/dist/ai/internal/mcpProtocol/v2025_06_18.js.map +1 -1
- package/dist/ai/internal/mcpProtocol/v2025_11_25.js +7 -6
- package/dist/ai/internal/mcpProtocol/v2025_11_25.js.map +1 -1
- package/dist/ai/internal/mcpProtocol/v2026_07_28.js +60 -17
- package/dist/ai/internal/mcpProtocol/v2026_07_28.js.map +1 -1
- package/dist/ai/internal/mcpProtocol.js +25 -0
- package/dist/ai/internal/mcpProtocol.js.map +1 -1
- package/dist/ai/internal/mcpRuntime.js +8 -6
- package/dist/ai/internal/mcpRuntime.js.map +1 -1
- package/dist/ai/internal/mcpSkills.d.ts +2 -0
- package/dist/ai/internal/mcpSkills.d.ts.map +1 -0
- package/dist/ai/internal/mcpSkills.js +428 -0
- package/dist/ai/internal/mcpSkills.js.map +1 -0
- package/dist/ai/internal/mcpStatefulRuntime.js +6 -1
- package/dist/ai/internal/mcpStatefulRuntime.js.map +1 -1
- package/dist/cli/Argument.d.ts +6 -0
- package/dist/cli/Argument.d.ts.map +1 -1
- package/dist/cli/Argument.js +2 -0
- package/dist/cli/Argument.js.map +1 -1
- package/dist/cli/CliOutput.d.ts +65 -1
- package/dist/cli/CliOutput.d.ts.map +1 -1
- package/dist/cli/CliOutput.js +94 -37
- package/dist/cli/CliOutput.js.map +1 -1
- package/dist/cli/Command.d.ts +23 -0
- package/dist/cli/Command.d.ts.map +1 -1
- package/dist/cli/Command.js +8 -0
- package/dist/cli/Command.js.map +1 -1
- package/dist/cli/Flag.d.ts +107 -0
- package/dist/cli/Flag.d.ts.map +1 -1
- package/dist/cli/Flag.js +37 -0
- package/dist/cli/Flag.js.map +1 -1
- package/dist/cli/HelpDoc.d.ts +15 -1
- package/dist/cli/HelpDoc.d.ts.map +1 -1
- package/dist/cli/Param.d.ts +6 -0
- package/dist/cli/Param.d.ts.map +1 -1
- package/dist/cli/Param.js +2 -0
- package/dist/cli/Param.js.map +1 -1
- package/dist/cli/Primitive.d.ts +14 -0
- package/dist/cli/Primitive.d.ts.map +1 -1
- package/dist/cli/Primitive.js +15 -1
- package/dist/cli/Primitive.js.map +1 -1
- package/dist/cli/Prompt.d.ts +1 -0
- package/dist/cli/Prompt.d.ts.map +1 -1
- package/dist/cli/Prompt.js +1 -0
- package/dist/cli/Prompt.js.map +1 -1
- package/dist/cli/internal/help.d.ts.map +1 -1
- package/dist/cli/internal/help.js +17 -10
- package/dist/cli/internal/help.js.map +1 -1
- package/dist/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/cluster/ClusterWorkflowEngine.js +15 -5
- package/dist/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/cluster/Reply.d.ts +1 -1
- package/dist/cluster/Reply.d.ts.map +1 -1
- package/dist/cluster/Reply.js.map +1 -1
- package/dist/cluster/Sharding.d.ts.map +1 -1
- package/dist/cluster/Sharding.js +93 -28
- package/dist/cluster/Sharding.js.map +1 -1
- package/dist/cluster/ShardingConfig.d.ts +72 -6
- package/dist/cluster/ShardingConfig.d.ts.map +1 -1
- package/dist/cluster/ShardingConfig.js +4 -0
- package/dist/cluster/ShardingConfig.js.map +1 -1
- package/dist/cluster/SingleRunner.d.ts +3 -3
- package/dist/cluster/SingleRunner.d.ts.map +1 -1
- package/dist/cluster/SingleRunner.js +1 -1
- package/dist/cluster/SqlMessageStorage.d.ts +37 -6
- package/dist/cluster/SqlMessageStorage.d.ts.map +1 -1
- package/dist/cluster/SqlMessageStorage.js +34 -7
- package/dist/cluster/SqlMessageStorage.js.map +1 -1
- package/dist/cluster/SqlRunnerStorage.d.ts.map +1 -1
- package/dist/cluster/SqlRunnerStorage.js +23 -8
- package/dist/cluster/SqlRunnerStorage.js.map +1 -1
- package/dist/cluster/internal/entityManager.js +15 -7
- package/dist/cluster/internal/entityManager.js.map +1 -1
- package/dist/crypto/Aead.d.ts +323 -0
- package/dist/crypto/Aead.d.ts.map +1 -0
- package/dist/crypto/Aead.js +331 -0
- package/dist/crypto/Aead.js.map +1 -0
- package/dist/crypto/Cipher.d.ts +236 -0
- package/dist/crypto/Cipher.d.ts.map +1 -0
- package/dist/crypto/Cipher.js +233 -0
- package/dist/crypto/Cipher.js.map +1 -0
- package/dist/crypto/CryptoError.d.ts +212 -0
- package/dist/crypto/CryptoError.d.ts.map +1 -0
- package/dist/crypto/CryptoError.js +202 -0
- package/dist/crypto/CryptoError.js.map +1 -0
- package/dist/crypto/Digest.d.ts +143 -0
- package/dist/crypto/Digest.d.ts.map +1 -0
- package/dist/crypto/Digest.js +146 -0
- package/dist/crypto/Digest.js.map +1 -0
- package/dist/crypto/Kdf.d.ts +220 -0
- package/dist/crypto/Kdf.d.ts.map +1 -0
- package/dist/crypto/Kdf.js +212 -0
- package/dist/crypto/Kdf.js.map +1 -0
- package/dist/crypto/KeyAgreement.d.ts +324 -0
- package/dist/crypto/KeyAgreement.d.ts.map +1 -0
- package/dist/crypto/KeyAgreement.js +303 -0
- package/dist/crypto/KeyAgreement.js.map +1 -0
- package/dist/crypto/KeyFormat.d.ts +341 -0
- package/dist/crypto/KeyFormat.d.ts.map +1 -0
- package/dist/crypto/KeyFormat.js +556 -0
- package/dist/crypto/KeyFormat.js.map +1 -0
- package/dist/crypto/KeyWrap.d.ts +390 -0
- package/dist/crypto/KeyWrap.d.ts.map +1 -0
- package/dist/crypto/KeyWrap.js +381 -0
- package/dist/crypto/KeyWrap.js.map +1 -0
- package/dist/crypto/Mac.d.ts +278 -0
- package/dist/crypto/Mac.d.ts.map +1 -0
- package/dist/crypto/Mac.js +288 -0
- package/dist/crypto/Mac.js.map +1 -0
- package/dist/crypto/SecureRandom.d.ts +340 -0
- package/dist/crypto/SecureRandom.d.ts.map +1 -0
- package/dist/crypto/SecureRandom.js +257 -0
- package/dist/crypto/SecureRandom.js.map +1 -0
- package/dist/crypto/Signature.d.ts +449 -0
- package/dist/crypto/Signature.d.ts.map +1 -0
- package/dist/crypto/Signature.js +484 -0
- package/dist/crypto/Signature.js.map +1 -0
- package/dist/crypto/WebCrypto.d.ts +80 -0
- package/dist/crypto/WebCrypto.d.ts.map +1 -0
- package/dist/crypto/WebCrypto.js +63 -0
- package/dist/crypto/WebCrypto.js.map +1 -0
- package/dist/crypto/index.d.ts +65 -0
- package/dist/crypto/index.d.ts.map +1 -0
- package/dist/crypto/index.js +66 -0
- package/dist/crypto/index.js.map +1 -0
- package/dist/crypto/internal/asymmetric.d.ts +2 -0
- package/dist/crypto/internal/asymmetric.d.ts.map +1 -0
- package/dist/crypto/internal/asymmetric.js +210 -0
- package/dist/crypto/internal/asymmetric.js.map +1 -0
- package/dist/crypto/internal/chacha.d.ts +46 -0
- package/dist/crypto/internal/chacha.d.ts.map +1 -0
- package/dist/crypto/internal/chacha.js +885 -0
- package/dist/crypto/internal/chacha.js.map +1 -0
- package/dist/crypto/internal/der.d.ts +6 -0
- package/dist/crypto/internal/der.d.ts.map +1 -0
- package/dist/crypto/internal/der.js +86 -0
- package/dist/crypto/internal/der.js.map +1 -0
- package/dist/crypto/internal/digest.d.ts +2 -0
- package/dist/crypto/internal/digest.d.ts.map +1 -0
- package/dist/crypto/internal/digest.js +15 -0
- package/dist/crypto/internal/digest.js.map +1 -0
- package/dist/crypto/internal/key.d.ts +2 -0
- package/dist/crypto/internal/key.d.ts.map +1 -0
- package/dist/crypto/internal/key.js +171 -0
- package/dist/crypto/internal/key.js.map +1 -0
- package/dist/crypto/internal/md5.d.ts +39 -0
- package/dist/crypto/internal/md5.d.ts.map +1 -0
- package/dist/crypto/internal/md5.js +179 -0
- package/dist/crypto/internal/md5.js.map +1 -0
- package/dist/crypto/internal/webCrypto.d.ts +2 -0
- package/dist/crypto/internal/webCrypto.d.ts.map +1 -0
- package/dist/crypto/internal/webCrypto.js +111 -0
- package/dist/crypto/internal/webCrypto.js.map +1 -0
- package/dist/encoding/Base64Url.d.ts.map +1 -1
- package/dist/encoding/Base64Url.js +29 -5
- package/dist/encoding/Base64Url.js.map +1 -1
- package/dist/encoding/Csv.d.ts +608 -0
- package/dist/encoding/Csv.d.ts.map +1 -0
- package/dist/encoding/Csv.js +718 -0
- package/dist/encoding/Csv.js.map +1 -0
- package/dist/encoding/Hex.d.ts +3 -2
- package/dist/encoding/Hex.d.ts.map +1 -1
- package/dist/encoding/Hex.js +3 -2
- package/dist/encoding/Hex.js.map +1 -1
- package/dist/encoding/Ndjson.d.ts +5 -4
- package/dist/encoding/Ndjson.d.ts.map +1 -1
- package/dist/encoding/Ndjson.js +6 -5
- package/dist/encoding/Ndjson.js.map +1 -1
- package/dist/encoding/SchemaBinary.d.ts.map +1 -1
- package/dist/encoding/SchemaBinary.js +42 -4
- package/dist/encoding/SchemaBinary.js.map +1 -1
- package/dist/encoding/Sse.d.ts +3 -1
- package/dist/encoding/Sse.d.ts.map +1 -1
- package/dist/encoding/Sse.js +5 -3
- package/dist/encoding/Sse.js.map +1 -1
- package/dist/encoding/Toml.d.ts +17 -3
- package/dist/encoding/Toml.d.ts.map +1 -1
- package/dist/encoding/Toml.js +104 -16
- package/dist/encoding/Toml.js.map +1 -1
- package/dist/encoding/Yaml.d.ts +8 -1
- package/dist/encoding/Yaml.d.ts.map +1 -1
- package/dist/encoding/Yaml.js +54 -18
- package/dist/encoding/Yaml.js.map +1 -1
- package/dist/encoding/index.d.ts +5 -0
- package/dist/encoding/index.d.ts.map +1 -1
- package/dist/encoding/index.js +5 -0
- package/dist/encoding/index.js.map +1 -1
- package/dist/eventlog/EventJournal.d.ts.map +1 -1
- package/dist/eventlog/EventJournal.js +6 -3
- package/dist/eventlog/EventJournal.js.map +1 -1
- package/dist/eventlog/EventLog.d.ts +126 -4
- package/dist/eventlog/EventLog.d.ts.map +1 -1
- package/dist/eventlog/EventLog.js +207 -12
- package/dist/eventlog/EventLog.js.map +1 -1
- package/dist/eventlog/EventLogEncryption.d.ts +41 -4
- package/dist/eventlog/EventLogEncryption.d.ts.map +1 -1
- package/dist/eventlog/EventLogEncryption.js +83 -64
- package/dist/eventlog/EventLogEncryption.js.map +1 -1
- package/dist/eventlog/EventLogMessage.d.ts +279 -0
- package/dist/eventlog/EventLogMessage.d.ts.map +1 -1
- package/dist/eventlog/EventLogMessage.js +217 -1
- package/dist/eventlog/EventLogMessage.js.map +1 -1
- package/dist/eventlog/EventLogRemote.d.ts +200 -28
- package/dist/eventlog/EventLogRemote.d.ts.map +1 -1
- package/dist/eventlog/EventLogRemote.js +186 -16
- package/dist/eventlog/EventLogRemote.js.map +1 -1
- package/dist/eventlog/EventLogServer.d.ts +10 -1
- package/dist/eventlog/EventLogServer.d.ts.map +1 -1
- package/dist/eventlog/EventLogServer.js +45 -22
- package/dist/eventlog/EventLogServer.js.map +1 -1
- package/dist/eventlog/EventLogServerEncrypted.d.ts +336 -5
- package/dist/eventlog/EventLogServerEncrypted.d.ts.map +1 -1
- package/dist/eventlog/EventLogServerEncrypted.js +769 -14
- package/dist/eventlog/EventLogServerEncrypted.js.map +1 -1
- package/dist/eventlog/EventLogServerUnencrypted.d.ts +17 -0
- package/dist/eventlog/EventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/eventlog/EventLogServerUnencrypted.js +14 -2
- package/dist/eventlog/EventLogServerUnencrypted.js.map +1 -1
- package/dist/eventlog/EventLogSessionAuth.d.ts +26 -3
- package/dist/eventlog/EventLogSessionAuth.d.ts.map +1 -1
- package/dist/eventlog/EventLogSessionAuth.js +63 -64
- package/dist/eventlog/EventLogSessionAuth.js.map +1 -1
- package/dist/eventlog/EventRow.d.ts +4 -0
- package/dist/eventlog/EventRow.d.ts.map +1 -1
- package/dist/eventlog/EventRow.js +12 -2
- package/dist/eventlog/EventRow.js.map +1 -1
- package/dist/eventlog/SqlEventJournal.js +2 -2
- package/dist/eventlog/SqlEventJournal.js.map +1 -1
- package/dist/eventlog/SqlEventLogServerEncrypted.d.ts +21 -5
- package/dist/eventlog/SqlEventLogServerEncrypted.d.ts.map +1 -1
- package/dist/eventlog/SqlEventLogServerEncrypted.js +1048 -113
- package/dist/eventlog/SqlEventLogServerEncrypted.js.map +1 -1
- package/dist/eventlog/SqlEventLogServerUnencrypted.js +2 -2
- package/dist/eventlog/SqlEventLogServerUnencrypted.js.map +1 -1
- package/dist/eventlog/internal/batches.d.ts +12 -0
- package/dist/eventlog/internal/batches.d.ts.map +1 -0
- package/dist/eventlog/internal/batches.js +26 -0
- package/dist/eventlog/internal/batches.js.map +1 -0
- package/dist/eventlog/internal/compaction.d.ts +38 -0
- package/dist/eventlog/internal/compaction.d.ts.map +1 -0
- package/dist/eventlog/internal/compaction.js +33 -0
- package/dist/eventlog/internal/compaction.js.map +1 -0
- package/dist/eventlog/internal/identityRootSecretDerivation.js +66 -67
- package/dist/eventlog/internal/identityRootSecretDerivation.js.map +1 -1
- package/dist/eventlog/internal/remoteCompaction.d.ts +31 -0
- package/dist/eventlog/internal/remoteCompaction.d.ts.map +1 -0
- package/dist/eventlog/internal/remoteCompaction.js +76 -0
- package/dist/eventlog/internal/remoteCompaction.js.map +1 -0
- package/dist/graphql/GraphQLClient.d.ts +3 -1
- package/dist/graphql/GraphQLClient.d.ts.map +1 -1
- package/dist/graphql/GraphQLClient.js.map +1 -1
- package/dist/graphql/GraphQLClientError.d.ts +14 -9
- package/dist/graphql/GraphQLClientError.d.ts.map +1 -1
- package/dist/graphql/GraphQLClientError.js +14 -21
- package/dist/graphql/GraphQLClientError.js.map +1 -1
- package/dist/graphql/GraphQLProtocol.d.ts +12 -3
- package/dist/graphql/GraphQLProtocol.d.ts.map +1 -1
- package/dist/graphql/GraphQLProtocol.js +4 -1
- package/dist/graphql/GraphQLProtocol.js.map +1 -1
- package/dist/http/Cookies.d.ts +172 -0
- package/dist/http/Cookies.d.ts.map +1 -1
- package/dist/http/Cookies.js +143 -1
- package/dist/http/Cookies.js.map +1 -1
- package/dist/http/FetchHttpClient.d.ts +26 -2
- package/dist/http/FetchHttpClient.d.ts.map +1 -1
- package/dist/http/FetchHttpClient.js +78 -15
- package/dist/http/FetchHttpClient.js.map +1 -1
- package/dist/http/HttpClient.d.ts +268 -15
- package/dist/http/HttpClient.d.ts.map +1 -1
- package/dist/http/HttpClient.js +140 -7
- package/dist/http/HttpClient.js.map +1 -1
- package/dist/http/HttpClientRequest.d.ts +9 -5
- package/dist/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/http/HttpClientRequest.js +2 -3
- package/dist/http/HttpClientRequest.js.map +1 -1
- package/dist/http/HttpClientResponse.d.ts.map +1 -1
- package/dist/http/HttpClientResponse.js +3 -2
- package/dist/http/HttpClientResponse.js.map +1 -1
- package/dist/http/HttpMethod.d.ts +7 -1
- package/dist/http/HttpMethod.d.ts.map +1 -1
- package/dist/http/HttpMethod.js +3 -8
- package/dist/http/HttpMethod.js.map +1 -1
- package/dist/http/HttpServerRequest.d.ts +5 -2
- package/dist/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/http/HttpServerRequest.js +44 -39
- package/dist/http/HttpServerRequest.js.map +1 -1
- package/dist/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/http/HttpServerResponse.js +3 -2
- package/dist/http/HttpServerResponse.js.map +1 -1
- package/dist/http/HttpTraceContext.d.ts +2 -1
- package/dist/http/HttpTraceContext.d.ts.map +1 -1
- package/dist/http/HttpTraceContext.js +7 -5
- package/dist/http/HttpTraceContext.js.map +1 -1
- package/dist/http/ProblemDetails.d.ts +96 -0
- package/dist/http/ProblemDetails.d.ts.map +1 -0
- package/dist/http/ProblemDetails.js +98 -0
- package/dist/http/ProblemDetails.js.map +1 -0
- package/dist/http/index.d.ts +5 -0
- package/dist/http/index.d.ts.map +1 -1
- package/dist/http/index.js +5 -0
- package/dist/http/index.js.map +1 -1
- package/dist/http/internal/decompression.js +3 -2
- package/dist/http/internal/decompression.js.map +1 -1
- package/dist/http/internal/mimeTypes.d.ts +4 -1
- package/dist/http/internal/mimeTypes.d.ts.map +1 -1
- package/dist/http/internal/mimeTypes.js +4 -1
- package/dist/http/internal/mimeTypes.js.map +1 -1
- package/dist/http/internal/urlParams.js +8 -0
- package/dist/http/internal/urlParams.js.map +1 -1
- package/dist/http-api/HttpApiBuilder.js +19 -5
- package/dist/http-api/HttpApiBuilder.js.map +1 -1
- package/dist/http-api/HttpApiClient.d.ts +63 -0
- package/dist/http-api/HttpApiClient.d.ts.map +1 -1
- package/dist/http-api/HttpApiClient.js +51 -0
- package/dist/http-api/HttpApiClient.js.map +1 -1
- package/dist/http-api/HttpApiEndpoint.d.ts.map +1 -1
- package/dist/http-api/HttpApiEndpoint.js +14 -5
- package/dist/http-api/HttpApiEndpoint.js.map +1 -1
- package/dist/http-api/HttpApiError.d.ts +185 -13
- package/dist/http-api/HttpApiError.d.ts.map +1 -1
- package/dist/http-api/HttpApiError.js +128 -0
- package/dist/http-api/HttpApiError.js.map +1 -1
- package/dist/http-api/HttpApiMiddleware.d.ts +64 -17
- package/dist/http-api/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/http-api/HttpApiMiddleware.js +85 -1
- package/dist/http-api/HttpApiMiddleware.js.map +1 -1
- package/dist/http-api/HttpApiSchema.d.ts +76 -14
- package/dist/http-api/HttpApiSchema.d.ts.map +1 -1
- package/dist/http-api/HttpApiSchema.js +54 -1
- package/dist/http-api/HttpApiSchema.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/internal/dateTime.js +49 -24
- package/dist/internal/dateTime.js.map +1 -1
- package/dist/internal/effect.js +35 -14
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/glob.d.ts +2 -0
- package/dist/internal/glob.d.ts.map +1 -0
- package/dist/internal/glob.js +808 -0
- package/dist/internal/glob.js.map +1 -0
- package/dist/internal/graphql.js +21 -7
- package/dist/internal/graphql.js.map +1 -1
- package/dist/internal/graphqlHeaders.d.ts +7 -0
- package/dist/internal/graphqlHeaders.d.ts.map +1 -1
- package/dist/internal/graphqlHeaders.js +11 -0
- package/dist/internal/graphqlHeaders.js.map +1 -1
- package/dist/internal/matcher.js +10 -0
- package/dist/internal/matcher.js.map +1 -1
- package/dist/internal/persistence.js +9 -0
- package/dist/internal/persistence.js.map +1 -1
- package/dist/internal/rcRef.js +4 -1
- package/dist/internal/rcRef.js.map +1 -1
- package/dist/internal/request.js +29 -42
- package/dist/internal/request.js.map +1 -1
- package/dist/internal/schema/fromJsonSchemaDocument.js +7 -8
- package/dist/internal/schema/fromJsonSchemaDocument.js.map +1 -1
- package/dist/internal/schema/toCodeDocument.js +6 -3
- package/dist/internal/schema/toCodeDocument.js.map +1 -1
- package/dist/internal/trie.js +42 -13
- package/dist/internal/trie.js.map +1 -1
- package/dist/internal/ulid.js +41 -0
- package/dist/internal/ulid.js.map +1 -1
- package/dist/internal/uuid.js +52 -8
- package/dist/internal/uuid.js.map +1 -1
- package/dist/internal/version.js +1 -1
- package/dist/jose/JoseError.d.ts +285 -0
- package/dist/jose/JoseError.d.ts.map +1 -0
- package/dist/jose/JoseError.js +269 -0
- package/dist/jose/JoseError.js.map +1 -0
- package/dist/jose/Jwe.d.ts +128 -0
- package/dist/jose/Jwe.d.ts.map +1 -0
- package/dist/jose/Jwe.js +134 -0
- package/dist/jose/Jwe.js.map +1 -0
- package/dist/jose/Jwk.d.ts +597 -0
- package/dist/jose/Jwk.d.ts.map +1 -0
- package/dist/jose/Jwk.js +503 -0
- package/dist/jose/Jwk.js.map +1 -0
- package/dist/jose/Jwks.d.ts +236 -0
- package/dist/jose/Jwks.d.ts.map +1 -0
- package/dist/jose/Jwks.js +306 -0
- package/dist/jose/Jwks.js.map +1 -0
- package/dist/jose/Jws.d.ts +177 -0
- package/dist/jose/Jws.d.ts.map +1 -0
- package/dist/jose/Jws.js +183 -0
- package/dist/jose/Jws.js.map +1 -0
- package/dist/jose/Jwt.d.ts +270 -0
- package/dist/jose/Jwt.d.ts.map +1 -0
- package/dist/jose/Jwt.js +293 -0
- package/dist/jose/Jwt.js.map +1 -0
- package/dist/jose/index.d.ts +51 -0
- package/dist/jose/index.d.ts.map +1 -0
- package/dist/jose/index.js +52 -0
- package/dist/jose/index.js.map +1 -0
- package/dist/jose/internal/compact.d.ts +2 -0
- package/dist/jose/internal/compact.d.ts.map +1 -0
- package/dist/jose/internal/compact.js +179 -0
- package/dist/jose/internal/compact.js.map +1 -0
- package/dist/net/Host.d.ts.map +1 -1
- package/dist/net/Host.js +5 -10
- package/dist/net/Host.js.map +1 -1
- package/dist/observability/Otlp.d.ts +15 -4
- package/dist/observability/Otlp.d.ts.map +1 -1
- package/dist/observability/Otlp.js +10 -0
- package/dist/observability/Otlp.js.map +1 -1
- package/dist/observability/OtlpResource.d.ts +7 -0
- package/dist/observability/OtlpResource.d.ts.map +1 -1
- package/dist/observability/OtlpResource.js +11 -1
- package/dist/observability/OtlpResource.js.map +1 -1
- package/dist/observability/OtlpSerialization.d.ts +1 -1
- package/dist/observability/OtlpSerialization.d.ts.map +1 -1
- package/dist/observability/OtlpSerialization.js +10 -4
- package/dist/observability/OtlpSerialization.js.map +1 -1
- package/dist/observability/internal/otlpProtobuf.js +3 -3
- package/dist/observability/internal/otlpProtobuf.js.map +1 -1
- package/dist/observability/internal/protobuf.js +6 -0
- package/dist/observability/internal/protobuf.js.map +1 -1
- package/dist/persistence/CircuitBreaker.d.ts +98 -38
- package/dist/persistence/CircuitBreaker.d.ts.map +1 -1
- package/dist/persistence/CircuitBreaker.js +67 -29
- package/dist/persistence/CircuitBreaker.js.map +1 -1
- package/dist/persistence/KeyValueStore.d.ts +47 -2
- package/dist/persistence/KeyValueStore.d.ts.map +1 -1
- package/dist/persistence/KeyValueStore.js +129 -18
- package/dist/persistence/KeyValueStore.js.map +1 -1
- package/dist/persistence/PersistedQueue.d.ts +9 -0
- package/dist/persistence/PersistedQueue.d.ts.map +1 -1
- package/dist/persistence/PersistedQueue.js +94 -52
- package/dist/persistence/PersistedQueue.js.map +1 -1
- package/dist/persistence/Persistence.d.ts +10 -4
- package/dist/persistence/Persistence.d.ts.map +1 -1
- package/dist/persistence/Persistence.js +18 -11
- package/dist/persistence/Persistence.js.map +1 -1
- package/dist/persistence/RateLimiter.d.ts +8 -0
- package/dist/persistence/RateLimiter.d.ts.map +1 -1
- package/dist/persistence/RateLimiter.js +63 -12
- package/dist/persistence/RateLimiter.js.map +1 -1
- package/dist/persistence/index.d.ts +1 -1
- package/dist/persistence/index.js +1 -1
- package/dist/process/ChildProcess.d.ts +207 -67
- package/dist/process/ChildProcess.d.ts.map +1 -1
- package/dist/process/ChildProcess.js +56 -158
- package/dist/process/ChildProcess.js.map +1 -1
- package/dist/process/ChildProcessSpawner.d.ts +5 -0
- package/dist/process/ChildProcessSpawner.d.ts.map +1 -1
- package/dist/process/ChildProcessSpawner.js.map +1 -1
- package/dist/process/CommandLine.d.ts +294 -0
- package/dist/process/CommandLine.d.ts.map +1 -0
- package/dist/process/CommandLine.js +481 -0
- package/dist/process/CommandLine.js.map +1 -0
- package/dist/process/index.d.ts +5 -0
- package/dist/process/index.d.ts.map +1 -1
- package/dist/process/index.js +5 -0
- package/dist/process/index.js.map +1 -1
- package/dist/reactivity/Atom.d.ts +2 -1
- package/dist/reactivity/Atom.d.ts.map +1 -1
- package/dist/reactivity/Atom.js +3 -4
- package/dist/reactivity/Atom.js.map +1 -1
- package/dist/reactivity/AtomRegistry.js +17 -7
- package/dist/reactivity/AtomRegistry.js.map +1 -1
- package/dist/rpc/Rpc.d.ts +1 -1
- package/dist/rpc/Rpc.d.ts.map +1 -1
- package/dist/rpc/Rpc.js.map +1 -1
- package/dist/rpc/RpcClient.d.ts +28 -1
- package/dist/rpc/RpcClient.d.ts.map +1 -1
- package/dist/rpc/RpcClient.js +78 -27
- package/dist/rpc/RpcClient.js.map +1 -1
- package/dist/rpc/RpcMessage.d.ts +13 -3
- package/dist/rpc/RpcMessage.d.ts.map +1 -1
- package/dist/rpc/RpcMessage.js +1 -0
- package/dist/rpc/RpcMessage.js.map +1 -1
- package/dist/rpc/RpcSerialization.d.ts.map +1 -1
- package/dist/rpc/RpcSerialization.js +6 -0
- package/dist/rpc/RpcSerialization.js.map +1 -1
- package/dist/rpc/RpcServer.d.ts +31 -0
- package/dist/rpc/RpcServer.d.ts.map +1 -1
- package/dist/rpc/RpcServer.js +139 -66
- package/dist/rpc/RpcServer.js.map +1 -1
- package/dist/schema/Model.d.ts +14 -0
- package/dist/schema/Model.d.ts.map +1 -1
- package/dist/schema/Model.js +18 -3
- package/dist/schema/Model.js.map +1 -1
- package/dist/sql/Migrator.d.ts +9 -20
- package/dist/sql/Migrator.d.ts.map +1 -1
- package/dist/sql/Migrator.js +20 -53
- package/dist/sql/Migrator.js.map +1 -1
- package/dist/sql/MigratorFileSystem.d.ts +21 -0
- package/dist/sql/MigratorFileSystem.d.ts.map +1 -0
- package/dist/sql/MigratorFileSystem.js +57 -0
- package/dist/sql/MigratorFileSystem.js.map +1 -0
- package/dist/sql/SqlClient.d.ts +38 -3
- package/dist/sql/SqlClient.d.ts.map +1 -1
- package/dist/sql/SqlClient.js +9 -12
- package/dist/sql/SqlClient.js.map +1 -1
- package/dist/sql/Statement.d.ts +61 -9
- package/dist/sql/Statement.d.ts.map +1 -1
- package/dist/sql/Statement.js +24 -33
- package/dist/sql/Statement.js.map +1 -1
- package/dist/sql/index.js +1 -1
- package/dist/testing/index.d.ts +0 -5
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +0 -5
- package/dist/testing/index.js.map +1 -1
- package/dist/workflow/Workflow.d.ts +4 -0
- package/dist/workflow/Workflow.d.ts.map +1 -1
- package/dist/workflow/Workflow.js.map +1 -1
- package/dist/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/workflow/WorkflowEngine.js +5 -0
- package/dist/workflow/WorkflowEngine.js.map +1 -1
- package/dist/workflow/internal/crypto.js +9 -8
- package/dist/workflow/internal/crypto.js.map +1 -1
- package/package.json +7 -1
- package/src/BigDecimal.ts +173 -16
- package/src/Channel.ts +17 -11
- package/src/Config.ts +7 -1
- package/src/Context.ts +34 -10
- package/src/Cron.ts +178 -29
- package/src/Duration.ts +140 -0
- package/src/Effect.ts +914 -85
- package/src/Equal.ts +3 -3
- package/src/FileSystem.ts +65 -4
- package/src/Glob.ts +205 -0
- package/src/Hash.ts +5 -4
- package/src/Iterable.ts +8 -5
- package/src/Match.ts +127 -0
- package/src/Path.ts +6 -1
- package/src/Pool.ts +75 -16
- package/src/Random.ts +3 -3
- package/src/RcMap.ts +5 -1
- package/src/Schedule.ts +26 -3
- package/src/Schema.ts +1191 -63
- package/src/SchemaGetter.ts +27 -11
- package/src/SchemaRepresentation.ts +23 -2
- package/src/SchemaTransformation.ts +10 -5
- package/src/ScopedCache.ts +5 -9
- package/src/Semaphore.ts +141 -0
- package/src/Stream.ts +15 -6
- package/src/Terminal.ts +19 -1
- package/src/ai/AiError.ts +56 -80
- package/src/ai/Decision.ts +257 -6
- package/src/ai/DecisionModel.ts +171 -28
- package/src/ai/McpClient.ts +488 -91
- package/src/ai/McpSchema.ts +119 -0
- package/src/ai/McpServer.ts +1525 -319
- package/src/ai/McpTest.ts +380 -0
- package/src/ai/Prompt.ts +16 -11
- package/src/ai/Response.ts +2 -22
- package/src/ai/Tool.ts +32 -18
- package/src/ai/index.ts +6 -0
- package/src/ai/internal/mcpCore.ts +243 -56
- package/src/ai/internal/mcpProtocol/v2024_11_05.ts +7 -8
- package/src/ai/internal/mcpProtocol/v2025_03_26.ts +7 -8
- package/src/ai/internal/mcpProtocol/v2025_06_18.ts +7 -8
- package/src/ai/internal/mcpProtocol/v2025_11_25.ts +7 -8
- package/src/ai/internal/mcpProtocol/v2026_07_28.ts +56 -17
- package/src/ai/internal/mcpProtocol.ts +44 -0
- package/src/ai/internal/mcpRuntime.ts +15 -8
- package/src/ai/internal/mcpSkills.ts +480 -0
- package/src/ai/internal/mcpStatefulRuntime.ts +14 -2
- package/src/cli/Argument.ts +6 -0
- package/src/cli/CliOutput.ts +117 -49
- package/src/cli/Command.ts +23 -0
- package/src/cli/Flag.ts +107 -0
- package/src/cli/HelpDoc.ts +18 -1
- package/src/cli/Param.ts +6 -0
- package/src/cli/Primitive.ts +16 -1
- package/src/cli/Prompt.ts +1 -0
- package/src/cli/internal/help.ts +21 -9
- package/src/cluster/ClusterWorkflowEngine.ts +22 -8
- package/src/cluster/Reply.ts +1 -1
- package/src/cluster/Sharding.ts +96 -26
- package/src/cluster/ShardingConfig.ts +41 -3
- package/src/cluster/SingleRunner.ts +3 -3
- package/src/cluster/SqlMessageStorage.ts +49 -17
- package/src/cluster/SqlRunnerStorage.ts +37 -27
- package/src/cluster/internal/entityManager.ts +24 -10
- package/src/crypto/Aead.ts +517 -0
- package/src/crypto/Cipher.ts +326 -0
- package/src/crypto/CryptoError.ts +242 -0
- package/src/crypto/Digest.ts +167 -0
- package/src/crypto/Kdf.ts +315 -0
- package/src/crypto/KeyAgreement.ts +489 -0
- package/src/crypto/KeyFormat.ts +741 -0
- package/src/crypto/KeyWrap.ts +639 -0
- package/src/crypto/Mac.ts +386 -0
- package/src/crypto/SecureRandom.ts +459 -0
- package/src/crypto/Signature.ts +673 -0
- package/src/crypto/WebCrypto.ts +84 -0
- package/src/crypto/index.ts +78 -0
- package/src/crypto/internal/asymmetric.ts +330 -0
- package/src/crypto/internal/chacha.ts +1088 -0
- package/src/crypto/internal/der.ts +110 -0
- package/src/crypto/internal/digest.ts +16 -0
- package/src/crypto/internal/key.ts +242 -0
- package/src/crypto/internal/md5.ts +170 -0
- package/src/crypto/internal/webCrypto.ts +150 -0
- package/src/encoding/Base64Url.ts +32 -5
- package/src/encoding/Csv.ts +1298 -0
- package/src/encoding/Hex.ts +3 -2
- package/src/encoding/Ndjson.ts +6 -5
- package/src/encoding/SchemaBinary.ts +40 -4
- package/src/encoding/Sse.ts +5 -3
- package/src/encoding/Toml.ts +85 -20
- package/src/encoding/Yaml.ts +61 -18
- package/src/encoding/index.ts +6 -0
- package/src/eventlog/EventJournal.ts +4 -3
- package/src/eventlog/EventLog.ts +347 -15
- package/src/eventlog/EventLogEncryption.ts +118 -110
- package/src/eventlog/EventLogMessage.ts +273 -1
- package/src/eventlog/EventLogRemote.ts +367 -23
- package/src/eventlog/EventLogServer.ts +54 -20
- package/src/eventlog/EventLogServerEncrypted.ts +1135 -67
- package/src/eventlog/EventLogServerUnencrypted.ts +19 -2
- package/src/eventlog/EventLogSessionAuth.ts +82 -70
- package/src/eventlog/EventRow.ts +12 -3
- package/src/eventlog/SqlEventJournal.ts +2 -2
- package/src/eventlog/SqlEventLogServerEncrypted.ts +1244 -136
- package/src/eventlog/SqlEventLogServerUnencrypted.ts +2 -2
- package/src/eventlog/internal/batches.ts +30 -0
- package/src/eventlog/internal/compaction.ts +64 -0
- package/src/eventlog/internal/identityRootSecretDerivation.ts +93 -123
- package/src/eventlog/internal/remoteCompaction.ts +92 -0
- package/src/graphql/GraphQLClient.ts +3 -1
- package/src/graphql/GraphQLClientError.ts +15 -22
- package/src/graphql/GraphQLProtocol.ts +12 -3
- package/src/http/Cookies.ts +281 -1
- package/src/http/FetchHttpClient.ts +88 -16
- package/src/http/HttpClient.ts +299 -33
- package/src/http/HttpClientRequest.ts +12 -9
- package/src/http/HttpClientResponse.ts +3 -2
- package/src/http/HttpMethod.ts +10 -2
- package/src/http/HttpServerRequest.ts +76 -53
- package/src/http/HttpServerResponse.ts +3 -2
- package/src/http/HttpTraceContext.ts +7 -4
- package/src/http/ProblemDetails.ts +149 -0
- package/src/http/index.ts +6 -0
- package/src/http/internal/decompression.ts +4 -4
- package/src/http/internal/mimeTypes.ts +4 -1
- package/src/http/internal/urlParams.ts +8 -0
- package/src/http-api/HttpApiBuilder.ts +24 -12
- package/src/http-api/HttpApiClient.ts +67 -1
- package/src/http-api/HttpApiEndpoint.ts +14 -5
- package/src/http-api/HttpApiError.ts +250 -0
- package/src/http-api/HttpApiMiddleware.ts +95 -1
- package/src/http-api/HttpApiSchema.ts +106 -15
- package/src/index.ts +6 -6
- package/src/internal/dateTime.ts +54 -24
- package/src/internal/effect.ts +40 -18
- package/src/internal/glob.ts +952 -0
- package/src/internal/graphql.ts +27 -9
- package/src/internal/graphqlHeaders.ts +13 -0
- package/src/internal/matcher.ts +17 -0
- package/src/internal/persistence.ts +11 -0
- package/src/internal/rcRef.ts +4 -1
- package/src/internal/request.ts +51 -58
- package/src/internal/schema/fromJsonSchemaDocument.ts +11 -10
- package/src/internal/schema/toCodeDocument.ts +7 -3
- package/src/internal/trie.ts +43 -14
- package/src/internal/ulid.ts +44 -0
- package/src/internal/uuid.ts +57 -16
- package/src/internal/version.ts +1 -1
- package/src/jose/JoseError.ts +329 -0
- package/src/jose/Jwe.ts +196 -0
- package/src/jose/Jwk.ts +777 -0
- package/src/jose/Jwks.ts +418 -0
- package/src/jose/Jws.ts +312 -0
- package/src/jose/Jwt.ts +493 -0
- package/src/jose/index.ts +58 -0
- package/src/jose/internal/compact.ts +195 -0
- package/src/net/Host.ts +5 -10
- package/src/observability/Otlp.ts +21 -4
- package/src/observability/OtlpResource.ts +9 -1
- package/src/observability/OtlpSerialization.ts +13 -5
- package/src/observability/internal/otlpProtobuf.ts +6 -6
- package/src/observability/internal/protobuf.ts +10 -0
- package/src/persistence/CircuitBreaker.ts +113 -48
- package/src/persistence/KeyValueStore.ts +219 -22
- package/src/persistence/PersistedQueue.ts +128 -59
- package/src/persistence/Persistence.ts +20 -13
- package/src/persistence/RateLimiter.ts +84 -15
- package/src/persistence/index.ts +1 -1
- package/src/process/ChildProcess.ts +255 -260
- package/src/process/ChildProcessSpawner.ts +5 -0
- package/src/process/CommandLine.ts +630 -0
- package/src/process/index.ts +6 -0
- package/src/reactivity/Atom.ts +5 -5
- package/src/reactivity/AtomRegistry.ts +20 -9
- package/src/rpc/Rpc.ts +3 -1
- package/src/rpc/RpcClient.ts +94 -38
- package/src/rpc/RpcMessage.ts +13 -3
- package/src/rpc/RpcSerialization.ts +3 -0
- package/src/rpc/RpcServer.ts +176 -78
- package/src/schema/Model.ts +26 -3
- package/src/sql/Migrator.ts +38 -80
- package/src/sql/MigratorFileSystem.ts +71 -0
- package/src/sql/SqlClient.ts +45 -24
- package/src/sql/Statement.ts +60 -29
- package/src/sql/index.ts +1 -1
- package/src/testing/index.ts +0 -6
- package/src/workflow/Workflow.ts +4 -0
- package/src/workflow/WorkflowEngine.ts +5 -0
- package/src/workflow/internal/crypto.ts +15 -11
- package/dist/Crypto.d.ts +0 -244
- package/dist/Crypto.d.ts.map +0 -1
- package/dist/Crypto.js +0 -139
- package/dist/Crypto.js.map +0 -1
- package/dist/testing/TestCrypto.d.ts +0 -73
- package/dist/testing/TestCrypto.d.ts.map +0 -1
- package/dist/testing/TestCrypto.js +0 -87
- package/dist/testing/TestCrypto.js.map +0 -1
- package/src/Crypto.ts +0 -347
- package/src/testing/TestCrypto.ts +0 -94
package/dist/ai/McpServer.d.ts
CHANGED
|
@@ -14,8 +14,11 @@
|
|
|
14
14
|
import * as Arr from "../Array.ts";
|
|
15
15
|
import * as Cause from "../Cause.ts";
|
|
16
16
|
import * as Context from "../Context.ts";
|
|
17
|
+
import * as Duration from "../Duration.ts";
|
|
17
18
|
import * as Effect from "../Effect.ts";
|
|
19
|
+
import * as Headers from "../http/Headers.ts";
|
|
18
20
|
import * as HttpRouter from "../http/HttpRouter.ts";
|
|
21
|
+
import * as HttpServerRequest from "../http/HttpServerRequest.ts";
|
|
19
22
|
import * as Layer from "../Layer.ts";
|
|
20
23
|
import * as RpcClient from "../rpc/RpcClient.ts";
|
|
21
24
|
import type * as RpcGroup from "../rpc/RpcGroup.ts";
|
|
@@ -23,6 +26,7 @@ import * as RpcServer from "../rpc/RpcServer.ts";
|
|
|
23
26
|
import * as Schema from "../Schema.ts";
|
|
24
27
|
import * as Scope from "../Scope.ts";
|
|
25
28
|
import type { Stdio } from "../Stdio.ts";
|
|
29
|
+
import type * as Types from "../Types.ts";
|
|
26
30
|
import type * as McpProtocol from "./McpProtocol.ts";
|
|
27
31
|
import * as McpSchema from "./McpSchema.ts";
|
|
28
32
|
import { CallToolResult, ElicitationDeclined, GetPromptResult, InternalError, InvalidParams, McpRequestContext, McpServerClient, Prompt, Resource, ResourceTemplate, Tool as McpTool } from "./McpSchema.ts";
|
|
@@ -32,6 +36,374 @@ import * as Toolkit from "./Toolkit.ts";
|
|
|
32
36
|
type CompletionContext = typeof Complete.payloadSchema.Type["context"];
|
|
33
37
|
type ServerExtensions = NonNullable<ServerCapabilities["extensions"]>;
|
|
34
38
|
declare const BroadcastServerNotificationRpcs: RpcGroup.RpcGroup<typeof McpSchema.CancelledNotification | typeof McpSchema.ProgressNotification | typeof McpSchema.ResourceListChangedNotification | typeof McpSchema.ResourceUpdatedNotification | typeof McpSchema.PromptListChangedNotification | typeof McpSchema.ToolListChangedNotification | typeof McpSchema.LoggingMessageNotification>;
|
|
39
|
+
/**
|
|
40
|
+
* Marks a request-level dependency of an MCP registration or middleware.
|
|
41
|
+
*
|
|
42
|
+
* **Details**
|
|
43
|
+
*
|
|
44
|
+
* Registrations carry handler dependencies as `McpRequest<"Requires", S>`.
|
|
45
|
+
* MCP middleware and transports discharge these markers; providing `S` with
|
|
46
|
+
* `Layer.provide` or `Effect.provide` does not.
|
|
47
|
+
*
|
|
48
|
+
* `layerHttp` and `layerHttpRequestScoped` convert the markers they don't
|
|
49
|
+
* discharge into `HttpRouter.Request` markers, so `HttpRouter.middleware` can
|
|
50
|
+
* satisfy them. On stdio and custom transports an undischarged marker is a
|
|
51
|
+
* compile error.
|
|
52
|
+
*
|
|
53
|
+
* @see {@link middleware} for discharging request-level dependencies
|
|
54
|
+
*
|
|
55
|
+
* @stability unstable
|
|
56
|
+
* @category utility types
|
|
57
|
+
* @since 4.0.0
|
|
58
|
+
*/
|
|
59
|
+
export interface McpRequest<Kind extends string, T> {
|
|
60
|
+
readonly _: unique symbol;
|
|
61
|
+
readonly kind: Kind;
|
|
62
|
+
readonly type: T;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Helper types for `McpRequest` markers.
|
|
66
|
+
*
|
|
67
|
+
* @stability unstable
|
|
68
|
+
* @category utility types
|
|
69
|
+
* @since 4.0.0
|
|
70
|
+
*/
|
|
71
|
+
export declare namespace McpRequest {
|
|
72
|
+
/**
|
|
73
|
+
* Wraps each member of a union in an `McpRequest` marker of the supplied kind.
|
|
74
|
+
*
|
|
75
|
+
* @stability unstable
|
|
76
|
+
* @category utility types
|
|
77
|
+
* @since 4.0.0
|
|
78
|
+
*/
|
|
79
|
+
type From<Kind extends string, R> = R extends infer T ? McpRequest<Kind, T> : never;
|
|
80
|
+
/**
|
|
81
|
+
* Extracts the services from `McpRequest` markers of the supplied kind.
|
|
82
|
+
*
|
|
83
|
+
* @stability unstable
|
|
84
|
+
* @category utility types
|
|
85
|
+
* @since 4.0.0
|
|
86
|
+
*/
|
|
87
|
+
type Only<Kind extends string, A> = A extends McpRequest<Kind, infer T> ? T : never;
|
|
88
|
+
/**
|
|
89
|
+
* Removes `McpRequest` markers from a union.
|
|
90
|
+
*
|
|
91
|
+
* @stability unstable
|
|
92
|
+
* @category utility types
|
|
93
|
+
* @since 4.0.0
|
|
94
|
+
*/
|
|
95
|
+
type Without<A> = A extends McpRequest<infer _Kind, infer _> ? never : A;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Opaque handler result. Middleware can wrap execution and provide services,
|
|
99
|
+
* but cannot inspect or replace the result.
|
|
100
|
+
*
|
|
101
|
+
* @stability unstable
|
|
102
|
+
* @category middleware
|
|
103
|
+
* @since 4.0.0
|
|
104
|
+
*/
|
|
105
|
+
export interface MiddlewareSuccess {
|
|
106
|
+
readonly _: unique symbol;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* The request methods that run MCP middleware. More methods may be added, so
|
|
110
|
+
* don't `switch` on it exhaustively without a default case.
|
|
111
|
+
*
|
|
112
|
+
* @stability unstable
|
|
113
|
+
* @category middleware
|
|
114
|
+
* @since 4.0.0
|
|
115
|
+
*/
|
|
116
|
+
export type MiddlewareMethod = "tools/call" | "resources/read" | "prompts/get" | "completion/complete" | "tools/list" | "resources/list" | "resources/templates/list" | "prompts/list" | "skills/list" | "skills/get" | "resources/directory/read";
|
|
117
|
+
/**
|
|
118
|
+
* Request metadata passed to MCP middleware.
|
|
119
|
+
*
|
|
120
|
+
* **Details**
|
|
121
|
+
*
|
|
122
|
+
* `target` is the tool name, the requested resource URI, or the prompt name.
|
|
123
|
+
* For `completion/complete` it is the prompt name, or the URI template of the
|
|
124
|
+
* resource template being completed. For `skills/get` it is the URI of the
|
|
125
|
+
* skill's `SKILL.md`. `payload` holds the request parameters.
|
|
126
|
+
*
|
|
127
|
+
* On list requests, middleware runs only when it wraps a {@link visibility},
|
|
128
|
+
* once for each registration it wraps. `target` is then the tool name, the
|
|
129
|
+
* resource URI, the URI template or the prompt name of that registration, and
|
|
130
|
+
* `payload` is `undefined`. `skills/list` and `resources/directory/read` are
|
|
131
|
+
* list requests whose `target` is the `SKILL.md` URI of each skill; a
|
|
132
|
+
* directory read checks only the skills that have the directory. A skill's
|
|
133
|
+
* files are resources, checked as `resources/list` and `resources/read` with
|
|
134
|
+
* their own URIs.
|
|
135
|
+
*
|
|
136
|
+
* `headers` are the HTTP request headers. They are empty on stdio, on custom
|
|
137
|
+
* transports and for in-process calls. `sessionId` is the `Mcp-Session-Id`
|
|
138
|
+
* header, so it is `undefined` outside sessionful HTTP.
|
|
139
|
+
*
|
|
140
|
+
* @stability unstable
|
|
141
|
+
* @category middleware
|
|
142
|
+
* @since 4.0.0
|
|
143
|
+
*/
|
|
144
|
+
export interface MiddlewareOptions {
|
|
145
|
+
readonly method: MiddlewareMethod;
|
|
146
|
+
readonly target: string;
|
|
147
|
+
readonly payload: unknown;
|
|
148
|
+
readonly requestContext: McpRequestContext["Service"];
|
|
149
|
+
readonly headers: Headers.Headers;
|
|
150
|
+
readonly sessionId: string | undefined;
|
|
151
|
+
}
|
|
152
|
+
declare const MiddlewareTypeId = "~effect/ai/McpServer/Middleware";
|
|
153
|
+
type MiddlewareConfig = {
|
|
154
|
+
provides: any;
|
|
155
|
+
error: McpErrorBase;
|
|
156
|
+
requires: any;
|
|
157
|
+
layerError: any;
|
|
158
|
+
layerRequires: any;
|
|
159
|
+
};
|
|
160
|
+
type MiddlewareLayer<Config extends MiddlewareConfig, R> = Layer.Layer<McpRequest.From<"Requires", Config["provides"]>, Config["layerError"], R | Config["layerRequires"] | McpRequest.From<"Requires", Config["requires"]>>;
|
|
161
|
+
/**
|
|
162
|
+
* Composable MCP middleware.
|
|
163
|
+
*
|
|
164
|
+
* **Details**
|
|
165
|
+
*
|
|
166
|
+
* Provide `layer` to registration layers, or to the Effect form of a
|
|
167
|
+
* registration, to run the middleware for those registrations. Use
|
|
168
|
+
* `layerGlobal` to run it for every request on the server.
|
|
169
|
+
*
|
|
170
|
+
* Services the middleware reads per request are `McpRequest<"Requires", S>`
|
|
171
|
+
* requirements of `layer` and `layerGlobal`, like the request-level
|
|
172
|
+
* dependencies of a registration. A middleware that provides `S` meets them
|
|
173
|
+
* when it runs outside this one: `a.combine(b)` runs `b` outside `a`, and so
|
|
174
|
+
* does providing `b.layer` or `b.layerGlobal` outside `a.layer`, though
|
|
175
|
+
* `layerGlobal` installs `b` for the whole server. The transport discharges
|
|
176
|
+
* the services it supplies, and `layerHttp` turns the rest into
|
|
177
|
+
* `HttpRouter.Request` requirements that an `HttpRouter.middleware` can meet.
|
|
178
|
+
*
|
|
179
|
+
* @see {@link middleware} for creating MCP middleware
|
|
180
|
+
*
|
|
181
|
+
* @stability unstable
|
|
182
|
+
* @category middleware
|
|
183
|
+
* @since 4.0.0
|
|
184
|
+
*/
|
|
185
|
+
export interface Middleware<Config extends MiddlewareConfig> {
|
|
186
|
+
readonly [MiddlewareTypeId]: Config;
|
|
187
|
+
readonly layer: MiddlewareLayer<Config, never>;
|
|
188
|
+
readonly layerGlobal: MiddlewareLayer<Config, McpServer>;
|
|
189
|
+
readonly combine: <Config2 extends MiddlewareConfig>(other: Middleware<Config2>) => Middleware<{
|
|
190
|
+
provides: Config2["provides"] | Config["provides"];
|
|
191
|
+
error: Config2["error"] | Config["error"];
|
|
192
|
+
requires: Exclude<Config["requires"], Config2["provides"]> | Config2["requires"];
|
|
193
|
+
layerError: Config["layerError"] | Config2["layerError"];
|
|
194
|
+
layerRequires: Config["layerRequires"] | Config2["layerRequires"];
|
|
195
|
+
}>;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Creates MCP middleware that runs around `tools/call`, `resources/read`,
|
|
199
|
+
* `prompts/get` and `completion/complete` requests.
|
|
200
|
+
*
|
|
201
|
+
* **Details**
|
|
202
|
+
*
|
|
203
|
+
* Middleware is how request-level dependencies are satisfied: declare the
|
|
204
|
+
* services it provides with `middleware<{ provides: S }>()` and provide them to
|
|
205
|
+
* the handler effect. It receives the request headers, session id and request
|
|
206
|
+
* context, so it can resolve the current user per request.
|
|
207
|
+
*
|
|
208
|
+
* Pass a function, or an Effect that builds the function. Services the Effect
|
|
209
|
+
* reads are requirements of the middleware layer. Services the function reads
|
|
210
|
+
* per request, other than `McpRequestContext`, are per-request requirements
|
|
211
|
+
* of the result; see {@link Middleware} for how they are met.
|
|
212
|
+
*
|
|
213
|
+
* Failures must be `McpErrorBase` values. A middleware failure is sent as a
|
|
214
|
+
* JSON-RPC error with its `code`, `message` and `data`, never as a tool
|
|
215
|
+
* result. Pick custom codes from the implementation-defined range
|
|
216
|
+
* (-32000 to -32019): any numeric `code` is sent as is. Defects are logged,
|
|
217
|
+
* reported to the `ErrorReporter` and sent as `InternalError("Internal error")`.
|
|
218
|
+
* Interruption propagates.
|
|
219
|
+
*
|
|
220
|
+
* Local middleware runs inside global middleware, and middleware provided both
|
|
221
|
+
* locally and globally runs once. Middleware never runs for `initialize`. It
|
|
222
|
+
* runs for list requests only when it wraps a {@link visibility}, so that the
|
|
223
|
+
* visibility check can read the services it provides.
|
|
224
|
+
*
|
|
225
|
+
* **Example** (Resolving the current user per request)
|
|
226
|
+
*
|
|
227
|
+
* ```ts
|
|
228
|
+
* import { Context, Effect, Layer, Schema } from "effect"
|
|
229
|
+
* import { McpSchema, McpServer, Tool, Toolkit } from "effect/ai"
|
|
230
|
+
*
|
|
231
|
+
* class CurrentUser extends Context.Service<CurrentUser, { readonly id: string }>()("CurrentUser") {}
|
|
232
|
+
*
|
|
233
|
+
* class Unauthorized extends Schema.Error<Unauthorized>("Unauthorized")({
|
|
234
|
+
* ...McpSchema.McpErrorBase.fields,
|
|
235
|
+
* _tag: Schema.tag("Unauthorized"),
|
|
236
|
+
* code: Schema.tag(-32001)
|
|
237
|
+
* }) {}
|
|
238
|
+
*
|
|
239
|
+
* const WhoAmI = Tool.make("WhoAmI", { success: Schema.String, dependencies: [CurrentUser] })
|
|
240
|
+
* const Tools = Toolkit.make(WhoAmI)
|
|
241
|
+
*
|
|
242
|
+
* const Auth = McpServer.middleware<{ provides: CurrentUser }>()((effect, { headers }) => {
|
|
243
|
+
* const token = headers["authorization"]
|
|
244
|
+
* return token === undefined
|
|
245
|
+
* ? Effect.fail(new Unauthorized({ message: "Missing credentials" }))
|
|
246
|
+
* : Effect.provideService(effect, CurrentUser, { id: token })
|
|
247
|
+
* })
|
|
248
|
+
*
|
|
249
|
+
* const Registrations = McpServer.toolkit(Tools).pipe(
|
|
250
|
+
* Layer.provide(Auth.layer),
|
|
251
|
+
* Layer.provide(Tools.toLayer({
|
|
252
|
+
* WhoAmI: () => Effect.map(CurrentUser, (user) => user.id)
|
|
253
|
+
* }))
|
|
254
|
+
* )
|
|
255
|
+
* ```
|
|
256
|
+
*
|
|
257
|
+
* @stability unstable
|
|
258
|
+
* @category middleware
|
|
259
|
+
* @since 4.0.0
|
|
260
|
+
*/
|
|
261
|
+
export declare const middleware: middleware.Make<never> & (<Config extends {
|
|
262
|
+
provides?: any;
|
|
263
|
+
} = {}>() => middleware.Make<Config extends {
|
|
264
|
+
provides: infer P;
|
|
265
|
+
} ? P : never>);
|
|
266
|
+
/**
|
|
267
|
+
* Types used by `middleware`.
|
|
268
|
+
*
|
|
269
|
+
* @stability unstable
|
|
270
|
+
* @category middleware
|
|
271
|
+
* @since 4.0.0
|
|
272
|
+
*/
|
|
273
|
+
export declare namespace middleware {
|
|
274
|
+
/**
|
|
275
|
+
* The middleware function.
|
|
276
|
+
*
|
|
277
|
+
* @stability unstable
|
|
278
|
+
* @category middleware
|
|
279
|
+
* @since 4.0.0
|
|
280
|
+
*/
|
|
281
|
+
type Fn<Provides, E, R> = (effect: Effect.Effect<MiddlewareSuccess, McpErrorBase, Types.NoInfer<Provides>>, options: MiddlewareOptions) => Effect.Effect<MiddlewareSuccess, E, R>;
|
|
282
|
+
/**
|
|
283
|
+
* The overloads of a middleware constructor.
|
|
284
|
+
*
|
|
285
|
+
* @stability unstable
|
|
286
|
+
* @category middleware
|
|
287
|
+
* @since 4.0.0
|
|
288
|
+
*/
|
|
289
|
+
type Make<Provides> = {
|
|
290
|
+
<E extends McpErrorBase, R, EX, RX, const Global extends boolean = false>(middleware: Effect.Effect<Fn<Provides, E, R>, EX, RX>, options?: {
|
|
291
|
+
readonly global?: Global | undefined;
|
|
292
|
+
}): Made<Global, {
|
|
293
|
+
provides: Provides;
|
|
294
|
+
error: E;
|
|
295
|
+
requires: Exclude<R, McpRequestContext>;
|
|
296
|
+
layerError: EX;
|
|
297
|
+
layerRequires: Exclude<RX, Scope.Scope>;
|
|
298
|
+
}>;
|
|
299
|
+
<E extends McpErrorBase, R, const Global extends boolean = false>(middleware: Fn<Provides, E, R>, options?: {
|
|
300
|
+
readonly global?: Global | undefined;
|
|
301
|
+
}): Made<Global, {
|
|
302
|
+
provides: Provides;
|
|
303
|
+
error: E;
|
|
304
|
+
requires: Exclude<R, McpRequestContext>;
|
|
305
|
+
layerError: never;
|
|
306
|
+
layerRequires: never;
|
|
307
|
+
}>;
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Creates middleware that hides registrations per request.
|
|
312
|
+
*
|
|
313
|
+
* **Details**
|
|
314
|
+
*
|
|
315
|
+
* The check runs for every registration the middleware is provided to, on list
|
|
316
|
+
* requests and on calls, reads, gets and completions. When it returns `false`
|
|
317
|
+
* the registration is left out of list results, and requests for it fail as if
|
|
318
|
+
* it was not registered.
|
|
319
|
+
*
|
|
320
|
+
* The result is a `Middleware` and composes like one. The check receives the
|
|
321
|
+
* same {@link MiddlewareOptions} as middleware, and services it reads per
|
|
322
|
+
* request, other than `McpRequestContext`, are met the same way. Scope a
|
|
323
|
+
* visibility to some tools by providing its layer to their toolkit only, or
|
|
324
|
+
* branch on `target`.
|
|
325
|
+
*
|
|
326
|
+
* On a list request, the check and the middleware outside the innermost
|
|
327
|
+
* visibility run once for each registration. Middleware inside it does not
|
|
328
|
+
* run. A failure of that middleware or of a check fails the whole list
|
|
329
|
+
* request. It never hides a registration.
|
|
330
|
+
*
|
|
331
|
+
* Unlike `EnabledWhen`, a visibility runs the middleware around it on list
|
|
332
|
+
* requests, and middleware sees requests for hidden registrations.
|
|
333
|
+
*
|
|
334
|
+
* **Example** (Hiding admin tools from other users)
|
|
335
|
+
*
|
|
336
|
+
* ```ts
|
|
337
|
+
* import { Context, Effect, Layer, Schema } from "effect"
|
|
338
|
+
* import { McpServer, Tool, Toolkit } from "effect/ai"
|
|
339
|
+
*
|
|
340
|
+
* class CurrentUser extends Context.Service<CurrentUser, { readonly isAdmin: boolean }>()("CurrentUser") {}
|
|
341
|
+
*
|
|
342
|
+
* const AdminTools = Toolkit.make(Tool.make("DeleteUser", { success: Schema.String }))
|
|
343
|
+
*
|
|
344
|
+
* const Auth = McpServer.middleware<{ provides: CurrentUser }>()((effect, { headers }) =>
|
|
345
|
+
* Effect.provideService(effect, CurrentUser, { isAdmin: headers["x-role"] === "admin" })
|
|
346
|
+
* )
|
|
347
|
+
* const AdminOnly = McpServer.visibility(() => Effect.map(CurrentUser, (user) => user.isAdmin))
|
|
348
|
+
*
|
|
349
|
+
* const Registrations = McpServer.toolkit(AdminTools).pipe(
|
|
350
|
+
* Layer.provide(AdminOnly.combine(Auth).layer),
|
|
351
|
+
* Layer.provide(AdminTools.toLayer({ DeleteUser: () => Effect.succeed("deleted") }))
|
|
352
|
+
* )
|
|
353
|
+
* ```
|
|
354
|
+
*
|
|
355
|
+
* @see {@link middleware} for providing the services a check reads
|
|
356
|
+
*
|
|
357
|
+
* @stability unstable
|
|
358
|
+
* @category middleware
|
|
359
|
+
* @since 4.0.0
|
|
360
|
+
*/
|
|
361
|
+
export declare const visibility: visibility.Make;
|
|
362
|
+
/**
|
|
363
|
+
* Types used by `visibility`.
|
|
364
|
+
*
|
|
365
|
+
* @stability unstable
|
|
366
|
+
* @category middleware
|
|
367
|
+
* @since 4.0.0
|
|
368
|
+
*/
|
|
369
|
+
export declare namespace visibility {
|
|
370
|
+
/**
|
|
371
|
+
* The visibility check.
|
|
372
|
+
*
|
|
373
|
+
* @stability unstable
|
|
374
|
+
* @category middleware
|
|
375
|
+
* @since 4.0.0
|
|
376
|
+
*/
|
|
377
|
+
type Check<E, R> = (options: MiddlewareOptions) => Effect.Effect<boolean, E, R>;
|
|
378
|
+
/**
|
|
379
|
+
* The overloads of `visibility`.
|
|
380
|
+
*
|
|
381
|
+
* @stability unstable
|
|
382
|
+
* @category middleware
|
|
383
|
+
* @since 4.0.0
|
|
384
|
+
*/
|
|
385
|
+
type Make = {
|
|
386
|
+
<E extends McpErrorBase, R, EX, RX, const Global extends boolean = false>(check: Effect.Effect<Check<E, R>, EX, RX>, options?: {
|
|
387
|
+
readonly global?: Global | undefined;
|
|
388
|
+
}): Made<Global, {
|
|
389
|
+
provides: never;
|
|
390
|
+
error: E;
|
|
391
|
+
requires: Exclude<R, McpRequestContext>;
|
|
392
|
+
layerError: EX;
|
|
393
|
+
layerRequires: Exclude<RX, Scope.Scope>;
|
|
394
|
+
}>;
|
|
395
|
+
<E extends McpErrorBase, R, const Global extends boolean = false>(check: Check<E, R>, options?: {
|
|
396
|
+
readonly global?: Global | undefined;
|
|
397
|
+
}): Made<Global, {
|
|
398
|
+
provides: never;
|
|
399
|
+
error: E;
|
|
400
|
+
requires: Exclude<R, McpRequestContext>;
|
|
401
|
+
layerError: never;
|
|
402
|
+
layerRequires: never;
|
|
403
|
+
}>;
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
type Made<Global extends boolean, Config extends MiddlewareConfig> = Global extends true ? MiddlewareLayer<Config, McpServer> : Middleware<Config>;
|
|
35
407
|
declare const McpServer_base: Context.ServiceClass<McpServer, "effect/ai/McpServer", {
|
|
36
408
|
readonly notifications: RpcClient.RpcClient<RpcGroup.Rpcs<typeof BroadcastServerNotificationRpcs>>;
|
|
37
409
|
readonly notifyElicitationComplete: (options: {
|
|
@@ -45,9 +417,10 @@ declare const McpServer_base: Context.ServiceClass<McpServer, "effect/ai/McpServ
|
|
|
45
417
|
readonly addTool: (options: {
|
|
46
418
|
readonly tool: McpTool;
|
|
47
419
|
readonly annotations: Context.Context<never>;
|
|
420
|
+
readonly services?: Context.Context<never> | undefined;
|
|
48
421
|
readonly handle: (payload: any) => Effect.Effect<CallToolResult | McpSchema.InputRequired, InternalError | InvalidParams, McpRequestContext>;
|
|
49
422
|
}) => Effect.Effect<void>;
|
|
50
|
-
readonly callTool: (requests: typeof CallTool.payloadSchema.Type) => Effect.Effect<CallToolResult, InternalError | InvalidParams, McpServerClient>;
|
|
423
|
+
readonly callTool: (requests: typeof CallTool.payloadSchema.Type) => Effect.Effect<CallToolResult, McpErrorBase | InternalError | InvalidParams, McpServerClient>;
|
|
51
424
|
readonly resources: ReadonlyArray<{
|
|
52
425
|
readonly resource: Resource;
|
|
53
426
|
readonly annotations: Context.Context<never>;
|
|
@@ -55,6 +428,7 @@ declare const McpServer_base: Context.ServiceClass<McpServer, "effect/ai/McpServ
|
|
|
55
428
|
readonly addResource: (options: {
|
|
56
429
|
readonly resource: Resource;
|
|
57
430
|
readonly annotations: Context.Context<never>;
|
|
431
|
+
readonly services?: Context.Context<never> | undefined;
|
|
58
432
|
readonly handle: Effect.Effect<ReadResourceResult, InternalError, McpRequestContext>;
|
|
59
433
|
}) => Effect.Effect<void>;
|
|
60
434
|
readonly resourceTemplates: ReadonlyArray<{
|
|
@@ -64,6 +438,7 @@ declare const McpServer_base: Context.ServiceClass<McpServer, "effect/ai/McpServ
|
|
|
64
438
|
readonly addResourceTemplate: (options: {
|
|
65
439
|
readonly template: ResourceTemplate;
|
|
66
440
|
readonly annotations: Context.Context<never>;
|
|
441
|
+
readonly services?: Context.Context<never> | undefined;
|
|
67
442
|
readonly routerPath: string;
|
|
68
443
|
readonly completions: Record<string, (input: string, context: CompletionContext) => Effect.Effect<CompleteResult, InternalError>>;
|
|
69
444
|
readonly handle: (uri: string, params: Array<string>) => Effect.Effect<ReadResourceResult, InvalidParams | InternalError, McpRequestContext>;
|
|
@@ -76,11 +451,12 @@ declare const McpServer_base: Context.ServiceClass<McpServer, "effect/ai/McpServ
|
|
|
76
451
|
readonly addPrompt: (options: {
|
|
77
452
|
readonly prompt: Prompt;
|
|
78
453
|
readonly annotations: Context.Context<never>;
|
|
454
|
+
readonly services?: Context.Context<never> | undefined;
|
|
79
455
|
readonly completions: Record<string, (input: string, context: CompletionContext) => Effect.Effect<CompleteResult, InternalError, McpRequestContext>>;
|
|
80
456
|
readonly handle: (params: Record<string, string>) => Effect.Effect<GetPromptResult | McpSchema.InputRequired, InternalError | InvalidParams, McpRequestContext>;
|
|
81
457
|
}) => Effect.Effect<void>;
|
|
82
|
-
readonly getPromptResult: (request: typeof GetPrompt.payloadSchema.Type) => Effect.Effect<GetPromptResult, InternalError | InvalidParams, McpServerClient>;
|
|
83
|
-
readonly completion: (complete: typeof Complete.payloadSchema.Type) => Effect.Effect<CompleteResult, InvalidParams | InternalError, McpServerClient>;
|
|
458
|
+
readonly getPromptResult: (request: typeof GetPrompt.payloadSchema.Type) => Effect.Effect<GetPromptResult, McpErrorBase | InternalError | InvalidParams, McpServerClient>;
|
|
459
|
+
readonly completion: (complete: typeof Complete.payloadSchema.Type) => Effect.Effect<CompleteResult, McpErrorBase | InvalidParams | InternalError, McpServerClient>;
|
|
84
460
|
}>;
|
|
85
461
|
/**
|
|
86
462
|
* Service that stores and serves an MCP server's registered tools, resources,
|
|
@@ -115,9 +491,10 @@ export declare class McpServer extends McpServer_base {
|
|
|
115
491
|
readonly addTool: (options: {
|
|
116
492
|
readonly tool: McpTool;
|
|
117
493
|
readonly annotations: Context.Context<never>;
|
|
494
|
+
readonly services?: Context.Context<never> | undefined;
|
|
118
495
|
readonly handle: (payload: any) => Effect.Effect<CallToolResult | McpSchema.InputRequired, InternalError | InvalidParams, McpRequestContext>;
|
|
119
496
|
}) => Effect.Effect<void>;
|
|
120
|
-
readonly callTool: (requests: typeof CallTool.payloadSchema.Type) => Effect.Effect<CallToolResult, InternalError | InvalidParams, McpServerClient>;
|
|
497
|
+
readonly callTool: (requests: typeof CallTool.payloadSchema.Type) => Effect.Effect<CallToolResult, McpErrorBase | InternalError | InvalidParams, McpServerClient>;
|
|
121
498
|
readonly resources: ReadonlyArray<{
|
|
122
499
|
readonly resource: Resource;
|
|
123
500
|
readonly annotations: Context.Context<never>;
|
|
@@ -125,6 +502,7 @@ export declare class McpServer extends McpServer_base {
|
|
|
125
502
|
readonly addResource: (options: {
|
|
126
503
|
readonly resource: Resource;
|
|
127
504
|
readonly annotations: Context.Context<never>;
|
|
505
|
+
readonly services?: Context.Context<never> | undefined;
|
|
128
506
|
readonly handle: Effect.Effect<ReadResourceResult, InternalError, McpRequestContext>;
|
|
129
507
|
}) => Effect.Effect<void>;
|
|
130
508
|
readonly resourceTemplates: ReadonlyArray<{
|
|
@@ -134,6 +512,7 @@ export declare class McpServer extends McpServer_base {
|
|
|
134
512
|
readonly addResourceTemplate: (options: {
|
|
135
513
|
readonly template: ResourceTemplate;
|
|
136
514
|
readonly annotations: Context.Context<never>;
|
|
515
|
+
readonly services?: Context.Context<never> | undefined;
|
|
137
516
|
readonly routerPath: string;
|
|
138
517
|
readonly completions: Record<string, (input: string, context: CompletionContext) => Effect.Effect<CompleteResult, InternalError>>;
|
|
139
518
|
readonly handle: (uri: string, params: Array<string>) => Effect.Effect<ReadResourceResult, InvalidParams | InternalError, McpRequestContext>;
|
|
@@ -146,19 +525,79 @@ export declare class McpServer extends McpServer_base {
|
|
|
146
525
|
readonly addPrompt: (options: {
|
|
147
526
|
readonly prompt: Prompt;
|
|
148
527
|
readonly annotations: Context.Context<never>;
|
|
528
|
+
readonly services?: Context.Context<never> | undefined;
|
|
149
529
|
readonly completions: Record<string, (input: string, context: CompletionContext) => Effect.Effect<CompleteResult, InternalError, McpRequestContext>>;
|
|
150
530
|
readonly handle: (params: Record<string, string>) => Effect.Effect<GetPromptResult | McpSchema.InputRequired, InternalError | InvalidParams, McpRequestContext>;
|
|
151
531
|
}) => Effect.Effect<void>;
|
|
152
|
-
readonly getPromptResult: (request: typeof GetPrompt.payloadSchema.Type) => Effect.Effect<GetPromptResult, InternalError | InvalidParams, McpServerClient>;
|
|
153
|
-
readonly completion: (complete: typeof Complete.payloadSchema.Type) => Effect.Effect<CompleteResult, InvalidParams | InternalError, McpServerClient>;
|
|
532
|
+
readonly getPromptResult: (request: typeof GetPrompt.payloadSchema.Type) => Effect.Effect<GetPromptResult, McpErrorBase | InternalError | InvalidParams, McpServerClient>;
|
|
533
|
+
readonly completion: (complete: typeof Complete.payloadSchema.Type) => Effect.Effect<CompleteResult, McpErrorBase | InvalidParams | InternalError, McpServerClient>;
|
|
154
534
|
}, never, Scope.Scope>;
|
|
155
535
|
/**
|
|
156
|
-
* Layer that provides the MCP server
|
|
536
|
+
* Layer that provides the MCP server service.
|
|
537
|
+
*
|
|
538
|
+
* **Details**
|
|
539
|
+
*
|
|
540
|
+
* It doesn't run a transport or discharge request-level dependencies. Use it
|
|
541
|
+
* to call registrations in process, providing their request-level
|
|
542
|
+
* dependencies with MCP middleware.
|
|
157
543
|
*
|
|
158
544
|
* @stability unstable
|
|
159
545
|
* @since 4.0.0
|
|
160
546
|
*/
|
|
161
|
-
static readonly layer: Layer.Layer<McpServer
|
|
547
|
+
static readonly layer: Layer.Layer<McpServer>;
|
|
548
|
+
}
|
|
549
|
+
/**
|
|
550
|
+
* A client cache hint for one kind of `v2026_07_28` result.
|
|
551
|
+
*
|
|
552
|
+
* **Details**
|
|
553
|
+
*
|
|
554
|
+
* `ttl` is how long a client may treat the result as fresh. It is sent as a
|
|
555
|
+
* whole number of milliseconds, rounded down, so it must be finite,
|
|
556
|
+
* nonnegative and at most `Number.MAX_SAFE_INTEGER` milliseconds. Only
|
|
557
|
+
* `"private"` scope is supported, so shared caches must not store the result.
|
|
558
|
+
*
|
|
559
|
+
* @stability unstable
|
|
560
|
+
* @category models
|
|
561
|
+
* @since 4.1.0
|
|
562
|
+
*/
|
|
563
|
+
export interface CacheHint {
|
|
564
|
+
readonly ttl: Duration.Input;
|
|
565
|
+
readonly cacheScope: "private";
|
|
566
|
+
}
|
|
567
|
+
/**
|
|
568
|
+
* Client cache hints for `v2026_07_28` discovery and list results.
|
|
569
|
+
*
|
|
570
|
+
* **Details**
|
|
571
|
+
*
|
|
572
|
+
* Each entry sets the freshness and `cacheScope` of one result kind:
|
|
573
|
+
* `server/discover`, `tools/list`, `resources/list`,
|
|
574
|
+
* `resources/templates/list` and `prompts/list`. `skills` covers the Skills
|
|
575
|
+
* extension's `skills/list`, `skills/get` and `resources/directory/read`.
|
|
576
|
+
* Omitted entries, and `resources/read` results, keep
|
|
577
|
+
* `{ ttlMs: 0, cacheScope: "private" }`. Earlier protocol revisions have no
|
|
578
|
+
* cache hints and ignore this option.
|
|
579
|
+
*
|
|
580
|
+
* These are hints for clients. The server does not cache results, and
|
|
581
|
+
* visibility and invocation checks still run on every request.
|
|
582
|
+
*
|
|
583
|
+
* **Gotchas**
|
|
584
|
+
*
|
|
585
|
+
* A positive `ttl` lets a client keep showing a list after registrations or
|
|
586
|
+
* per-request visibility change, until the hint expires. Private scope does
|
|
587
|
+
* not key a client's cache by user, so a client shared between users can
|
|
588
|
+
* reuse one user's list for another.
|
|
589
|
+
*
|
|
590
|
+
* @stability unstable
|
|
591
|
+
* @category models
|
|
592
|
+
* @since 4.1.0
|
|
593
|
+
*/
|
|
594
|
+
export interface CacheHints {
|
|
595
|
+
readonly discover?: CacheHint | undefined;
|
|
596
|
+
readonly tools?: CacheHint | undefined;
|
|
597
|
+
readonly resources?: CacheHint | undefined;
|
|
598
|
+
readonly resourceTemplates?: CacheHint | undefined;
|
|
599
|
+
readonly prompts?: CacheHint | undefined;
|
|
600
|
+
readonly skills?: CacheHint | undefined;
|
|
162
601
|
}
|
|
163
602
|
/**
|
|
164
603
|
* Runs an MCP server over the current `RpcServer.Protocol`.
|
|
@@ -182,7 +621,26 @@ export declare const run: (options: {
|
|
|
182
621
|
readonly icons?: ReadonlyArray<McpSchema.Icon> | undefined;
|
|
183
622
|
readonly protocols: Arr.NonEmptyReadonlyArray<McpProtocol.ProtocolAdapter>;
|
|
184
623
|
readonly extensions?: ServerExtensions | undefined;
|
|
624
|
+
readonly cacheHints?: CacheHints | undefined;
|
|
185
625
|
}) => Effect.Effect<never, Cause.IllegalArgumentError, McpServer | RpcServer.Protocol>;
|
|
626
|
+
type StatefulProtocolAdapter = McpProtocol.ProtocolAdapter<McpProtocol.ProtocolVersion, McpProtocol.StatefulRuntimeDescriptor>;
|
|
627
|
+
/**
|
|
628
|
+
* Request-level services supplied by a transport.
|
|
629
|
+
*
|
|
630
|
+
* **Details**
|
|
631
|
+
*
|
|
632
|
+
* Every transport supplies `Scope`. `McpServerClient` is supplied only when
|
|
633
|
+
* every configured protocol is known to be sessionful: a `v2026_07_28` request
|
|
634
|
+
* has no client session, and a protocol array widened to `ProtocolAdapter`
|
|
635
|
+
* might contain one. HTTP transports also supply `HttpServerRequest`.
|
|
636
|
+
*
|
|
637
|
+
* @stability unstable
|
|
638
|
+
* @category utility types
|
|
639
|
+
* @since 4.0.0
|
|
640
|
+
*/
|
|
641
|
+
export type ProvidedServices<Protocols extends ReadonlyArray<McpProtocol.ProtocolAdapter>, Http extends boolean = false> = Scope.Scope | (Protocols[number] extends StatefulProtocolAdapter ? McpServerClient : never) | (Http extends true ? HttpServerRequest.HttpServerRequest : never);
|
|
642
|
+
type RemainingRequestServices<RR, Provided> = Exclude<McpRequest.Only<"Requires", RR>, Provided>;
|
|
643
|
+
type RegistrationServices<RR> = Exclude<McpRequest.Without<RR>, McpServer>;
|
|
186
644
|
/**
|
|
187
645
|
* Creates a layer that starts an MCP server over an existing
|
|
188
646
|
* `RpcServer.Protocol` and provides `McpServer`. Request handlers receive
|
|
@@ -201,6 +659,11 @@ export declare const run: (options: {
|
|
|
201
659
|
* `McpServer.layer`, so registration layers can use the `McpServer` service
|
|
202
660
|
* while the server is running.
|
|
203
661
|
*
|
|
662
|
+
* Pass registration layers as `registrations` to build them before the server
|
|
663
|
+
* reads its first request. The transport discharges the request-level
|
|
664
|
+
* dependencies it supplies (see `ProvidedServices`); any other `McpRequest`
|
|
665
|
+
* marker stays in the layer's requirements and must be met by MCP middleware.
|
|
666
|
+
*
|
|
204
667
|
* **Gotchas**
|
|
205
668
|
*
|
|
206
669
|
* Unlike `layerStdio` and `layerHttp`, this layer does not install a concrete
|
|
@@ -214,16 +677,18 @@ export declare const run: (options: {
|
|
|
214
677
|
* @category layers
|
|
215
678
|
* @since 4.0.0
|
|
216
679
|
*/
|
|
217
|
-
export declare const layer: (options: {
|
|
680
|
+
export declare const layer: <const Protocols extends Arr.NonEmptyReadonlyArray<McpProtocol.ProtocolAdapter>, RA = never, RE = never, RR = never>(options: {
|
|
218
681
|
readonly name: string;
|
|
219
682
|
readonly version: string;
|
|
220
683
|
readonly instructions?: string | undefined;
|
|
221
684
|
readonly description?: string | undefined;
|
|
222
685
|
readonly websiteUrl?: string | undefined;
|
|
223
686
|
readonly icons?: ReadonlyArray<McpSchema.Icon> | undefined;
|
|
224
|
-
readonly protocols:
|
|
687
|
+
readonly protocols: Protocols;
|
|
225
688
|
readonly extensions?: ServerExtensions | undefined;
|
|
226
|
-
|
|
689
|
+
readonly cacheHints?: CacheHints | undefined;
|
|
690
|
+
readonly registrations?: Layer.Layer<RA, RE, RR> | undefined;
|
|
691
|
+
}) => Layer.Layer<McpServer | McpRequest.From<"Requires", ProvidedServices<Protocols>>, Cause.IllegalArgumentError | RE, RpcServer.Protocol | RegistrationServices<RR> | McpRequest.From<"Requires", RemainingRequestServices<RR, ProvidedServices<Protocols>>>>;
|
|
227
692
|
/**
|
|
228
693
|
* Creates a layer that runs an MCP server over standard input and output.
|
|
229
694
|
*
|
|
@@ -239,6 +704,11 @@ export declare const layer: (options: {
|
|
|
239
704
|
* `McpRequestContext` and legacy `McpServerClient` services to handlers, and
|
|
240
705
|
* requires `Stdio`.
|
|
241
706
|
*
|
|
707
|
+
* Pass registration layers as `registrations` to build them before the server
|
|
708
|
+
* reads its first request. The transport discharges the request-level
|
|
709
|
+
* dependencies it supplies (see `ProvidedServices`); any other `McpRequest`
|
|
710
|
+
* marker stays in the layer's requirements and must be met by MCP middleware.
|
|
711
|
+
*
|
|
242
712
|
* @see {@link layer} for running over an existing `RpcServer.Protocol`
|
|
243
713
|
* @see {@link layerHttp} for the single-endpoint HTTP transport
|
|
244
714
|
*
|
|
@@ -246,16 +716,18 @@ export declare const layer: (options: {
|
|
|
246
716
|
* @category layers
|
|
247
717
|
* @since 4.0.0
|
|
248
718
|
*/
|
|
249
|
-
export declare const layerStdio: (options: {
|
|
719
|
+
export declare const layerStdio: <const Protocols extends Arr.NonEmptyReadonlyArray<McpProtocol.ProtocolAdapter>, RA = never, RE = never, RR = never>(options: {
|
|
250
720
|
readonly name: string;
|
|
251
721
|
readonly version: string;
|
|
252
722
|
readonly instructions?: string | undefined;
|
|
253
723
|
readonly description?: string | undefined;
|
|
254
724
|
readonly websiteUrl?: string | undefined;
|
|
255
725
|
readonly icons?: ReadonlyArray<McpSchema.Icon> | undefined;
|
|
256
|
-
readonly protocols:
|
|
726
|
+
readonly protocols: Protocols;
|
|
257
727
|
readonly extensions?: ServerExtensions | undefined;
|
|
258
|
-
|
|
728
|
+
readonly cacheHints?: CacheHints | undefined;
|
|
729
|
+
readonly registrations?: Layer.Layer<RA, RE, RR> | undefined;
|
|
730
|
+
}) => Layer.Layer<McpServer | McpRequest.From<"Requires", ProvidedServices<Protocols>>, Cause.IllegalArgumentError | RE, Stdio | RegistrationServices<RR> | McpRequest.From<"Requires", RemainingRequestServices<RR, ProvidedServices<Protocols>>>>;
|
|
259
731
|
/**
|
|
260
732
|
* Registers a Streamable HTTP MCP endpoint at `options.path`.
|
|
261
733
|
*
|
|
@@ -293,6 +765,13 @@ export declare const layerStdio: (options: {
|
|
|
293
765
|
* serverless hosts where execution must belong to each request, use
|
|
294
766
|
* `layerHttpRequestScoped` instead.
|
|
295
767
|
*
|
|
768
|
+
* Pass registration layers as `registrations` to build them before the
|
|
769
|
+
* endpoint serves its first request. The transport discharges the
|
|
770
|
+
* request-level dependencies it supplies (see `ProvidedServices`) and converts
|
|
771
|
+
* the remaining `McpRequest` markers into `HttpRouter.Request` markers, so
|
|
772
|
+
* `HttpRouter.middleware` can provide them, for example to authenticate the
|
|
773
|
+
* request and resolve the current user.
|
|
774
|
+
*
|
|
296
775
|
* `layerHttp` always implements the single-endpoint Streamable HTTP topology.
|
|
297
776
|
* Using `v2024_11_05` here is a custom compatibility transport for that
|
|
298
777
|
* revision's schema. It does not implement the historical two-endpoint
|
|
@@ -310,7 +789,7 @@ export declare const layerStdio: (options: {
|
|
|
310
789
|
* @category layers
|
|
311
790
|
* @since 4.0.0
|
|
312
791
|
*/
|
|
313
|
-
export declare const layerHttp: (options: {
|
|
792
|
+
export declare const layerHttp: <const Protocols extends Arr.NonEmptyReadonlyArray<McpProtocol.ProtocolAdapter>, RA = never, RE = never, RR = never>(options: {
|
|
314
793
|
readonly name: string;
|
|
315
794
|
readonly version: string;
|
|
316
795
|
readonly instructions?: string | undefined;
|
|
@@ -318,12 +797,14 @@ export declare const layerHttp: (options: {
|
|
|
318
797
|
readonly websiteUrl?: string | undefined;
|
|
319
798
|
readonly icons?: ReadonlyArray<McpSchema.Icon> | undefined;
|
|
320
799
|
readonly path: HttpRouter.PathInput;
|
|
321
|
-
readonly protocols:
|
|
800
|
+
readonly protocols: Protocols;
|
|
322
801
|
readonly extensions?: ServerExtensions | undefined;
|
|
802
|
+
readonly cacheHints?: CacheHints | undefined;
|
|
323
803
|
readonly allowedOrigins?: ReadonlyArray<string> | undefined;
|
|
324
804
|
readonly allowSessionTermination?: boolean | undefined;
|
|
325
805
|
readonly allowSubscriptions?: boolean | undefined;
|
|
326
|
-
|
|
806
|
+
readonly registrations?: Layer.Layer<RA, RE, RR> | undefined;
|
|
807
|
+
}) => Layer.Layer<McpServer | McpRequest.From<"Requires", ProvidedServices<Protocols, true>>, Cause.IllegalArgumentError | RE, HttpRouter.HttpRouter | RegistrationServices<RR> | HttpRouter.Request.From<"Requires", RemainingRequestServices<RR, ProvidedServices<Protocols, true>>>>;
|
|
327
808
|
/**
|
|
328
809
|
* Registers a request-scoped Streamable HTTP MCP endpoint at `options.path`.
|
|
329
810
|
*
|
|
@@ -352,13 +833,17 @@ export declare const layerHttp: (options: {
|
|
|
352
833
|
* Configuring a sessionful protocol through an untyped caller fails layer
|
|
353
834
|
* construction with `IllegalArgumentError`.
|
|
354
835
|
*
|
|
836
|
+
* Registrations passed as `registrations` are built once, before the routes
|
|
837
|
+
* are added, and shared by every POST. Remaining `McpRequest` markers become
|
|
838
|
+
* `HttpRouter.Request` markers, as with `layerHttp`.
|
|
839
|
+
*
|
|
355
840
|
* @see {@link layerHttp} for the long-lived HTTP transport and HTTP admission policy
|
|
356
841
|
*
|
|
357
842
|
* @stability unstable
|
|
358
843
|
* @category layers
|
|
359
844
|
* @since 4.0.0
|
|
360
845
|
*/
|
|
361
|
-
export declare const layerHttpRequestScoped: (options: {
|
|
846
|
+
export declare const layerHttpRequestScoped: <const Protocols extends Arr.NonEmptyReadonlyArray<McpProtocol.ProtocolAdapter<McpProtocol.ProtocolVersion, McpProtocol.StatelessRuntimeDescriptor>>, RA = never, RE = never, RR = never>(options: {
|
|
362
847
|
readonly name: string;
|
|
363
848
|
readonly version: string;
|
|
364
849
|
readonly instructions?: string | undefined;
|
|
@@ -366,26 +851,59 @@ export declare const layerHttpRequestScoped: (options: {
|
|
|
366
851
|
readonly websiteUrl?: string | undefined;
|
|
367
852
|
readonly icons?: ReadonlyArray<McpSchema.Icon> | undefined;
|
|
368
853
|
readonly path: HttpRouter.PathInput;
|
|
369
|
-
readonly protocols:
|
|
854
|
+
readonly protocols: Protocols;
|
|
370
855
|
readonly extensions?: ServerExtensions | undefined;
|
|
856
|
+
readonly cacheHints?: CacheHints | undefined;
|
|
371
857
|
readonly allowedOrigins?: ReadonlyArray<string> | undefined;
|
|
372
|
-
|
|
858
|
+
readonly registrations?: Layer.Layer<RA, RE, RR> | undefined;
|
|
859
|
+
}) => Layer.Layer<McpServer | McpRequest.From<"Requires", ProvidedServices<Protocols, true>>, Cause.IllegalArgumentError | RE, HttpRouter.HttpRouter | RegistrationServices<RR> | HttpRouter.Request.From<"Requires", RemainingRequestServices<RR, ProvidedServices<Protocols, true>>>>;
|
|
860
|
+
/**
|
|
861
|
+
* The requirements of a toolkit registration.
|
|
862
|
+
*
|
|
863
|
+
* **Details**
|
|
864
|
+
*
|
|
865
|
+
* Services a tool declares with `dependencies` or `Tool.addDependency` are
|
|
866
|
+
* request-level: they are carried as `McpRequest<"Requires", S>` markers and
|
|
867
|
+
* must be provided by MCP middleware or the transport. Parameter decoding and
|
|
868
|
+
* result encoding services are required when the toolkit is registered,
|
|
869
|
+
* unless a tool also declares them.
|
|
870
|
+
*
|
|
871
|
+
* @stability unstable
|
|
872
|
+
* @category utility types
|
|
873
|
+
* @since 4.0.0
|
|
874
|
+
*/
|
|
875
|
+
export type ToolkitRequirements<Tools extends Record<string, Tool.Any>> = 0 extends (1 & Tool.Requirements<Tools[keyof Tools]>) ? any : Tool.HandlersFor<Tools> | RegistrationRequirements<Tool.SchemaServices<Tools[keyof Tools]>, Tool.Requirements<Tools[keyof Tools]>>;
|
|
876
|
+
type RegistrationRequirements<SchemaServices, RequestServices> = McpServer | Exclude<SchemaServices, RequestServices | McpRequestContext> | McpRequest.From<"Requires", Exclude<RequestServices, McpRequestContext>>;
|
|
373
877
|
/**
|
|
374
878
|
* Registers a `Toolkit` with the `McpServer`.
|
|
375
879
|
*
|
|
880
|
+
* **Details**
|
|
881
|
+
*
|
|
882
|
+
* The MCP middleware in the current context, provided with
|
|
883
|
+
* `Effect.provide(middleware.layer)`, runs around every call to the toolkit.
|
|
884
|
+
*
|
|
885
|
+
* @see {@link ToolkitRequirements} for which services are request-level
|
|
886
|
+
*
|
|
376
887
|
* @stability unstable
|
|
377
888
|
* @category handlers
|
|
378
889
|
* @since 4.0.0
|
|
379
890
|
*/
|
|
380
|
-
export declare const registerToolkit: <Tools extends Record<string, Tool.Any>>(toolkit: Toolkit.Toolkit<Tools>) => Effect.Effect<void, never,
|
|
891
|
+
export declare const registerToolkit: <Tools extends Record<string, Tool.Any>>(toolkit: Toolkit.Toolkit<Tools>) => Effect.Effect<void, never, ToolkitRequirements<Tools>>;
|
|
381
892
|
/**
|
|
382
|
-
*
|
|
893
|
+
* Creates a layer that registers a `Toolkit` with the `McpServer`.
|
|
894
|
+
*
|
|
895
|
+
* **Details**
|
|
896
|
+
*
|
|
897
|
+
* The layer requires `McpServer`. Pass it to a transport through the
|
|
898
|
+
* `registrations` option, or provide the transport layer to it.
|
|
899
|
+
*
|
|
900
|
+
* @see {@link ToolkitRequirements} for which services are request-level
|
|
383
901
|
*
|
|
384
902
|
* @stability unstable
|
|
385
903
|
* @category layers
|
|
386
904
|
* @since 4.0.0
|
|
387
905
|
*/
|
|
388
|
-
export declare const toolkit: <Tools extends Record<string, Tool.Any>>(toolkit: Toolkit.Toolkit<Tools>) => Layer.Layer<never, never,
|
|
906
|
+
export declare const toolkit: <Tools extends Record<string, Tool.Any>>(toolkit: Toolkit.Toolkit<Tools>) => Layer.Layer<never, never, ToolkitRequirements<Tools>>;
|
|
389
907
|
/**
|
|
390
908
|
* Utility type that validates a completion-handler record against the allowed
|
|
391
909
|
* parameter keys.
|
|
@@ -424,6 +942,50 @@ export type CompletionServices<Completions> = {
|
|
|
424
942
|
export type ResourceCompletions<Schemas extends ReadonlyArray<Schema.Constraint>> = {
|
|
425
943
|
readonly [K in Extract<keyof Schemas, `${number}`> as Schemas[K] extends Param<infer Id, infer _S> ? Id : `param${K}`]: (input: string, context: CompletionContext) => Effect.Effect<Array<Schemas[K]["Type"]>, any, any>;
|
|
426
944
|
};
|
|
945
|
+
type TemplateParamKey<Schemas extends ReadonlyArray<Schema.Constraint>, K extends keyof Schemas> = Schemas[K] extends Param<infer Id, infer _S> ? Id : `param${K & string}`;
|
|
946
|
+
type TemplateSchemaServices<Schemas extends ReadonlyArray<Schema.Constraint>, Completions> = Schemas[number]["DecodingServices"] | {
|
|
947
|
+
[K in Extract<keyof Schemas, `${number}`>]: TemplateParamKey<Schemas, K> extends keyof Completions ? Schemas[K]["EncodingServices"] : never;
|
|
948
|
+
}[Extract<keyof Schemas, `${number}`>];
|
|
949
|
+
type PromptSchemaServices<Params extends Schema.Struct.Fields, Completions> = Schema.Struct.DecodingServices<Params> | Params[Extract<keyof Completions, keyof Params>]["EncodingServices"];
|
|
950
|
+
/**
|
|
951
|
+
* The requirements of a resource registration: the content handler's services
|
|
952
|
+
* are request-level.
|
|
953
|
+
*
|
|
954
|
+
* @stability unstable
|
|
955
|
+
* @category utility types
|
|
956
|
+
* @since 4.0.0
|
|
957
|
+
*/
|
|
958
|
+
export type ResourceRequirements<R> = RegistrationRequirements<never, R>;
|
|
959
|
+
/**
|
|
960
|
+
* The requirements of a resource template registration.
|
|
961
|
+
*
|
|
962
|
+
* **Details**
|
|
963
|
+
*
|
|
964
|
+
* Services read by the content and completion handlers are request-level.
|
|
965
|
+
* Parameter decoding services, and the encoding services of parameters with a
|
|
966
|
+
* completion handler, are required when the template is registered, unless a
|
|
967
|
+
* handler also reads them.
|
|
968
|
+
*
|
|
969
|
+
* @stability unstable
|
|
970
|
+
* @category utility types
|
|
971
|
+
* @since 4.0.0
|
|
972
|
+
*/
|
|
973
|
+
export type ResourceTemplateRequirements<Schemas extends ReadonlyArray<Schema.Constraint>, R, Completions> = RegistrationRequirements<TemplateSchemaServices<Schemas, Completions>, R | CompletionServices<Completions>>;
|
|
974
|
+
/**
|
|
975
|
+
* The requirements of a prompt registration.
|
|
976
|
+
*
|
|
977
|
+
* **Details**
|
|
978
|
+
*
|
|
979
|
+
* Services read by the content and completion handlers are request-level.
|
|
980
|
+
* Parameter decoding services, and the encoding services of parameters with a
|
|
981
|
+
* completion handler, are required when the prompt is registered, unless a
|
|
982
|
+
* handler also reads them.
|
|
983
|
+
*
|
|
984
|
+
* @stability unstable
|
|
985
|
+
* @category utility types
|
|
986
|
+
* @since 4.0.0
|
|
987
|
+
*/
|
|
988
|
+
export type PromptRequirements<Params extends Schema.Struct.Fields, R, Completions> = RegistrationRequirements<PromptSchemaServices<Params, Completions>, R | CompletionServices<Completions>>;
|
|
427
989
|
/**
|
|
428
990
|
* Registers an MCP resource or resource template from an Effect program.
|
|
429
991
|
*
|
|
@@ -452,7 +1014,7 @@ export declare const registerResource: {
|
|
|
452
1014
|
readonly priority?: number | undefined;
|
|
453
1015
|
readonly content: Effect.Effect<ReadResourceResult | string | Uint8Array, E, R>;
|
|
454
1016
|
readonly annotations?: Context.Context<never> | undefined;
|
|
455
|
-
}): Effect.Effect<void, never,
|
|
1017
|
+
}): Effect.Effect<void, never, ResourceRequirements<R>>;
|
|
456
1018
|
/**
|
|
457
1019
|
* Registers an MCP resource or resource template from an Effect program.
|
|
458
1020
|
*
|
|
@@ -473,12 +1035,20 @@ export declare const registerResource: {
|
|
|
473
1035
|
readonly [K in keyof Schemas]: Schemas[K]["Type"];
|
|
474
1036
|
}) => Effect.Effect<ReadResourceResult | string | Uint8Array, E, R>;
|
|
475
1037
|
readonly annotations?: Context.Context<never> | undefined;
|
|
476
|
-
}) => Effect.Effect<void, never,
|
|
1038
|
+
}) => Effect.Effect<void, never, ResourceTemplateRequirements<Schemas, R, Completions>>;
|
|
477
1039
|
};
|
|
478
1040
|
/**
|
|
479
1041
|
* Creates a layer that registers an MCP resource or resource template.
|
|
480
1042
|
*
|
|
1043
|
+
* **Details**
|
|
1044
|
+
*
|
|
1045
|
+
* Services read by the content and completion handlers are request-level, so
|
|
1046
|
+
* providing them with `Layer.provide` doesn't satisfy them. Read
|
|
1047
|
+
* construction-time services in an enclosing `Layer.unwrap` and close over
|
|
1048
|
+
* them, and provide per-request services with MCP middleware.
|
|
1049
|
+
*
|
|
481
1050
|
* @see {@link registerResource} for the Effect-level resource registration API
|
|
1051
|
+
* @see {@link middleware} for providing request-level dependencies
|
|
482
1052
|
*
|
|
483
1053
|
* @stability unstable
|
|
484
1054
|
* @category layers
|
|
@@ -488,7 +1058,15 @@ export declare const resource: {
|
|
|
488
1058
|
/**
|
|
489
1059
|
* Creates a layer that registers an MCP resource or resource template.
|
|
490
1060
|
*
|
|
1061
|
+
* **Details**
|
|
1062
|
+
*
|
|
1063
|
+
* Services read by the content and completion handlers are request-level, so
|
|
1064
|
+
* providing them with `Layer.provide` doesn't satisfy them. Read
|
|
1065
|
+
* construction-time services in an enclosing `Layer.unwrap` and close over
|
|
1066
|
+
* them, and provide per-request services with MCP middleware.
|
|
1067
|
+
*
|
|
491
1068
|
* @see {@link registerResource} for the Effect-level resource registration API
|
|
1069
|
+
* @see {@link middleware} for providing request-level dependencies
|
|
492
1070
|
*
|
|
493
1071
|
* @stability unstable
|
|
494
1072
|
* @category layers
|
|
@@ -502,11 +1080,19 @@ export declare const resource: {
|
|
|
502
1080
|
readonly audience?: ReadonlyArray<"user" | "assistant"> | undefined;
|
|
503
1081
|
readonly priority?: number | undefined;
|
|
504
1082
|
readonly content: Effect.Effect<ReadResourceResult | string | Uint8Array, E, R>;
|
|
505
|
-
}): Layer.Layer<never, never,
|
|
1083
|
+
}): Layer.Layer<never, never, ResourceRequirements<R>>;
|
|
506
1084
|
/**
|
|
507
1085
|
* Creates a layer that registers an MCP resource or resource template.
|
|
508
1086
|
*
|
|
1087
|
+
* **Details**
|
|
1088
|
+
*
|
|
1089
|
+
* Services read by the content and completion handlers are request-level, so
|
|
1090
|
+
* providing them with `Layer.provide` doesn't satisfy them. Read
|
|
1091
|
+
* construction-time services in an enclosing `Layer.unwrap` and close over
|
|
1092
|
+
* them, and provide per-request services with MCP middleware.
|
|
1093
|
+
*
|
|
509
1094
|
* @see {@link registerResource} for the Effect-level resource registration API
|
|
1095
|
+
* @see {@link middleware} for providing request-level dependencies
|
|
510
1096
|
*
|
|
511
1097
|
* @stability unstable
|
|
512
1098
|
* @category layers
|
|
@@ -522,8 +1108,114 @@ export declare const resource: {
|
|
|
522
1108
|
readonly content: (uri: string, ...params: {
|
|
523
1109
|
readonly [K in keyof Schemas]: Schemas[K]["Type"];
|
|
524
1110
|
}) => Effect.Effect<ReadResourceResult | string | Uint8Array, E, R>;
|
|
525
|
-
}) => Layer.Layer<never, never,
|
|
1111
|
+
}) => Layer.Layer<never, never, ResourceTemplateRequirements<Schemas, R, Completions>>;
|
|
526
1112
|
};
|
|
1113
|
+
/**
|
|
1114
|
+
* A file of a skill: its text, its bytes, or either with an explicit MIME
|
|
1115
|
+
* type. Without one, the MIME type is inferred from the file extension.
|
|
1116
|
+
*
|
|
1117
|
+
* @stability unstable
|
|
1118
|
+
* @category models
|
|
1119
|
+
* @since 4.1.1
|
|
1120
|
+
*/
|
|
1121
|
+
export type SkillFile = string | Uint8Array | {
|
|
1122
|
+
readonly content: string | Uint8Array;
|
|
1123
|
+
readonly mimeType?: string | undefined;
|
|
1124
|
+
};
|
|
1125
|
+
/**
|
|
1126
|
+
* Options for {@link registerSkill} and {@link skill}.
|
|
1127
|
+
*
|
|
1128
|
+
* **Details**
|
|
1129
|
+
*
|
|
1130
|
+
* `uri` addresses the skill's `SKILL.md`, as
|
|
1131
|
+
* `skill://<skill-path>/SKILL.md`. Its last path segment is the skill's name,
|
|
1132
|
+
* which must equal the frontmatter's `name`. Other schemes work the same way.
|
|
1133
|
+
*
|
|
1134
|
+
* `files` maps paths relative to the skill root to the skill's files,
|
|
1135
|
+
* `SKILL.md` included. Files are served verbatim, and the skill's listed
|
|
1136
|
+
* frontmatter is parsed from `SKILL.md`. Quote frontmatter strings that a YAML
|
|
1137
|
+
* 1.1 parser reads as another type, such as `yes` or `1.0`.
|
|
1138
|
+
*
|
|
1139
|
+
* @stability unstable
|
|
1140
|
+
* @category models
|
|
1141
|
+
* @since 4.1.1
|
|
1142
|
+
*/
|
|
1143
|
+
export interface SkillOptions {
|
|
1144
|
+
readonly uri: string;
|
|
1145
|
+
readonly files: {
|
|
1146
|
+
readonly "SKILL.md": SkillFile;
|
|
1147
|
+
} & Readonly<Record<string, SkillFile>>;
|
|
1148
|
+
readonly annotations?: Context.Context<never> | undefined;
|
|
1149
|
+
}
|
|
1150
|
+
/**
|
|
1151
|
+
* Registers an Agent Skill under the MCP Skills extension (SEP-2640).
|
|
1152
|
+
*
|
|
1153
|
+
* **Details**
|
|
1154
|
+
*
|
|
1155
|
+
* Each file is registered as a resource, and the skill is listed by
|
|
1156
|
+
* `skills/list` and `skills/get` with a manifest of every file's SHA-256
|
|
1157
|
+
* digest and size, computed from the bytes served. Every directory of the
|
|
1158
|
+
* skill namespace is readable with `resources/directory/read`. The server
|
|
1159
|
+
* declares the extension once any skill is registered.
|
|
1160
|
+
*
|
|
1161
|
+
* Fails when the skill breaks the extension's rules: a name that does not
|
|
1162
|
+
* match the URI, a `SKILL.md` without YAML frontmatter, frontmatter that is
|
|
1163
|
+
* not valid {@link McpSchema.SkillFrontmatter}, a file path that leaves the
|
|
1164
|
+
* skill, or more than 512 files or 16 MiB in all. It also fails when the
|
|
1165
|
+
* skill's directory contains or lies inside another skill's, or one of its
|
|
1166
|
+
* files is already registered as a resource. Registering a resource at the
|
|
1167
|
+
* URI of a skill's file afterwards is a defect.
|
|
1168
|
+
*
|
|
1169
|
+
* SHA-256 runs on `crypto.subtle`.
|
|
1170
|
+
*
|
|
1171
|
+
* @see {@link skill} for the layer-based skill registration wrapper
|
|
1172
|
+
*
|
|
1173
|
+
* @stability unstable
|
|
1174
|
+
* @category handlers
|
|
1175
|
+
* @since 4.1.1
|
|
1176
|
+
*/
|
|
1177
|
+
export declare const registerSkill: (options: SkillOptions) => Effect.Effect<void, Cause.IllegalArgumentError, McpServer>;
|
|
1178
|
+
/**
|
|
1179
|
+
* Creates a layer that registers an Agent Skill under the MCP Skills extension
|
|
1180
|
+
* (SEP-2640).
|
|
1181
|
+
*
|
|
1182
|
+
* **Example** (Publishing a skill with a supporting file)
|
|
1183
|
+
*
|
|
1184
|
+
* ```ts
|
|
1185
|
+
* import { Layer } from "effect"
|
|
1186
|
+
* import { McpProtocol, McpServer } from "effect/ai"
|
|
1187
|
+
*
|
|
1188
|
+
* const RefundsSkill = McpServer.skill({
|
|
1189
|
+
* uri: "skill://billing/refunds/SKILL.md",
|
|
1190
|
+
* files: {
|
|
1191
|
+
* "SKILL.md": `---
|
|
1192
|
+
* name: refunds
|
|
1193
|
+
* description: Process refunds using the billing tools
|
|
1194
|
+
* ---
|
|
1195
|
+
*
|
|
1196
|
+
* Read references/policy.md before issuing a refund.
|
|
1197
|
+
* `,
|
|
1198
|
+
* "references/policy.md": "Refunds above CHF 500 require manager approval.\n"
|
|
1199
|
+
* }
|
|
1200
|
+
* })
|
|
1201
|
+
*
|
|
1202
|
+
* const ServerLayer = RefundsSkill.pipe(
|
|
1203
|
+
* Layer.provide(McpServer.layerHttp({
|
|
1204
|
+
* name: "billing",
|
|
1205
|
+
* version: "1.0.0",
|
|
1206
|
+
* path: "/mcp",
|
|
1207
|
+
* protocols: [McpProtocol.v2026_07_28, McpProtocol.v2025_11_25]
|
|
1208
|
+
* }))
|
|
1209
|
+
* )
|
|
1210
|
+
* ```
|
|
1211
|
+
*
|
|
1212
|
+
* @see {@link registerSkill} for the Effect-level skill registration API
|
|
1213
|
+
*
|
|
1214
|
+
* @stability unstable
|
|
1215
|
+
* @category layers
|
|
1216
|
+
* @since 4.1.1
|
|
1217
|
+
*/
|
|
1218
|
+
export declare const skill: (options: SkillOptions) => Layer.Layer<never, Cause.IllegalArgumentError, McpServer>;
|
|
527
1219
|
/**
|
|
528
1220
|
* Registers an MCP prompt from an Effect program.
|
|
529
1221
|
*
|
|
@@ -546,11 +1238,19 @@ export declare const registerPrompt: <E, R, Params extends Schema.Struct.Fields
|
|
|
546
1238
|
readonly completion?: ValidateCompletions<Completions, Extract<keyof Params, string>> | undefined;
|
|
547
1239
|
readonly content: (params: Schema.Struct.Type<Params>) => Effect.Effect<Array<PromptMessage> | string, E, R>;
|
|
548
1240
|
readonly annotations?: Context.Context<never> | undefined;
|
|
549
|
-
}) => Effect.Effect<void, never,
|
|
1241
|
+
}) => Effect.Effect<void, never, PromptRequirements<Params, R, Completions>>;
|
|
550
1242
|
/**
|
|
551
1243
|
* Creates a layer that registers an MCP prompt.
|
|
552
1244
|
*
|
|
1245
|
+
* **Details**
|
|
1246
|
+
*
|
|
1247
|
+
* Services read by the content and completion handlers are request-level, so
|
|
1248
|
+
* providing them with `Layer.provide` doesn't satisfy them. Read
|
|
1249
|
+
* construction-time services in an enclosing `Layer.unwrap` and close over
|
|
1250
|
+
* them, and provide per-request services with MCP middleware.
|
|
1251
|
+
*
|
|
553
1252
|
* @see {@link registerPrompt} for the Effect-level prompt registration API
|
|
1253
|
+
* @see {@link middleware} for providing request-level dependencies
|
|
554
1254
|
*
|
|
555
1255
|
* @stability unstable
|
|
556
1256
|
* @category layers
|
|
@@ -564,7 +1264,7 @@ export declare const prompt: <E, R, Params extends Schema.Struct.Fields = {}, co
|
|
|
564
1264
|
readonly completion?: ValidateCompletions<Completions, Extract<keyof Params, string>> | undefined;
|
|
565
1265
|
readonly content: (params: Schema.Struct.Type<Params>) => Effect.Effect<Array<PromptMessage> | string, E, R>;
|
|
566
1266
|
readonly annotations?: Context.Context<never> | undefined;
|
|
567
|
-
}) => Layer.Layer<never, never,
|
|
1267
|
+
}) => Layer.Layer<never, never, PromptRequirements<Params, R, Completions>>;
|
|
568
1268
|
/**
|
|
569
1269
|
* Collects structured input from the current MCP client and decodes the
|
|
570
1270
|
* accepted response with `schema`.
|
|
@@ -590,5 +1290,20 @@ export declare const elicit: <S extends Schema.ConstraintEncoder<Record<string,
|
|
|
590
1290
|
* @since 4.0.0
|
|
591
1291
|
*/
|
|
592
1292
|
export declare const clientCapabilities: Effect.Effect<ClientCapabilities, never, McpRequestContext>;
|
|
1293
|
+
/**
|
|
1294
|
+
* Decodes an `Mcp-Name` header, including base64-wrapped values.
|
|
1295
|
+
* Returns `undefined` for malformed values.
|
|
1296
|
+
*
|
|
1297
|
+
* **Details**
|
|
1298
|
+
*
|
|
1299
|
+
* Use in `HttpRouter.middleware` to identify the tool, prompt or resource
|
|
1300
|
+
* targeted by a `2026-07-28` request. Earlier protocols carry the name only
|
|
1301
|
+
* in the JSON-RPC body.
|
|
1302
|
+
*
|
|
1303
|
+
* @stability unstable
|
|
1304
|
+
* @category decoding
|
|
1305
|
+
* @since 4.0.0
|
|
1306
|
+
*/
|
|
1307
|
+
export declare const decodeNameHeader: (value: string) => string | undefined;
|
|
593
1308
|
export {};
|
|
594
1309
|
//# sourceMappingURL=McpServer.d.ts.map
|