effect 4.1.5 → 4.1.7
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/ai-docs/package.json +2 -2
- package/dist/Channel.d.ts +104 -7
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +73 -4
- package/dist/Channel.js.map +1 -1
- package/dist/Codegen.d.ts +7 -2
- package/dist/Codegen.d.ts.map +1 -1
- package/dist/Codegen.js +7 -2
- package/dist/Codegen.js.map +1 -1
- package/dist/Config.d.ts +1 -1
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +5 -3
- package/dist/Config.js.map +1 -1
- package/dist/Context.d.ts.map +1 -1
- package/dist/Context.js +79 -31
- package/dist/Context.js.map +1 -1
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +10 -9
- package/dist/Cron.js.map +1 -1
- package/dist/Effect.d.ts +139 -18
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +10 -2
- package/dist/Effect.js.map +1 -1
- package/dist/Equal.d.ts +4 -4
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equal.js +78 -66
- package/dist/Equal.js.map +1 -1
- package/dist/Formatter.js +4 -4
- package/dist/Formatter.js.map +1 -1
- package/dist/Hash.d.ts.map +1 -1
- package/dist/Hash.js +34 -41
- package/dist/Hash.js.map +1 -1
- package/dist/LayerRef.d.ts +1 -1
- package/dist/LayerRef.d.ts.map +1 -1
- package/dist/LayerRef.js +3 -3
- package/dist/LayerRef.js.map +1 -1
- package/dist/Logger.d.ts +37 -13
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +39 -10
- package/dist/Logger.js.map +1 -1
- package/dist/Match.d.ts +23 -23
- package/dist/Match.d.ts.map +1 -1
- package/dist/Match.js.map +1 -1
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +3 -4
- package/dist/Metric.js.map +1 -1
- package/dist/Order.js +1 -1
- package/dist/Order.js.map +1 -1
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +49 -21
- package/dist/Pool.js.map +1 -1
- package/dist/Predicate.d.ts.map +1 -1
- package/dist/Predicate.js +2 -1
- package/dist/Predicate.js.map +1 -1
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +15 -9
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +41 -0
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +51 -390
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +2 -2
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +199 -98
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +29 -50
- package/dist/SchemaParser.js.map +1 -1
- package/dist/ScopedCache.d.ts.map +1 -1
- package/dist/ScopedCache.js +6 -4
- package/dist/ScopedCache.js.map +1 -1
- package/dist/Stream.d.ts +128 -5
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +124 -29
- package/dist/Stream.js.map +1 -1
- package/dist/String.js +1 -1
- package/dist/String.js.map +1 -1
- package/dist/Tracer.d.ts +10 -0
- package/dist/Tracer.d.ts.map +1 -1
- package/dist/Tracer.js +3 -4
- package/dist/Tracer.js.map +1 -1
- package/dist/ai/McpClient.d.ts +68 -4
- package/dist/ai/McpClient.d.ts.map +1 -1
- package/dist/ai/McpClient.js +100 -17
- package/dist/ai/McpClient.js.map +1 -1
- package/dist/ai/McpClientError.d.ts +46 -4
- package/dist/ai/McpClientError.d.ts.map +1 -1
- package/dist/ai/McpClientError.js +38 -3
- package/dist/ai/McpClientError.js.map +1 -1
- package/dist/ai/McpServer.d.ts +158 -7
- package/dist/ai/McpServer.d.ts.map +1 -1
- package/dist/ai/McpServer.js +103 -49
- package/dist/ai/McpServer.js.map +1 -1
- package/dist/ai/Prompt.d.ts +3 -1
- package/dist/ai/Prompt.d.ts.map +1 -1
- package/dist/ai/Prompt.js +17 -3
- package/dist/ai/Prompt.js.map +1 -1
- package/dist/ai/Skill.d.ts +172 -0
- package/dist/ai/Skill.d.ts.map +1 -0
- package/dist/ai/Skill.js +209 -0
- package/dist/ai/Skill.js.map +1 -0
- 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/mcpProtocol/v2024_11_05.js +9 -7
- package/dist/ai/internal/mcpProtocol/v2024_11_05.js.map +1 -1
- package/dist/ai/internal/mcpProtocol/v2025_03_26.js +12 -11
- package/dist/ai/internal/mcpProtocol/v2025_03_26.js.map +1 -1
- package/dist/ai/internal/mcpProtocol/v2025_06_18.js +18 -17
- package/dist/ai/internal/mcpProtocol/v2025_06_18.js.map +1 -1
- package/dist/ai/internal/mcpProtocol/v2025_11_25.js +19 -18
- package/dist/ai/internal/mcpProtocol/v2025_11_25.js.map +1 -1
- package/dist/ai/internal/mcpProtocol/v2026_07_28.js +1 -1
- package/dist/ai/internal/mcpProtocol/v2026_07_28.js.map +1 -1
- package/dist/ai/internal/mcpProtocol.js +11 -0
- package/dist/ai/internal/mcpProtocol.js.map +1 -1
- package/dist/ai/internal/mcpRuntime.js +29 -17
- package/dist/ai/internal/mcpRuntime.js.map +1 -1
- package/dist/ai/internal/mcpSchema/v2024_11_05.js +2 -1
- package/dist/ai/internal/mcpSchema/v2024_11_05.js.map +1 -1
- package/dist/ai/internal/mcpSchema/v2025_03_26.js +1 -8
- package/dist/ai/internal/mcpSchema/v2025_03_26.js.map +1 -1
- package/dist/ai/internal/mcpSchema/v2025_06_18.js +5 -9
- package/dist/ai/internal/mcpSchema/v2025_06_18.js.map +1 -1
- package/dist/ai/internal/mcpSchema/v2025_11_25.js +1 -8
- package/dist/ai/internal/mcpSchema/v2025_11_25.js.map +1 -1
- package/dist/ai/internal/mcpSchema/v2026_07_28.js +4 -3
- package/dist/ai/internal/mcpSchema/v2026_07_28.js.map +1 -1
- package/dist/cluster/ClusterCron.d.ts +5 -20
- package/dist/cluster/ClusterCron.d.ts.map +1 -1
- package/dist/cluster/ClusterCron.js +16 -4
- package/dist/cluster/ClusterCron.js.map +1 -1
- package/dist/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/cluster/ClusterWorkflowEngine.js +155 -83
- package/dist/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/cluster/MessageStorage.d.ts +56 -0
- package/dist/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/cluster/MessageStorage.js +18 -2
- package/dist/cluster/MessageStorage.js.map +1 -1
- package/dist/cluster/SqlMessageStorage.d.ts.map +1 -1
- package/dist/cluster/SqlMessageStorage.js +48 -23
- package/dist/cluster/SqlMessageStorage.js.map +1 -1
- package/dist/cluster/internal/entityActivation.js +2 -0
- package/dist/cluster/internal/entityActivation.js.map +1 -1
- package/dist/cluster/internal/entityManager.js +8 -5
- package/dist/cluster/internal/entityManager.js.map +1 -1
- package/dist/encoding/Base64.js +5 -1
- package/dist/encoding/Base64.js.map +1 -1
- package/dist/encoding/Base64Url.d.ts.map +1 -1
- package/dist/encoding/Base64Url.js +6 -1
- package/dist/encoding/Base64Url.js.map +1 -1
- package/dist/encoding/Hex.js +7 -5
- package/dist/encoding/Hex.js.map +1 -1
- package/dist/encoding/Xml.d.ts +38 -9
- package/dist/encoding/Xml.d.ts.map +1 -1
- package/dist/encoding/Xml.js +63 -31
- package/dist/encoding/Xml.js.map +1 -1
- package/dist/http/FetchHttpClient.d.ts +2 -1
- package/dist/http/FetchHttpClient.d.ts.map +1 -1
- package/dist/http/FetchHttpClient.js +14 -10
- package/dist/http/FetchHttpClient.js.map +1 -1
- package/dist/http/Headers.d.ts +201 -3
- package/dist/http/Headers.d.ts.map +1 -1
- package/dist/http/Headers.js +205 -3
- package/dist/http/Headers.js.map +1 -1
- package/dist/http/HttpClient.d.ts.map +1 -1
- package/dist/http/HttpClient.js +11 -7
- package/dist/http/HttpClient.js.map +1 -1
- package/dist/http/HttpClientError.d.ts +1 -0
- package/dist/http/HttpClientError.d.ts.map +1 -1
- package/dist/http/HttpClientError.js +32 -9
- package/dist/http/HttpClientError.js.map +1 -1
- package/dist/http/HttpClientRequest.d.ts +46 -0
- package/dist/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/http/HttpClientRequest.js +15 -0
- package/dist/http/HttpClientRequest.js.map +1 -1
- package/dist/http/HttpClientResponse.d.ts +132 -0
- package/dist/http/HttpClientResponse.d.ts.map +1 -1
- package/dist/http/HttpClientResponse.js +83 -0
- package/dist/http/HttpClientResponse.js.map +1 -1
- package/dist/http/HttpEffect.d.ts.map +1 -1
- package/dist/http/HttpEffect.js +31 -2
- package/dist/http/HttpEffect.js.map +1 -1
- package/dist/http/HttpMiddleware.js +1 -1
- package/dist/http/HttpMiddleware.js.map +1 -1
- package/dist/http/HttpServerError.d.ts +1 -1
- package/dist/http/HttpServerError.js +1 -1
- package/dist/http/HttpServerResponse.d.ts +118 -0
- package/dist/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/http/HttpServerResponse.js +43 -0
- package/dist/http/HttpServerResponse.js.map +1 -1
- package/dist/http/Multipart.d.ts.map +1 -1
- package/dist/http/Multipart.js +0 -5
- package/dist/http/Multipart.js.map +1 -1
- package/dist/http/MultipartParser/internal/contentType.d.ts +6 -0
- package/dist/http/MultipartParser/internal/contentType.d.ts.map +1 -1
- package/dist/http/MultipartParser/internal/contentType.js +1 -1
- package/dist/http/MultipartParser/internal/contentType.js.map +1 -1
- package/dist/http/internal/clientPath.d.ts +2 -0
- package/dist/http/internal/clientPath.d.ts.map +1 -0
- package/dist/http/internal/clientPath.js +24 -0
- package/dist/http/internal/clientPath.js.map +1 -0
- package/dist/http/internal/redactedPath.js +2 -0
- package/dist/http/internal/redactedPath.js.map +1 -1
- package/dist/http/internal/tracing.js +5 -3
- package/dist/http/internal/tracing.js.map +1 -1
- package/dist/http-api/HttpApi.d.ts +2 -2
- package/dist/http-api/HttpApi.d.ts.map +1 -1
- package/dist/http-api/HttpApi.js +30 -7
- package/dist/http-api/HttpApi.js.map +1 -1
- package/dist/http-api/HttpApiBuilder.d.ts.map +1 -1
- package/dist/http-api/HttpApiBuilder.js +5 -2
- package/dist/http-api/HttpApiBuilder.js.map +1 -1
- package/dist/http-api/HttpApiClient.d.ts.map +1 -1
- package/dist/http-api/HttpApiClient.js +23 -6
- package/dist/http-api/HttpApiClient.js.map +1 -1
- package/dist/http-api/internal/redactedKeys.d.ts +2 -0
- package/dist/http-api/internal/redactedKeys.d.ts.map +1 -0
- package/dist/http-api/internal/redactedKeys.js +37 -0
- package/dist/http-api/internal/redactedKeys.js.map +1 -0
- package/dist/internal/base64.js +34 -2
- package/dist/internal/base64.js.map +1 -1
- package/dist/internal/core.js +60 -43
- package/dist/internal/core.js.map +1 -1
- package/dist/internal/dateTime.js +35 -17
- package/dist/internal/dateTime.js.map +1 -1
- package/dist/internal/effect.js +60 -52
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/equal.js +44 -13
- package/dist/internal/equal.js.map +1 -1
- package/dist/internal/fiberCachedKeys.d.ts +2 -0
- package/dist/internal/fiberCachedKeys.d.ts.map +1 -0
- package/dist/internal/fiberCachedKeys.js +48 -0
- package/dist/internal/fiberCachedKeys.js.map +1 -0
- package/dist/internal/hashMap.js +1 -1
- package/dist/internal/hashMap.js.map +1 -1
- package/dist/internal/matcher.js +17 -17
- package/dist/internal/matcher.js.map +1 -1
- package/dist/internal/predicate.d.ts +2 -0
- package/dist/internal/predicate.d.ts.map +1 -0
- package/dist/internal/predicate.js +10 -0
- package/dist/internal/predicate.js.map +1 -0
- package/dist/internal/references.js +8 -11
- package/dist/internal/references.js.map +1 -1
- package/dist/internal/schema/schemaCodegen.js +3 -2
- package/dist/internal/schema/schemaCodegen.js.map +1 -1
- package/dist/internal/schema/schemaCodegenBuiltIns.d.ts +2 -0
- package/dist/internal/schema/schemaCodegenBuiltIns.d.ts.map +1 -0
- package/dist/internal/schema/schemaCodegenBuiltIns.js +425 -0
- package/dist/internal/schema/schemaCodegenBuiltIns.js.map +1 -0
- package/dist/internal/schema/toEquivalence.js +3 -4
- package/dist/internal/schema/toEquivalence.js.map +1 -1
- package/dist/internal/version.js +1 -1
- package/dist/jose/JoseError.d.ts +51 -1
- package/dist/jose/JoseError.d.ts.map +1 -1
- package/dist/jose/JoseError.js +25 -18
- package/dist/jose/JoseError.js.map +1 -1
- package/dist/jose/internal/compact.js +10 -5
- package/dist/jose/internal/compact.js.map +1 -1
- package/dist/observability/Otlp.d.ts +19 -0
- 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/OtlpExporter.d.ts +49 -13
- package/dist/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/observability/OtlpExporter.js +135 -54
- package/dist/observability/OtlpExporter.js.map +1 -1
- package/dist/observability/OtlpLogger.d.ts +14 -0
- package/dist/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/observability/OtlpLogger.js +10 -2
- package/dist/observability/OtlpLogger.js.map +1 -1
- package/dist/observability/OtlpMetrics.d.ts.map +1 -1
- package/dist/observability/OtlpMetrics.js +2 -0
- package/dist/observability/OtlpMetrics.js.map +1 -1
- package/dist/observability/OtlpTracer.d.ts +14 -0
- package/dist/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/observability/OtlpTracer.js +10 -2
- package/dist/observability/OtlpTracer.js.map +1 -1
- package/dist/persistence/KeyValueStore.d.ts.map +1 -1
- package/dist/persistence/KeyValueStore.js +6 -4
- package/dist/persistence/KeyValueStore.js.map +1 -1
- package/dist/reactivity/Atom.d.ts.map +1 -1
- package/dist/reactivity/Atom.js +10 -9
- package/dist/reactivity/Atom.js.map +1 -1
- package/dist/rpc/RpcClient.d.ts.map +1 -1
- package/dist/rpc/RpcClient.js +32 -1
- package/dist/rpc/RpcClient.js.map +1 -1
- package/dist/rpc/RpcGroup.d.ts +1 -1
- package/dist/rpc/RpcGroup.d.ts.map +1 -1
- package/dist/rpc/RpcGroup.js +4 -0
- package/dist/rpc/RpcGroup.js.map +1 -1
- package/dist/sql/Migrator.d.ts.map +1 -1
- package/dist/sql/Migrator.js +2 -5
- package/dist/sql/Migrator.js.map +1 -1
- package/dist/sql/SqlClient.d.ts.map +1 -1
- package/dist/sql/SqlClient.js +5 -1
- package/dist/sql/SqlClient.js.map +1 -1
- package/dist/sql/Statement.d.ts +23 -0
- package/dist/sql/Statement.d.ts.map +1 -1
- package/dist/sql/Statement.js +30 -5
- package/dist/sql/Statement.js.map +1 -1
- package/dist/workers/Worker.d.ts +21 -0
- package/dist/workers/Worker.d.ts.map +1 -1
- package/dist/workers/Worker.js +23 -0
- package/dist/workers/Worker.js.map +1 -1
- package/dist/workflow/Activity.d.ts +18 -0
- package/dist/workflow/Activity.d.ts.map +1 -1
- package/dist/workflow/Activity.js +13 -4
- package/dist/workflow/Activity.js.map +1 -1
- package/dist/workflow/Workflow.d.ts +10 -9
- package/dist/workflow/Workflow.d.ts.map +1 -1
- package/dist/workflow/Workflow.js +33 -22
- package/dist/workflow/Workflow.js.map +1 -1
- package/dist/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/workflow/WorkflowEngine.js +26 -12
- package/dist/workflow/WorkflowEngine.js.map +1 -1
- package/dist/workflow/internal/retry.d.ts +2 -0
- package/dist/workflow/internal/retry.d.ts.map +1 -0
- package/dist/workflow/internal/retry.js +11 -0
- package/dist/workflow/internal/retry.js.map +1 -0
- package/dist/workflow/internal/scope.d.ts +2 -0
- package/dist/workflow/internal/scope.d.ts.map +1 -0
- package/dist/workflow/internal/scope.js +26 -0
- package/dist/workflow/internal/scope.js.map +1 -0
- package/package.json +3 -3
- package/src/Channel.ts +105 -8
- package/src/Codegen.ts +7 -2
- package/src/Config.ts +6 -3
- package/src/Context.ts +108 -50
- package/src/Cron.ts +11 -10
- package/src/Effect.ts +224 -48
- package/src/Equal.ts +93 -80
- package/src/Formatter.ts +4 -4
- package/src/Hash.ts +49 -48
- package/src/LayerRef.ts +6 -4
- package/src/Logger.ts +68 -25
- package/src/Match.ts +78 -50
- package/src/Metric.ts +4 -4
- package/src/Order.ts +1 -1
- package/src/Pool.ts +62 -33
- package/src/Predicate.ts +2 -5
- package/src/Scheduler.ts +27 -10
- package/src/Schema.ts +79 -296
- package/src/SchemaAST.ts +231 -157
- package/src/SchemaParser.ts +40 -57
- package/src/ScopedCache.ts +6 -4
- package/src/Stream.ts +167 -33
- package/src/String.ts +1 -1
- package/src/Tracer.ts +11 -2
- package/src/ai/McpClient.ts +157 -15
- package/src/ai/McpClientError.ts +55 -4
- package/src/ai/McpServer.ts +318 -91
- package/src/ai/Prompt.ts +20 -3
- package/src/ai/Skill.ts +236 -0
- package/src/ai/index.ts +6 -0
- package/src/ai/internal/mcpProtocol/v2024_11_05.ts +8 -13
- package/src/ai/internal/mcpProtocol/v2025_03_26.ts +13 -15
- package/src/ai/internal/mcpProtocol/v2025_06_18.ts +21 -23
- package/src/ai/internal/mcpProtocol/v2025_11_25.ts +22 -24
- package/src/ai/internal/mcpProtocol/v2026_07_28.ts +1 -1
- package/src/ai/internal/mcpProtocol.ts +15 -0
- package/src/ai/internal/mcpRuntime.ts +36 -13
- package/src/ai/internal/mcpSchema/v2024_11_05.ts +2 -1
- package/src/ai/internal/mcpSchema/v2025_03_26.ts +1 -9
- package/src/ai/internal/mcpSchema/v2025_06_18.ts +3 -10
- package/src/ai/internal/mcpSchema/v2025_11_25.ts +1 -9
- package/src/ai/internal/mcpSchema/v2026_07_28.ts +6 -8
- package/src/cluster/ClusterCron.ts +31 -20
- package/src/cluster/ClusterWorkflowEngine.ts +172 -96
- package/src/cluster/MessageStorage.ts +51 -2
- package/src/cluster/SqlMessageStorage.ts +88 -36
- package/src/cluster/internal/entityActivation.ts +6 -0
- package/src/cluster/internal/entityManager.ts +8 -4
- package/src/encoding/Base64.ts +5 -1
- package/src/encoding/Base64Url.ts +6 -1
- package/src/encoding/Hex.ts +5 -5
- package/src/encoding/Xml.ts +96 -26
- package/src/http/FetchHttpClient.ts +8 -5
- package/src/http/Headers.ts +309 -3
- package/src/http/HttpClient.ts +19 -7
- package/src/http/HttpClientError.ts +42 -9
- package/src/http/HttpClientRequest.ts +51 -0
- package/src/http/HttpClientResponse.ts +156 -0
- package/src/http/HttpEffect.ts +23 -3
- package/src/http/HttpMiddleware.ts +1 -1
- package/src/http/HttpServerError.ts +1 -1
- package/src/http/HttpServerResponse.ts +126 -0
- package/src/http/Multipart.ts +0 -5
- package/src/http/MultipartParser/internal/contentType.ts +1 -1
- package/src/http/internal/clientPath.ts +39 -0
- package/src/http/internal/redactedPath.ts +4 -0
- package/src/http/internal/tracing.ts +6 -3
- package/src/http-api/HttpApi.ts +29 -8
- package/src/http-api/HttpApiBuilder.ts +7 -2
- package/src/http-api/HttpApiClient.ts +30 -7
- package/src/http-api/internal/redactedKeys.ts +40 -0
- package/src/internal/base64.ts +57 -2
- package/src/internal/core.ts +80 -44
- package/src/internal/dateTime.ts +43 -24
- package/src/internal/effect.ts +115 -157
- package/src/internal/equal.ts +73 -17
- package/src/internal/fiberCachedKeys.ts +81 -0
- package/src/internal/hashMap.ts +1 -1
- package/src/internal/matcher.ts +34 -113
- package/src/internal/predicate.ts +10 -0
- package/src/internal/references.ts +21 -14
- package/src/internal/schema/schemaCodegen.ts +5 -4
- package/src/internal/schema/schemaCodegenBuiltIns.ts +343 -0
- package/src/internal/schema/toEquivalence.ts +3 -5
- package/src/internal/version.ts +1 -1
- package/src/jose/JoseError.ts +34 -0
- package/src/jose/internal/compact.ts +14 -5
- package/src/observability/Otlp.ts +29 -0
- package/src/observability/OtlpExporter.ts +206 -75
- package/src/observability/OtlpLogger.ts +24 -2
- package/src/observability/OtlpMetrics.ts +2 -0
- package/src/observability/OtlpTracer.ts +24 -3
- package/src/persistence/KeyValueStore.ts +17 -14
- package/src/reactivity/Atom.ts +12 -18
- package/src/rpc/RpcClient.ts +26 -1
- package/src/rpc/RpcGroup.ts +4 -1
- package/src/sql/Migrator.ts +2 -11
- package/src/sql/SqlClient.ts +14 -8
- package/src/sql/Statement.ts +48 -12
- package/src/workers/Worker.ts +25 -0
- package/src/workflow/Activity.ts +28 -4
- package/src/workflow/Workflow.ts +68 -44
- package/src/workflow/WorkflowEngine.ts +38 -15
- package/src/workflow/internal/retry.ts +12 -0
- package/src/workflow/internal/scope.ts +36 -0
- package/dist/internal/hash.d.ts +0 -2
- package/dist/internal/hash.d.ts.map +0 -1
- package/dist/internal/hash.js +0 -11
- package/dist/internal/hash.js.map +0 -1
- package/dist/internal/metric.d.ts +0 -2
- package/dist/internal/metric.d.ts.map +0 -1
- package/dist/internal/metric.js +0 -3
- package/dist/internal/metric.js.map +0 -1
- package/src/internal/hash.ts +0 -11
- package/src/internal/metric.ts +0 -2
package/src/ai/McpClient.ts
CHANGED
|
@@ -39,6 +39,7 @@ import {
|
|
|
39
39
|
ClosedError,
|
|
40
40
|
ConfigurationError,
|
|
41
41
|
HttpError,
|
|
42
|
+
InputRequiredError,
|
|
42
43
|
isMcpClientError,
|
|
43
44
|
LimitError,
|
|
44
45
|
McpClientError,
|
|
@@ -67,7 +68,27 @@ import * as Toolkit from "./Toolkit.ts"
|
|
|
67
68
|
* @category models
|
|
68
69
|
* @since 4.0.6
|
|
69
70
|
*/
|
|
70
|
-
export type ProtocolVersion = "2025-11-25" | "2026-07-28"
|
|
71
|
+
export type ProtocolVersion = "2025-03-26" | "2025-06-18" | "2025-11-25" | "2026-07-28"
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Client input capabilities declared on `2026-07-28` connections for tool call
|
|
75
|
+
* continuations: elicitation, sampling or roots.
|
|
76
|
+
*
|
|
77
|
+
* @stability experimental
|
|
78
|
+
* @category models
|
|
79
|
+
* @since 4.1.7
|
|
80
|
+
*/
|
|
81
|
+
export interface InputCapabilities {
|
|
82
|
+
readonly roots?: Readonly<Record<string, unknown>> | undefined
|
|
83
|
+
readonly sampling?: {
|
|
84
|
+
readonly context?: Readonly<Record<string, unknown>> | undefined
|
|
85
|
+
readonly tools?: Readonly<Record<string, unknown>> | undefined
|
|
86
|
+
} | undefined
|
|
87
|
+
readonly elicitation?: {
|
|
88
|
+
readonly form?: Readonly<Record<string, unknown>> | undefined
|
|
89
|
+
readonly url?: Readonly<Record<string, unknown>> | undefined
|
|
90
|
+
} | undefined
|
|
91
|
+
}
|
|
71
92
|
|
|
72
93
|
/**
|
|
73
94
|
* Service tag for applications that provide one default MCP connection.
|
|
@@ -78,6 +99,18 @@ export type ProtocolVersion = "2025-11-25" | "2026-07-28"
|
|
|
78
99
|
*/
|
|
79
100
|
export const McpClient: Context.Service<McpClient, McpClient> = Context.Service<McpClient>("effect/ai/McpClient")
|
|
80
101
|
|
|
102
|
+
/**
|
|
103
|
+
* Cache hint returned by a `2026-07-28` MCP list response.
|
|
104
|
+
*
|
|
105
|
+
* @stability experimental
|
|
106
|
+
* @category models
|
|
107
|
+
* @since 4.1.7
|
|
108
|
+
*/
|
|
109
|
+
export interface ListCacheHint {
|
|
110
|
+
readonly ttlMs: number
|
|
111
|
+
readonly cacheScope: "public" | "private"
|
|
112
|
+
}
|
|
113
|
+
|
|
81
114
|
/**
|
|
82
115
|
* A scoped connection to one MCP server.
|
|
83
116
|
*
|
|
@@ -106,6 +139,24 @@ export interface McpClient {
|
|
|
106
139
|
} | undefined
|
|
107
140
|
}
|
|
108
141
|
) => Effect.Effect<ReadonlyArray<McpSchema.Tool>, McpClientError>
|
|
142
|
+
/**
|
|
143
|
+
* Returns every tool page with the same bounds as `listTools` plus the aggregated
|
|
144
|
+
* `2026-07-28` `cacheHint` (minimum `ttlMs`; `"public"` only if every page is `"public"`).
|
|
145
|
+
* `cacheHint` is `undefined` on protocols before `2026-07-28` or when the server does not
|
|
146
|
+
* advertise the `tools` capability.
|
|
147
|
+
*/
|
|
148
|
+
readonly listToolsWithCacheHint: (
|
|
149
|
+
options?: {
|
|
150
|
+
readonly timeout?: Duration.Input | undefined
|
|
151
|
+
readonly limits?: {
|
|
152
|
+
readonly maxPages?: number | undefined
|
|
153
|
+
readonly maxItems?: number | undefined
|
|
154
|
+
} | undefined
|
|
155
|
+
}
|
|
156
|
+
) => Effect.Effect<
|
|
157
|
+
{ readonly tools: ReadonlyArray<McpSchema.Tool>; readonly cacheHint: ListCacheHint | undefined },
|
|
158
|
+
McpClientError
|
|
159
|
+
>
|
|
109
160
|
/** Returns every prompt page as one snapshot with the same bounds as `listTools`. */
|
|
110
161
|
readonly listPrompts: (
|
|
111
162
|
options?: {
|
|
@@ -192,8 +243,15 @@ export interface McpClient {
|
|
|
192
243
|
options?: { readonly timeout?: Duration.Input | undefined }
|
|
193
244
|
) => Effect.Effect<McpSchema.ReadResourceResult, McpClientError>
|
|
194
245
|
/**
|
|
195
|
-
* Calls a discovered tool, optionally decoding with a schema. Errors retain
|
|
246
|
+
* Calls a discovered tool, optionally decoding `structuredContent` with a schema. Errors retain
|
|
247
|
+
* the full result. `2025-03-26` has no structured results, so `schema` decodes `undefined`.
|
|
196
248
|
* Unbounded unless `timeout` is supplied.
|
|
249
|
+
*
|
|
250
|
+
* **Details**
|
|
251
|
+
*
|
|
252
|
+
* On `2026-07-28`, a paused call fails with `InputRequiredError` whose `result` carries
|
|
253
|
+
* `inputRequests` and `requestState`. Retry with `inputResponses` and the unchanged
|
|
254
|
+
* `requestState` to continue.
|
|
197
255
|
*/
|
|
198
256
|
readonly callTool: {
|
|
199
257
|
(
|
|
@@ -201,6 +259,8 @@ export interface McpClient {
|
|
|
201
259
|
readonly tool: McpSchema.Tool
|
|
202
260
|
readonly schema?: undefined
|
|
203
261
|
readonly arguments?: typeof McpSchema.CallTool.payloadSchema.Type["arguments"]
|
|
262
|
+
readonly inputResponses?: Readonly<Record<string, McpSchema.McpInputResponse>> | undefined
|
|
263
|
+
readonly requestState?: string | undefined
|
|
204
264
|
},
|
|
205
265
|
options?: { readonly timeout?: Duration.Input | undefined }
|
|
206
266
|
): Effect.Effect<McpSchema.CallToolResult, McpClientError>
|
|
@@ -209,6 +269,8 @@ export interface McpClient {
|
|
|
209
269
|
readonly tool: McpSchema.Tool
|
|
210
270
|
readonly schema: S
|
|
211
271
|
readonly arguments?: typeof McpSchema.CallTool.payloadSchema.Type["arguments"]
|
|
272
|
+
readonly inputResponses?: Readonly<Record<string, McpSchema.McpInputResponse>> | undefined
|
|
273
|
+
readonly requestState?: string | undefined
|
|
212
274
|
},
|
|
213
275
|
options?: { readonly timeout?: Duration.Input | undefined }
|
|
214
276
|
): Effect.Effect<S["Type"], McpClientError, S["DecodingServices"]>
|
|
@@ -217,6 +279,8 @@ export interface McpClient {
|
|
|
217
279
|
readonly tool: McpSchema.Tool
|
|
218
280
|
readonly schema?: S | undefined
|
|
219
281
|
readonly arguments?: typeof McpSchema.CallTool.payloadSchema.Type["arguments"]
|
|
282
|
+
readonly inputResponses?: Readonly<Record<string, McpSchema.McpInputResponse>> | undefined
|
|
283
|
+
readonly requestState?: string | undefined
|
|
220
284
|
},
|
|
221
285
|
options?: { readonly timeout?: Duration.Input | undefined }
|
|
222
286
|
): Effect.Effect<McpSchema.CallToolResult | S["Type"], McpClientError, S["DecodingServices"]>
|
|
@@ -243,8 +307,8 @@ export const isMcpClient = (value: unknown): value is McpClient => Predicate.has
|
|
|
243
307
|
*
|
|
244
308
|
* `name`, `version` and the optional `title`, `description`, `websiteUrl` and
|
|
245
309
|
* `icons` identify the client to the server. `timeout` defaults to 60 seconds
|
|
246
|
-
* and bounds initialization and each complete `listTools`, `
|
|
247
|
-
* `listResources`, `listSkills` or `readResourceDirectory` scan.
|
|
310
|
+
* and bounds initialization and each complete `listTools`, `listToolsWithCacheHint`,
|
|
311
|
+
* `listPrompts`, `listResources`, `listSkills` or `readResourceDirectory` scan.
|
|
248
312
|
* `discoveryLimits` sets the default scan limits of 100 pages and 10,000
|
|
249
313
|
* items. `callTool`, `getPrompt`, `readResource`, `getSkill` and
|
|
250
314
|
* `readSkillResource` have no deadline unless their own `timeout` option is
|
|
@@ -257,6 +321,8 @@ export const isMcpClient = (value: unknown): value is McpClient => Predicate.has
|
|
|
257
321
|
* server that declares the extension too, and skill entries are checked
|
|
258
322
|
* against its rules. `readSkillResource` checks digests with SHA-256 on
|
|
259
323
|
* `crypto.subtle`.
|
|
324
|
+
* `capabilities` declares elicitation, sampling or roots support for `2026-07-28`
|
|
325
|
+
* tool call continuations; earlier revisions reject them with `ConfigurationError`.
|
|
260
326
|
* Schema decoding requires the schema's services from the caller.
|
|
261
327
|
*
|
|
262
328
|
* @stability experimental
|
|
@@ -278,6 +344,7 @@ export const make: (options: {
|
|
|
278
344
|
readonly extensions?: {
|
|
279
345
|
readonly skills?: boolean | undefined
|
|
280
346
|
} | undefined
|
|
347
|
+
readonly capabilities?: InputCapabilities | undefined
|
|
281
348
|
}) => Effect.Effect<
|
|
282
349
|
McpClient,
|
|
283
350
|
McpClientError,
|
|
@@ -311,7 +378,17 @@ export const make: (options: {
|
|
|
311
378
|
// Modern requests carry the client identity in every request.
|
|
312
379
|
// https://modelcontextprotocol.io/specification/2026-07-28/basic/index
|
|
313
380
|
const skillsEnabled = options.extensions?.skills === true
|
|
314
|
-
const
|
|
381
|
+
const inputCapabilities = normalizeInputCapabilities(options.capabilities)
|
|
382
|
+
// Earlier revisions request input via server-to-client RPCs, which this client does not handle.
|
|
383
|
+
if (!modern && Object.keys(inputCapabilities).length > 0) {
|
|
384
|
+
return yield* fail(
|
|
385
|
+
new ConfigurationError({ description: "MCP client input capabilities require protocol 2026-07-28" })
|
|
386
|
+
)
|
|
387
|
+
}
|
|
388
|
+
const clientCapabilities = {
|
|
389
|
+
...inputCapabilities,
|
|
390
|
+
...(skillsEnabled ? { extensions: { [McpSkills.EXTENSION_ID]: {} } } : {})
|
|
391
|
+
}
|
|
315
392
|
const meta = {
|
|
316
393
|
"io.modelcontextprotocol/protocolVersion": version,
|
|
317
394
|
"io.modelcontextprotocol/clientInfo": clientInfo,
|
|
@@ -321,7 +398,8 @@ export const make: (options: {
|
|
|
321
398
|
const request = Effect.fnUntraced(function*<A>(
|
|
322
399
|
method: string,
|
|
323
400
|
params: Record<string, unknown>,
|
|
324
|
-
tool?: McpSchema.Tool
|
|
401
|
+
tool?: McpSchema.Tool,
|
|
402
|
+
onValidated?: (validated: unknown) => void
|
|
325
403
|
): Effect.fn.Return<A, McpClientError> {
|
|
326
404
|
const rpc = protocol.clientRpcs.requests.get(method) as Rpc.AnyWithProps | undefined
|
|
327
405
|
if (rpc === undefined) {
|
|
@@ -356,11 +434,17 @@ export const make: (options: {
|
|
|
356
434
|
}
|
|
357
435
|
|
|
358
436
|
const validated = yield* decodeUnknown(rpc.successSchema, result)
|
|
359
|
-
if (isRecord(
|
|
360
|
-
|
|
437
|
+
if (isRecord(validated) && validated.resultType === "input_required") {
|
|
438
|
+
if (method !== "tools/call") {
|
|
439
|
+
return yield* fail(new UnsupportedError({ description: "MCP input continuation is not supported" }))
|
|
440
|
+
}
|
|
441
|
+
// The wire schema guarantees `inputRequests` or `requestState`; the error schema drops the other fields.
|
|
442
|
+
return yield* fail(new InputRequiredError({ result: validated as InputRequiredError["result"] }))
|
|
361
443
|
}
|
|
362
444
|
const publicRpc = publicRpcs.get(method)
|
|
363
|
-
|
|
445
|
+
const decoded = (publicRpc === undefined ? validated : yield* decodeUnknown(publicRpc.successSchema, result)) as A
|
|
446
|
+
onValidated?.(validated)
|
|
447
|
+
return decoded
|
|
364
448
|
})
|
|
365
449
|
|
|
366
450
|
// Initialization and discovery default to `timeout`; other operations are bounded only on request.
|
|
@@ -437,13 +521,19 @@ export const make: (options: {
|
|
|
437
521
|
method: string,
|
|
438
522
|
key: K,
|
|
439
523
|
params: Record<string, unknown>,
|
|
440
|
-
limits: typeof DEFAULT_DISCOVERY_LIMITS
|
|
524
|
+
limits: typeof DEFAULT_DISCOVERY_LIMITS,
|
|
525
|
+
onPage?: (validated: unknown) => void
|
|
441
526
|
) {
|
|
442
527
|
const items: Array<A> = []
|
|
443
528
|
const cursors = new Set<string>()
|
|
444
529
|
let cursor: string | undefined
|
|
445
530
|
for (let page = 0; page < limits.maxPages; page++) {
|
|
446
|
-
const result = yield* request<ListResult<K, A>>(
|
|
531
|
+
const result = yield* request<ListResult<K, A>>(
|
|
532
|
+
method,
|
|
533
|
+
cursor === undefined ? params : { ...params, cursor },
|
|
534
|
+
undefined,
|
|
535
|
+
onPage
|
|
536
|
+
)
|
|
447
537
|
if (items.length + result[key].length > limits.maxItems) {
|
|
448
538
|
return yield* limitError(`MCP ${label} discovery exceeded its item limit`)
|
|
449
539
|
}
|
|
@@ -586,7 +676,26 @@ export const make: (options: {
|
|
|
586
676
|
(effect, _params, callOptions) => withDeadline(effect, "resources/read", callOptions?.timeout)
|
|
587
677
|
)
|
|
588
678
|
|
|
589
|
-
const
|
|
679
|
+
const listToolsWithCacheHint = Effect.fnUntraced(
|
|
680
|
+
function*(callOptions?: DiscoveryOptions) {
|
|
681
|
+
const limits = yield* resolveDiscoveryLimits(callOptions?.limits, discoveryLimits)
|
|
682
|
+
if (capabilities.tools === undefined) return { tools: [], cacheHint: undefined }
|
|
683
|
+
let cacheHint: ListCacheHint | undefined
|
|
684
|
+
// The `2026-07-28` decoder already requires `ttlMs` and `cacheScope` on every page.
|
|
685
|
+
const onPage = modern
|
|
686
|
+
? (page: unknown) => {
|
|
687
|
+
const { cacheScope, ttlMs } = page as ListCacheHint
|
|
688
|
+
cacheHint = {
|
|
689
|
+
ttlMs: Math.min(cacheHint?.ttlMs ?? ttlMs, ttlMs),
|
|
690
|
+
cacheScope: cacheHint?.cacheScope === "private" ? "private" : cacheScope
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
: undefined
|
|
694
|
+
const tools = yield* paginate<"tools", McpSchema.Tool>("tools", "tools/list", "tools", {}, limits, onPage)
|
|
695
|
+
return { tools: tools.filter((tool) => transport.isCallable(tool)), cacheHint }
|
|
696
|
+
},
|
|
697
|
+
(effect, callOptions) => withDeadline(effect, "tools discovery", callOptions?.timeout ?? timeout)
|
|
698
|
+
)
|
|
590
699
|
|
|
591
700
|
const callTool = Effect.fnUntraced(
|
|
592
701
|
function*<S extends Schema.Top>(
|
|
@@ -594,13 +703,25 @@ export const make: (options: {
|
|
|
594
703
|
readonly tool: McpSchema.Tool
|
|
595
704
|
readonly schema?: S | undefined
|
|
596
705
|
readonly arguments?: typeof McpSchema.CallTool.payloadSchema.Type["arguments"]
|
|
706
|
+
readonly inputResponses?: Readonly<Record<string, McpSchema.McpInputResponse>> | undefined
|
|
707
|
+
readonly requestState?: string | undefined
|
|
597
708
|
},
|
|
598
709
|
_options?: CallOptions
|
|
599
710
|
) {
|
|
711
|
+
if (!modern && (params.inputResponses !== undefined || params.requestState !== undefined)) {
|
|
712
|
+
return yield* fail(
|
|
713
|
+
new ConfigurationError({ description: "MCP input continuation requires protocol 2026-07-28" })
|
|
714
|
+
)
|
|
715
|
+
}
|
|
600
716
|
const result = yield* call<McpSchema.CallToolResult>(
|
|
601
717
|
"tools",
|
|
602
718
|
"tools/call",
|
|
603
|
-
{
|
|
719
|
+
{
|
|
720
|
+
name: params.tool.name,
|
|
721
|
+
...(params.arguments === undefined ? {} : { arguments: params.arguments }),
|
|
722
|
+
...(params.inputResponses === undefined ? {} : { inputResponses: params.inputResponses }),
|
|
723
|
+
...(params.requestState === undefined ? {} : { requestState: params.requestState })
|
|
724
|
+
},
|
|
604
725
|
params.tool
|
|
605
726
|
)
|
|
606
727
|
if (params.schema === undefined) return result
|
|
@@ -622,8 +743,8 @@ export const make: (options: {
|
|
|
622
743
|
capabilities,
|
|
623
744
|
serverInfo,
|
|
624
745
|
instructions,
|
|
625
|
-
listTools: (callOptions) =>
|
|
626
|
-
|
|
746
|
+
listTools: (callOptions) => listToolsWithCacheHint(callOptions).pipe(Effect.map(({ tools }) => tools)),
|
|
747
|
+
listToolsWithCacheHint,
|
|
627
748
|
listPrompts: list("prompts"),
|
|
628
749
|
listResources: list("resources"),
|
|
629
750
|
getPrompt: (params, callOptions) =>
|
|
@@ -1011,6 +1132,7 @@ export const layerStdio: (options: {
|
|
|
1011
1132
|
readonly extensions?: {
|
|
1012
1133
|
readonly skills?: boolean | undefined
|
|
1013
1134
|
} | undefined
|
|
1135
|
+
readonly capabilities?: InputCapabilities | undefined
|
|
1014
1136
|
readonly command: ChildProcess.Command
|
|
1015
1137
|
readonly protocol: McpProtocol.ProtocolAdapter<ProtocolVersion>
|
|
1016
1138
|
readonly maxMessageBytes?: ByteSize.Input | undefined
|
|
@@ -1252,6 +1374,7 @@ export const layerHttp: (options: {
|
|
|
1252
1374
|
readonly extensions?: {
|
|
1253
1375
|
readonly skills?: boolean | undefined
|
|
1254
1376
|
} | undefined
|
|
1377
|
+
readonly capabilities?: InputCapabilities | undefined
|
|
1255
1378
|
readonly url: string | URL
|
|
1256
1379
|
readonly protocol: McpProtocol.ProtocolAdapter<ProtocolVersion>
|
|
1257
1380
|
readonly headers?: Readonly<Record<string, string>> | undefined
|
|
@@ -1303,6 +1426,25 @@ type ListResult<K extends string, A> = Record<K, ReadonlyArray<A>> & { readonly
|
|
|
1303
1426
|
const fail = (reason: McpClientErrorReason) => new McpClientError({ reason })
|
|
1304
1427
|
const limitError = (description: string) => fail(new LimitError({ description }))
|
|
1305
1428
|
|
|
1429
|
+
const normalizeInputCapabilities = (capabilities: InputCapabilities | undefined): Record<string, unknown> => {
|
|
1430
|
+
if (!isRecord(capabilities)) return {}
|
|
1431
|
+
const result: Record<string, unknown> = {}
|
|
1432
|
+
if (isRecord(capabilities.roots)) result.roots = {}
|
|
1433
|
+
if (isRecord(capabilities.sampling)) {
|
|
1434
|
+
result.sampling = {
|
|
1435
|
+
...(isRecord(capabilities.sampling.context) ? { context: {} } : {}),
|
|
1436
|
+
...(isRecord(capabilities.sampling.tools) ? { tools: {} } : {})
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
if (isRecord(capabilities.elicitation)) {
|
|
1440
|
+
result.elicitation = {
|
|
1441
|
+
...(isRecord(capabilities.elicitation.form) ? { form: {} } : {}),
|
|
1442
|
+
...(isRecord(capabilities.elicitation.url) ? { url: {} } : {})
|
|
1443
|
+
}
|
|
1444
|
+
}
|
|
1445
|
+
return result
|
|
1446
|
+
}
|
|
1447
|
+
|
|
1306
1448
|
const resolveDiscoveryLimits = (
|
|
1307
1449
|
limits: DiscoveryLimits,
|
|
1308
1450
|
defaults: typeof DEFAULT_DISCOVERY_LIMITS
|
package/src/ai/McpClientError.ts
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Every failure is an `McpClientError` whose `reason` is one of the reason
|
|
5
5
|
* classes in this module: transport, protocol, HTTP, unsupported feature,
|
|
6
|
-
* closed connection, timeout, limit, configuration, validation
|
|
7
|
-
* tool-reported errors.
|
|
6
|
+
* closed connection, timeout, limit, configuration, validation,
|
|
7
|
+
* tool-reported errors or client input requests.
|
|
8
8
|
*
|
|
9
9
|
* @stability experimental
|
|
10
10
|
* @since 4.0.6
|
|
@@ -219,6 +219,54 @@ export class ToolError extends Schema.Error<ToolError>("effect/ai/McpClientError
|
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
221
|
|
|
222
|
+
const InputRequestSchema = Schema.Union([
|
|
223
|
+
Schema.Struct({
|
|
224
|
+
method: Schema.Literal("roots/list"),
|
|
225
|
+
params: Schema.optional(Schema.Record(Schema.String, Schema.Unknown))
|
|
226
|
+
}),
|
|
227
|
+
Schema.Struct({
|
|
228
|
+
method: Schema.Literal("sampling/createMessage"),
|
|
229
|
+
params: Schema.Record(Schema.String, Schema.Unknown)
|
|
230
|
+
}),
|
|
231
|
+
Schema.Struct({
|
|
232
|
+
method: Schema.Literal("elicitation/create"),
|
|
233
|
+
params: Schema.Record(Schema.String, Schema.Unknown)
|
|
234
|
+
})
|
|
235
|
+
])
|
|
236
|
+
|
|
237
|
+
const InputRequiredResult = Schema.Union([
|
|
238
|
+
Schema.Struct({
|
|
239
|
+
inputRequests: Schema.Record(Schema.String, InputRequestSchema),
|
|
240
|
+
requestState: Schema.optional(Schema.String)
|
|
241
|
+
}),
|
|
242
|
+
Schema.Struct({
|
|
243
|
+
inputRequests: Schema.optional(Schema.Record(Schema.String, InputRequestSchema)),
|
|
244
|
+
requestState: Schema.String
|
|
245
|
+
})
|
|
246
|
+
])
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* A `2026-07-28` tool call paused with `input_required`. Forward `result` to
|
|
250
|
+
* `new McpSchema.InputRequired(reason.result)`, or answer `result.inputRequests`
|
|
251
|
+
* and retry with `inputResponses` and the unchanged `result.requestState`.
|
|
252
|
+
*
|
|
253
|
+
* @stability experimental
|
|
254
|
+
* @category reasons
|
|
255
|
+
* @since 4.1.7
|
|
256
|
+
*/
|
|
257
|
+
export class InputRequiredError
|
|
258
|
+
extends Schema.Error<InputRequiredError>("effect/ai/McpClientError/InputRequiredError")({
|
|
259
|
+
_tag: Schema.tag("InputRequiredError"),
|
|
260
|
+
result: InputRequiredResult
|
|
261
|
+
})
|
|
262
|
+
{
|
|
263
|
+
readonly [ReasonTypeId] = ReasonTypeId
|
|
264
|
+
|
|
265
|
+
override get message(): string {
|
|
266
|
+
return "MCP tool call requires client input"
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
222
270
|
/**
|
|
223
271
|
* Union of MCP client and transport failure reasons.
|
|
224
272
|
*
|
|
@@ -237,6 +285,7 @@ export type McpClientErrorReason =
|
|
|
237
285
|
| ConfigurationError
|
|
238
286
|
| ValidationError
|
|
239
287
|
| ToolError
|
|
288
|
+
| InputRequiredError
|
|
240
289
|
|
|
241
290
|
/**
|
|
242
291
|
* Schema for the reasons carried by an `McpClientError`.
|
|
@@ -255,7 +304,8 @@ export const McpClientErrorReason: Schema.Union<[
|
|
|
255
304
|
typeof LimitError,
|
|
256
305
|
typeof ConfigurationError,
|
|
257
306
|
typeof ValidationError,
|
|
258
|
-
typeof ToolError
|
|
307
|
+
typeof ToolError,
|
|
308
|
+
typeof InputRequiredError
|
|
259
309
|
]> = Schema.Union([
|
|
260
310
|
TransportError,
|
|
261
311
|
ProtocolError,
|
|
@@ -266,7 +316,8 @@ export const McpClientErrorReason: Schema.Union<[
|
|
|
266
316
|
LimitError,
|
|
267
317
|
ConfigurationError,
|
|
268
318
|
ValidationError,
|
|
269
|
-
ToolError
|
|
319
|
+
ToolError,
|
|
320
|
+
InputRequiredError
|
|
270
321
|
])
|
|
271
322
|
|
|
272
323
|
/**
|