effect 4.1.2 → 4.1.3
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 +1 -1
- package/ai-docs/tsconfig.json +2 -1
- package/dist/DateTime.d.ts +33 -2
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +16 -0
- package/dist/DateTime.js.map +1 -1
- package/dist/Match.d.ts +6 -6
- package/dist/Match.d.ts.map +1 -1
- package/dist/Match.js.map +1 -1
- package/dist/Queue.d.ts +2 -1
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +16 -9
- package/dist/Queue.js.map +1 -1
- package/dist/Rational.d.ts +1214 -0
- package/dist/Rational.d.ts.map +1 -0
- package/dist/Rational.js +880 -0
- package/dist/Rational.js.map +1 -0
- package/dist/RcMap.d.ts +3 -0
- package/dist/RcMap.d.ts.map +1 -1
- package/dist/RcMap.js +13 -14
- package/dist/RcMap.js.map +1 -1
- package/dist/Runtime.d.ts +75 -3
- package/dist/Runtime.d.ts.map +1 -1
- package/dist/Runtime.js +81 -4
- package/dist/Runtime.js.map +1 -1
- package/dist/Schema.d.ts +131 -29
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +128 -22
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +24 -12
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaParser.js +2 -2
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +9 -0
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +9 -0
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/ScopedCache.d.ts +7 -0
- package/dist/ScopedCache.d.ts.map +1 -1
- package/dist/ScopedCache.js +18 -1
- package/dist/ScopedCache.js.map +1 -1
- package/dist/ai/AgUi.d.ts +109 -0
- package/dist/ai/AgUi.d.ts.map +1 -0
- package/dist/ai/AgUi.js +543 -0
- package/dist/ai/AgUi.js.map +1 -0
- package/dist/ai/AgUiSchema.d.ts +6965 -0
- package/dist/ai/AgUiSchema.d.ts.map +1 -0
- package/dist/ai/AgUiSchema.js +974 -0
- package/dist/ai/AgUiSchema.js.map +1 -0
- package/dist/ai/AgUiServer.d.ts +6400 -0
- package/dist/ai/AgUiServer.d.ts.map +1 -0
- package/dist/ai/AgUiServer.js +309 -0
- package/dist/ai/AgUiServer.js.map +1 -0
- package/dist/ai/Chat.d.ts +30 -4
- package/dist/ai/Chat.d.ts.map +1 -1
- package/dist/ai/Chat.js +34 -4
- package/dist/ai/Chat.js.map +1 -1
- package/dist/ai/LanguageModel.d.ts +1 -1
- package/dist/ai/LanguageModel.d.ts.map +1 -1
- package/dist/ai/LanguageModel.js +18 -8
- package/dist/ai/LanguageModel.js.map +1 -1
- package/dist/ai/McpClient.d.ts +5 -0
- package/dist/ai/McpClient.d.ts.map +1 -1
- package/dist/ai/McpClient.js +11 -1
- package/dist/ai/McpClient.js.map +1 -1
- package/dist/ai/McpServer.d.ts +18 -1
- package/dist/ai/McpServer.d.ts.map +1 -1
- package/dist/ai/McpServer.js +214 -34
- package/dist/ai/McpServer.js.map +1 -1
- package/dist/ai/Prompt.d.ts +6 -2
- package/dist/ai/Prompt.d.ts.map +1 -1
- package/dist/ai/Prompt.js.map +1 -1
- package/dist/ai/Response.d.ts +5 -2
- package/dist/ai/Response.d.ts.map +1 -1
- package/dist/ai/Response.js +5 -1
- package/dist/ai/Response.js.map +1 -1
- package/dist/ai/Tool.d.ts +265 -69
- package/dist/ai/Tool.d.ts.map +1 -1
- package/dist/ai/Tool.js +19 -2
- package/dist/ai/Tool.js.map +1 -1
- package/dist/ai/Toolkit.d.ts +32 -2
- package/dist/ai/Toolkit.d.ts.map +1 -1
- package/dist/ai/Toolkit.js +61 -8
- package/dist/ai/Toolkit.js.map +1 -1
- package/dist/ai/index.d.ts +15 -0
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +15 -0
- package/dist/ai/index.js.map +1 -1
- package/dist/ai/internal/mcpCore.d.ts +0 -2
- package/dist/ai/internal/mcpCore.d.ts.map +1 -1
- package/dist/ai/internal/mcpCore.js +2 -8
- package/dist/ai/internal/mcpCore.js.map +1 -1
- package/dist/ai/internal/mcpProtocol/v2024_11_05.js +6 -11
- package/dist/ai/internal/mcpProtocol/v2024_11_05.js.map +1 -1
- package/dist/ai/internal/mcpProtocol/v2025_03_26.js +6 -11
- package/dist/ai/internal/mcpProtocol/v2025_03_26.js.map +1 -1
- package/dist/ai/internal/mcpProtocol/v2025_06_18.js +6 -8
- package/dist/ai/internal/mcpProtocol/v2025_06_18.js.map +1 -1
- package/dist/ai/internal/mcpProtocol/v2025_11_25.js +6 -8
- package/dist/ai/internal/mcpProtocol/v2025_11_25.js.map +1 -1
- package/dist/ai/internal/mcpProtocol/v2026_07_28.js +60 -51
- package/dist/ai/internal/mcpProtocol/v2026_07_28.js.map +1 -1
- package/dist/ai/internal/mcpProtocol.js +11 -1
- package/dist/ai/internal/mcpProtocol.js.map +1 -1
- package/dist/ai/internal/mcpProtocolRegistry.js +4 -0
- package/dist/ai/internal/mcpProtocolRegistry.js.map +1 -1
- package/dist/ai/internal/mcpRuntime.js +6 -2
- package/dist/ai/internal/mcpRuntime.js.map +1 -1
- package/dist/ai/internal/mcpSchema/v2024_11_05.js +0 -2
- package/dist/ai/internal/mcpSchema/v2024_11_05.js.map +1 -1
- package/dist/ai/internal/mcpSchema/v2025_03_26.d.ts.map +1 -1
- package/dist/ai/internal/mcpSchema/v2025_03_26.js +0 -2
- package/dist/ai/internal/mcpSchema/v2025_03_26.js.map +1 -1
- package/dist/ai/internal/mcpSchema/v2025_06_18.d.ts.map +1 -1
- package/dist/ai/internal/mcpSchema/v2025_06_18.js +0 -2
- package/dist/ai/internal/mcpSchema/v2025_06_18.js.map +1 -1
- package/dist/ai/internal/mcpSchema/v2025_11_25.d.ts.map +1 -1
- package/dist/ai/internal/mcpSchema/v2025_11_25.js +0 -2
- package/dist/ai/internal/mcpSchema/v2025_11_25.js.map +1 -1
- package/dist/ai/internal/mcpSchema/v2026_07_28.d.ts.map +1 -1
- package/dist/ai/internal/mcpSchema/v2026_07_28.js +0 -2
- package/dist/ai/internal/mcpSchema/v2026_07_28.js.map +1 -1
- package/dist/ai/internal/mcpSkills.js +3 -93
- package/dist/ai/internal/mcpSkills.js.map +1 -1
- package/dist/ai/internal/mcpStatefulRuntime.js +0 -2
- package/dist/ai/internal/mcpStatefulRuntime.js.map +1 -1
- package/dist/ai/internal/structured-output.js +1 -1
- package/dist/ai/internal/structured-output.js.map +1 -1
- package/dist/cli/Argument.d.ts +81 -0
- package/dist/cli/Argument.d.ts.map +1 -1
- package/dist/cli/Argument.js +26 -0
- package/dist/cli/Argument.js.map +1 -1
- package/dist/cli/CliError.d.ts +7 -4
- package/dist/cli/CliError.d.ts.map +1 -1
- package/dist/cli/CliError.js +7 -4
- package/dist/cli/CliError.js.map +1 -1
- package/dist/cli/Command.d.ts +241 -22
- package/dist/cli/Command.d.ts.map +1 -1
- package/dist/cli/Command.js +85 -9
- package/dist/cli/Command.js.map +1 -1
- package/dist/cli/CommandSpec.d.ts +287 -0
- package/dist/cli/CommandSpec.d.ts.map +1 -0
- package/dist/cli/CommandSpec.js +277 -0
- package/dist/cli/CommandSpec.js.map +1 -0
- package/dist/cli/Completions.d.ts +5 -0
- package/dist/cli/Completions.d.ts.map +1 -1
- package/dist/cli/Completions.js.map +1 -1
- package/dist/cli/Flag.d.ts +102 -0
- package/dist/cli/Flag.d.ts.map +1 -1
- package/dist/cli/Flag.js +47 -0
- package/dist/cli/Flag.js.map +1 -1
- package/dist/cli/Param.d.ts +154 -1
- package/dist/cli/Param.d.ts.map +1 -1
- package/dist/cli/Param.js +87 -29
- package/dist/cli/Param.js.map +1 -1
- package/dist/cli/index.d.ts +5 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +5 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/internal/command.d.ts +2 -2
- package/dist/cli/internal/command.d.ts.map +1 -1
- package/dist/cli/internal/command.js +1 -1
- package/dist/cli/internal/command.js.map +1 -1
- package/dist/cli/internal/completions/bash.js +6 -7
- package/dist/cli/internal/completions/bash.js.map +1 -1
- package/dist/cli/internal/completions/descriptor.js +21 -7
- package/dist/cli/internal/completions/descriptor.js.map +1 -1
- package/dist/cli/internal/completions/fish.js +3 -3
- package/dist/cli/internal/completions/fish.js.map +1 -1
- package/dist/cli/internal/completions/powershell.js +2 -2
- package/dist/cli/internal/completions/powershell.js.map +1 -1
- package/dist/cli/internal/completions/zsh.js +2 -2
- package/dist/cli/internal/completions/zsh.js.map +1 -1
- package/dist/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/cluster/ClusterWorkflowEngine.js +15 -13
- package/dist/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/cluster/Entity.d.ts +17 -0
- package/dist/cluster/Entity.d.ts.map +1 -1
- package/dist/cluster/Entity.js +20 -0
- package/dist/cluster/Entity.js.map +1 -1
- package/dist/cluster/MessageRetention.d.ts +71 -0
- package/dist/cluster/MessageRetention.d.ts.map +1 -0
- package/dist/cluster/MessageRetention.js +100 -0
- package/dist/cluster/MessageRetention.js.map +1 -0
- package/dist/cluster/MessageStorage.d.ts +81 -0
- package/dist/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/cluster/MessageStorage.js +34 -2
- package/dist/cluster/MessageStorage.js.map +1 -1
- package/dist/cluster/ShardingConfig.d.ts +24 -2
- package/dist/cluster/ShardingConfig.d.ts.map +1 -1
- package/dist/cluster/ShardingConfig.js.map +1 -1
- package/dist/cluster/SqlMessageStorage.d.ts.map +1 -1
- package/dist/cluster/SqlMessageStorage.js +187 -29
- package/dist/cluster/SqlMessageStorage.js.map +1 -1
- package/dist/cluster/index.d.ts +5 -0
- package/dist/cluster/index.d.ts.map +1 -1
- package/dist/cluster/index.js +5 -0
- package/dist/cluster/index.js.map +1 -1
- package/dist/encoding/Base64.d.ts +0 -6
- package/dist/encoding/Base64.d.ts.map +1 -1
- package/dist/encoding/Base64.js +25 -5
- package/dist/encoding/Base64.js.map +1 -1
- package/dist/encoding/Base64Url.d.ts +0 -6
- package/dist/encoding/Base64Url.d.ts.map +1 -1
- package/dist/encoding/Base64Url.js +91 -8
- package/dist/encoding/Base64Url.js.map +1 -1
- package/dist/encoding/Csv.d.ts.map +1 -1
- package/dist/encoding/Csv.js +11 -5
- package/dist/encoding/Csv.js.map +1 -1
- package/dist/encoding/Hex.d.ts.map +1 -1
- package/dist/encoding/Hex.js +51 -34
- package/dist/encoding/Hex.js.map +1 -1
- package/dist/encoding/SchemaBinary.d.ts +14 -2
- package/dist/encoding/SchemaBinary.d.ts.map +1 -1
- package/dist/encoding/SchemaBinary.js +78 -5
- package/dist/encoding/SchemaBinary.js.map +1 -1
- package/dist/encoding/Xml.d.ts +25 -0
- package/dist/encoding/Xml.d.ts.map +1 -1
- package/dist/encoding/Xml.js +44 -19
- package/dist/encoding/Xml.js.map +1 -1
- package/dist/graphql/GraphQL.d.ts.map +1 -1
- package/dist/graphql/GraphQL.js +4 -1
- package/dist/graphql/GraphQL.js.map +1 -1
- package/dist/http/Headers.d.ts +5 -1
- package/dist/http/Headers.d.ts.map +1 -1
- package/dist/http/Headers.js +7 -2
- package/dist/http/Headers.js.map +1 -1
- package/dist/http/HttpClient.d.ts +57 -12
- package/dist/http/HttpClient.d.ts.map +1 -1
- package/dist/http/HttpClient.js +92 -54
- package/dist/http/HttpClient.js.map +1 -1
- package/dist/http/HttpClientError.d.ts +22 -8
- package/dist/http/HttpClientError.d.ts.map +1 -1
- package/dist/http/HttpClientError.js +68 -14
- package/dist/http/HttpClientError.js.map +1 -1
- package/dist/http/HttpEffect.d.ts +63 -4
- package/dist/http/HttpEffect.d.ts.map +1 -1
- package/dist/http/HttpEffect.js +89 -9
- 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/HttpServer.d.ts +80 -0
- package/dist/http/HttpServer.d.ts.map +1 -1
- package/dist/http/HttpServer.js +16 -0
- package/dist/http/HttpServer.js.map +1 -1
- package/dist/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/http/HttpServerRequest.js +1 -14
- package/dist/http/HttpServerRequest.js.map +1 -1
- package/dist/http/HttpStaticServer.js +10 -16
- package/dist/http/HttpStaticServer.js.map +1 -1
- package/dist/http-api/HttpApiBuilder.js +9 -1
- package/dist/http-api/HttpApiBuilder.js.map +1 -1
- package/dist/http-api/HttpApiSchema.d.ts +19 -0
- package/dist/http-api/HttpApiSchema.d.ts.map +1 -1
- package/dist/http-api/HttpApiSchema.js +8 -1
- package/dist/http-api/HttpApiSchema.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/internal/base64.d.ts +2 -0
- package/dist/internal/base64.d.ts.map +1 -0
- package/dist/internal/base64.js +30 -0
- package/dist/internal/base64.js.map +1 -0
- package/dist/internal/core.js +3 -4
- package/dist/internal/core.js.map +1 -1
- package/dist/internal/dateTime.js +18 -10
- package/dist/internal/dateTime.js.map +1 -1
- package/dist/internal/effect.js +41 -17
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/equal.js +7 -0
- package/dist/internal/equal.js.map +1 -1
- package/dist/internal/matcher.js +1 -1
- package/dist/internal/matcher.js.map +1 -1
- package/dist/internal/schema/codegen.js +7 -7
- package/dist/internal/schema/codegen.js.map +1 -1
- package/dist/internal/schema/fromJsonSchemaDocument.js +20 -1
- package/dist/internal/schema/fromJsonSchemaDocument.js.map +1 -1
- package/dist/internal/schema/interpreter.js +10 -10
- package/dist/internal/schema/interpreter.js.map +1 -1
- package/dist/internal/schema/parser.js +9 -4
- package/dist/internal/schema/parser.js.map +1 -1
- package/dist/internal/schema/toEquivalence.js +6 -5
- package/dist/internal/schema/toEquivalence.js.map +1 -1
- package/dist/internal/schema/toFormatter.js +3 -2
- package/dist/internal/schema/toFormatter.js.map +1 -1
- package/dist/internal/version.js +1 -1
- package/dist/observability/OtlpMetrics.js +1 -1
- package/dist/observability/OtlpMetrics.js.map +1 -1
- package/dist/observability/OtlpTracer.js +2 -2
- package/dist/observability/OtlpTracer.js.map +1 -1
- package/dist/persistence/PersistedQueue.d.ts +72 -3
- package/dist/persistence/PersistedQueue.d.ts.map +1 -1
- package/dist/persistence/PersistedQueue.js +142 -29
- package/dist/persistence/PersistedQueue.js.map +1 -1
- package/dist/persistence/RateLimiter.d.ts +12 -2
- package/dist/persistence/RateLimiter.d.ts.map +1 -1
- package/dist/persistence/RateLimiter.js +11 -4
- package/dist/persistence/RateLimiter.js.map +1 -1
- package/dist/process/CommandLine.d.ts +9 -9
- package/dist/process/CommandLine.js +6 -6
- package/dist/process/index.d.ts +1 -1
- package/dist/process/index.js +1 -1
- package/dist/reactivity/Atom.d.ts.map +1 -1
- package/dist/reactivity/Atom.js +24 -3
- package/dist/reactivity/Atom.js.map +1 -1
- package/dist/reactivity/AtomRpc.d.ts +24 -6
- package/dist/reactivity/AtomRpc.d.ts.map +1 -1
- package/dist/reactivity/AtomRpc.js.map +1 -1
- package/dist/rpc/OpenRpc.d.ts +384 -0
- package/dist/rpc/OpenRpc.d.ts.map +1 -0
- package/dist/rpc/OpenRpc.js +490 -0
- package/dist/rpc/OpenRpc.js.map +1 -0
- package/dist/rpc/Rpc.d.ts +22 -3
- package/dist/rpc/Rpc.d.ts.map +1 -1
- package/dist/rpc/Rpc.js.map +1 -1
- package/dist/rpc/RpcClient.d.ts +20 -21
- package/dist/rpc/RpcClient.d.ts.map +1 -1
- package/dist/rpc/RpcClient.js.map +1 -1
- package/dist/rpc/RpcServer.d.ts +23 -2
- package/dist/rpc/RpcServer.d.ts.map +1 -1
- package/dist/rpc/RpcServer.js +67 -25
- package/dist/rpc/RpcServer.js.map +1 -1
- package/dist/rpc/index.d.ts +5 -0
- package/dist/rpc/index.d.ts.map +1 -1
- package/dist/rpc/index.js +5 -0
- package/dist/rpc/index.js.map +1 -1
- package/dist/schema/SchemaCompiler/runtime.js +3 -2
- package/dist/schema/SchemaCompiler/runtime.js.map +1 -1
- package/dist/sql/SqlClient.d.ts +59 -6
- package/dist/sql/SqlClient.d.ts.map +1 -1
- package/dist/sql/SqlClient.js +64 -17
- package/dist/sql/SqlClient.js.map +1 -1
- package/dist/sql/Statement.d.ts +1 -1
- package/dist/sql/Statement.d.ts.map +1 -1
- package/dist/sql/Statement.js +9 -16
- package/dist/sql/Statement.js.map +1 -1
- package/dist/testing/TestClock.d.ts +2 -12
- package/dist/testing/TestClock.d.ts.map +1 -1
- package/dist/testing/TestClock.js +177 -169
- package/dist/testing/TestClock.js.map +1 -1
- package/dist/workflow/DurableClock.d.ts +27 -0
- package/dist/workflow/DurableClock.d.ts.map +1 -1
- package/dist/workflow/DurableClock.js +18 -2
- package/dist/workflow/DurableClock.js.map +1 -1
- package/dist/workflow/Workflow.d.ts.map +1 -1
- package/dist/workflow/Workflow.js +5 -4
- package/dist/workflow/Workflow.js.map +1 -1
- package/dist/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/workflow/WorkflowEngine.js +14 -3
- package/dist/workflow/WorkflowEngine.js.map +1 -1
- package/package.json +3 -3
- package/src/DateTime.ts +35 -2
- package/src/Match.ts +10 -8
- package/src/Queue.ts +16 -11
- package/src/Rational.ts +1549 -0
- package/src/RcMap.ts +16 -14
- package/src/Runtime.ts +84 -4
- package/src/Schema.ts +188 -29
- package/src/SchemaAST.ts +29 -13
- package/src/SchemaParser.ts +2 -2
- package/src/SchemaRepresentation.ts +13 -0
- package/src/ScopedCache.ts +18 -1
- package/src/ai/AgUi.ts +485 -0
- package/src/ai/AgUiSchema.ts +1666 -0
- package/src/ai/AgUiServer.ts +451 -0
- package/src/ai/Chat.ts +78 -16
- package/src/ai/LanguageModel.ts +27 -9
- package/src/ai/McpClient.ts +11 -1
- package/src/ai/McpServer.ts +247 -50
- package/src/ai/Prompt.ts +6 -2
- package/src/ai/Response.ts +19 -3
- package/src/ai/Tool.ts +426 -110
- package/src/ai/Toolkit.ts +71 -10
- package/src/ai/index.ts +18 -0
- package/src/ai/internal/mcpCore.ts +11 -15
- package/src/ai/internal/mcpProtocol/v2024_11_05.ts +9 -14
- package/src/ai/internal/mcpProtocol/v2025_03_26.ts +9 -14
- package/src/ai/internal/mcpProtocol/v2025_06_18.ts +9 -11
- package/src/ai/internal/mcpProtocol/v2025_11_25.ts +9 -11
- package/src/ai/internal/mcpProtocol/v2026_07_28.ts +76 -55
- package/src/ai/internal/mcpProtocol.ts +22 -3
- package/src/ai/internal/mcpProtocolRegistry.ts +5 -0
- package/src/ai/internal/mcpRuntime.ts +10 -4
- package/src/ai/internal/mcpSchema/v2024_11_05.ts +0 -2
- package/src/ai/internal/mcpSchema/v2025_03_26.ts +0 -2
- package/src/ai/internal/mcpSchema/v2025_06_18.ts +0 -2
- package/src/ai/internal/mcpSchema/v2025_11_25.ts +0 -2
- package/src/ai/internal/mcpSchema/v2026_07_28.ts +0 -2
- package/src/ai/internal/mcpSkills.ts +3 -86
- package/src/ai/internal/mcpStatefulRuntime.ts +0 -2
- package/src/ai/internal/structured-output.ts +1 -1
- package/src/cli/Argument.ts +86 -0
- package/src/cli/CliError.ts +7 -4
- package/src/cli/Command.ts +261 -35
- package/src/cli/CommandSpec.ts +508 -0
- package/src/cli/Completions.ts +5 -0
- package/src/cli/Flag.ts +106 -0
- package/src/cli/Param.ts +225 -23
- package/src/cli/index.ts +6 -0
- package/src/cli/internal/command.ts +3 -4
- package/src/cli/internal/completions/bash.ts +9 -7
- package/src/cli/internal/completions/descriptor.ts +37 -5
- package/src/cli/internal/completions/fish.ts +9 -3
- package/src/cli/internal/completions/powershell.ts +2 -1
- package/src/cli/internal/completions/zsh.ts +2 -2
- package/src/cluster/ClusterWorkflowEngine.ts +14 -15
- package/src/cluster/Entity.ts +24 -0
- package/src/cluster/MessageRetention.ts +111 -0
- package/src/cluster/MessageStorage.ts +73 -2
- package/src/cluster/ShardingConfig.ts +12 -1
- package/src/cluster/SqlMessageStorage.ts +271 -41
- package/src/cluster/index.ts +6 -0
- package/src/encoding/Base64.ts +26 -5
- package/src/encoding/Base64Url.ts +93 -10
- package/src/encoding/Csv.ts +11 -5
- package/src/encoding/Hex.ts +56 -42
- package/src/encoding/SchemaBinary.ts +76 -5
- package/src/encoding/Xml.ts +65 -16
- package/src/graphql/GraphQL.ts +7 -4
- package/src/http/Headers.ts +7 -2
- package/src/http/HttpClient.ts +118 -68
- package/src/http/HttpClientError.ts +82 -15
- package/src/http/HttpEffect.ts +101 -10
- package/src/http/HttpMiddleware.ts +2 -2
- package/src/http/HttpServer.ts +80 -0
- package/src/http/HttpServerRequest.ts +1 -19
- package/src/http/HttpStaticServer.ts +10 -16
- package/src/http-api/HttpApiBuilder.ts +11 -1
- package/src/http-api/HttpApiSchema.ts +22 -1
- package/src/index.ts +6 -0
- package/src/internal/base64.ts +42 -0
- package/src/internal/core.ts +3 -4
- package/src/internal/dateTime.ts +27 -13
- package/src/internal/effect.ts +45 -18
- package/src/internal/equal.ts +8 -0
- package/src/internal/matcher.ts +7 -3
- package/src/internal/schema/codegen.ts +8 -7
- package/src/internal/schema/fromJsonSchemaDocument.ts +21 -1
- package/src/internal/schema/interpreter.ts +10 -10
- package/src/internal/schema/parser.ts +8 -4
- package/src/internal/schema/toEquivalence.ts +7 -5
- package/src/internal/schema/toFormatter.ts +3 -2
- package/src/internal/version.ts +1 -1
- package/src/observability/OtlpMetrics.ts +1 -1
- package/src/observability/OtlpTracer.ts +2 -2
- package/src/persistence/PersistedQueue.ts +199 -41
- package/src/persistence/RateLimiter.ts +17 -5
- package/src/process/CommandLine.ts +10 -10
- package/src/process/index.ts +1 -1
- package/src/reactivity/Atom.ts +25 -3
- package/src/reactivity/AtomRpc.ts +61 -45
- package/src/rpc/OpenRpc.ts +747 -0
- package/src/rpc/Rpc.ts +38 -6
- package/src/rpc/RpcClient.ts +45 -82
- package/src/rpc/RpcServer.ts +77 -28
- package/src/rpc/index.ts +6 -0
- package/src/schema/SchemaCompiler/runtime.ts +8 -3
- package/src/sql/SqlClient.ts +112 -26
- package/src/sql/Statement.ts +19 -23
- package/src/testing/TestClock.ts +204 -189
- package/src/workflow/DurableClock.ts +20 -3
- package/src/workflow/Workflow.ts +5 -3
- package/src/workflow/WorkflowEngine.ts +20 -5
package/dist/Schema.js
CHANGED
|
@@ -67,6 +67,7 @@ import * as Option_ from "./Option.js";
|
|
|
67
67
|
import * as Order from "./Order.js";
|
|
68
68
|
import * as Pipeable from "./Pipeable.js";
|
|
69
69
|
import * as Predicate from "./Predicate.js";
|
|
70
|
+
import * as Rational_ from "./Rational.js";
|
|
70
71
|
import * as Record_ from "./Record.js";
|
|
71
72
|
import * as Redacted_ from "./Redacted.js";
|
|
72
73
|
import * as RegExp_ from "./RegExp.js";
|
|
@@ -1604,8 +1605,8 @@ function templateLiteralParts(parts) {
|
|
|
1604
1605
|
return parts.map(part => isSchema(part) ? part.ast : new SchemaAST.Literal(part));
|
|
1605
1606
|
}
|
|
1606
1607
|
/**
|
|
1607
|
-
* Creates a schema that validates strings
|
|
1608
|
-
* parts.
|
|
1608
|
+
* Creates a schema that validates strings against a fixed-length tuple of
|
|
1609
|
+
* template literal parts.
|
|
1609
1610
|
*
|
|
1610
1611
|
* **When to use**
|
|
1611
1612
|
*
|
|
@@ -1620,6 +1621,9 @@ function templateLiteralParts(parts) {
|
|
|
1620
1621
|
*
|
|
1621
1622
|
* **Gotchas**
|
|
1622
1623
|
*
|
|
1624
|
+
* Use an inline tuple or `as const` for `parts`. Widened arrays and open-ended
|
|
1625
|
+
* tuples are unsupported despite being accepted by the signature.
|
|
1626
|
+
*
|
|
1623
1627
|
* Parts must not contain encodings, including inside unions or nested templates.
|
|
1624
1628
|
* Construction throws for transformed parts even when their decoded and encoded
|
|
1625
1629
|
* types are the same. Use {@link TemplateLiteralParser} to decode transformed parts.
|
|
@@ -1645,7 +1649,8 @@ export function TemplateLiteral(parts) {
|
|
|
1645
1649
|
});
|
|
1646
1650
|
}
|
|
1647
1651
|
/**
|
|
1648
|
-
*
|
|
1652
|
+
* Parses strings into typed tuples using a fixed-length tuple of template
|
|
1653
|
+
* literal parts.
|
|
1649
1654
|
*
|
|
1650
1655
|
* **When to use**
|
|
1651
1656
|
*
|
|
@@ -1662,6 +1667,9 @@ export function TemplateLiteral(parts) {
|
|
|
1662
1667
|
*
|
|
1663
1668
|
* **Gotchas**
|
|
1664
1669
|
*
|
|
1670
|
+
* Use an inline tuple or `as const` for `parts`. Widened arrays and open-ended
|
|
1671
|
+
* tuples are unsupported despite being accepted by the signature.
|
|
1672
|
+
*
|
|
1665
1673
|
* Ambiguous templates use greedy segmentation with backtracking. Encoding a
|
|
1666
1674
|
* tuple and decoding the resulting string can therefore produce a different
|
|
1667
1675
|
* tuple when a segment contains a separator used by the template.
|
|
@@ -2171,11 +2179,14 @@ export function Record(key, value) {
|
|
|
2171
2179
|
});
|
|
2172
2180
|
}
|
|
2173
2181
|
/**
|
|
2174
|
-
* Extends a struct schema with
|
|
2175
|
-
*
|
|
2182
|
+
* Extends a struct schema with a fixed-length tuple of record schemas, producing
|
|
2183
|
+
* a schema whose decoded type intersects the struct and all records.
|
|
2176
2184
|
*
|
|
2177
2185
|
* **Gotchas**
|
|
2178
2186
|
*
|
|
2187
|
+
* Keep `records` as a tuple using an inline literal or `as const`. Widened arrays
|
|
2188
|
+
* and open-ended tuples are unsupported and can lose inferred index signatures.
|
|
2189
|
+
*
|
|
2179
2190
|
* The base schema must have an object-shaped encoded type. Whole-object
|
|
2180
2191
|
* transformations are not supported, even with an empty rest array. Apply
|
|
2181
2192
|
* transformations such as `Schema.fromJsonString` to the completed
|
|
@@ -2222,7 +2233,12 @@ function makeTuple(ast, elements) {
|
|
|
2222
2233
|
});
|
|
2223
2234
|
}
|
|
2224
2235
|
/**
|
|
2225
|
-
* Defines a
|
|
2236
|
+
* Defines a tuple schema from a fixed-length tuple of element schemas.
|
|
2237
|
+
*
|
|
2238
|
+
* **Gotchas**
|
|
2239
|
+
*
|
|
2240
|
+
* Use an inline tuple or `as const`. Widened arrays and open-ended tuples are
|
|
2241
|
+
* unsupported despite being accepted by the signature.
|
|
2226
2242
|
*
|
|
2227
2243
|
* **Example** (Defining a pair of string and number)
|
|
2228
2244
|
*
|
|
@@ -2246,6 +2262,8 @@ export function Tuple(elements) {
|
|
|
2246
2262
|
*
|
|
2247
2263
|
* **Details**
|
|
2248
2264
|
*
|
|
2265
|
+
* The `rest` argument must be a non-empty fixed-length tuple of schemas.
|
|
2266
|
+
*
|
|
2249
2267
|
* The resulting tuple starts with the fixed elements from `schema`. The first
|
|
2250
2268
|
* schema in `rest` is the repeatable element schema, and any additional schemas
|
|
2251
2269
|
* in `rest` are required trailing tuple elements after the variadic segment. For
|
|
@@ -2426,8 +2444,8 @@ function makeUnion(ast, members) {
|
|
|
2426
2444
|
});
|
|
2427
2445
|
}
|
|
2428
2446
|
/**
|
|
2429
|
-
* Creates a union schema from
|
|
2430
|
-
* order; the first match is returned.
|
|
2447
|
+
* Creates a union schema from a fixed-length tuple of member schemas. Members
|
|
2448
|
+
* are tested in order; the first match is returned.
|
|
2431
2449
|
*
|
|
2432
2450
|
* **Details**
|
|
2433
2451
|
*
|
|
@@ -2435,6 +2453,12 @@ function makeUnion(ast, members) {
|
|
|
2435
2453
|
* - `"anyOf"` (default) — matches if any member matches.
|
|
2436
2454
|
* - `"oneOf"` — matches if exactly one member matches.
|
|
2437
2455
|
*
|
|
2456
|
+
* **Gotchas**
|
|
2457
|
+
*
|
|
2458
|
+
* Use an inline tuple or `as const`. Widened arrays, such as `Object.values(...)`
|
|
2459
|
+
* or `.map(...)` results, and open-ended tuples are unsupported despite being
|
|
2460
|
+
* accepted by the signature.
|
|
2461
|
+
*
|
|
2438
2462
|
* **Example** (Defining a string or number union)
|
|
2439
2463
|
*
|
|
2440
2464
|
* ```ts import.meta.vitest
|
|
@@ -2454,7 +2478,12 @@ export function Union(members, options) {
|
|
|
2454
2478
|
return makeUnion(SchemaAST.union(members, options, undefined), members);
|
|
2455
2479
|
}
|
|
2456
2480
|
/**
|
|
2457
|
-
* Creates a union schema from
|
|
2481
|
+
* Creates a union schema from a fixed-length tuple of literal values.
|
|
2482
|
+
*
|
|
2483
|
+
* **Gotchas**
|
|
2484
|
+
*
|
|
2485
|
+
* Use an inline tuple or `as const` to preserve positions for `mapMembers` and
|
|
2486
|
+
* `transform`. Widened arrays and open-ended tuples are unsupported.
|
|
2458
2487
|
*
|
|
2459
2488
|
* **Example** (Defining status codes)
|
|
2460
2489
|
*
|
|
@@ -3222,14 +3251,17 @@ export function TaggedStruct(value, fields) {
|
|
|
3222
3251
|
});
|
|
3223
3252
|
}
|
|
3224
3253
|
/**
|
|
3225
|
-
* Augments
|
|
3226
|
-
* values.
|
|
3254
|
+
* Augments a {@link Union} of tagged structs or nested unions with utility methods
|
|
3255
|
+
* and an ordered tuple of discriminant values.
|
|
3227
3256
|
*
|
|
3228
3257
|
* **Gotchas**
|
|
3229
3258
|
*
|
|
3230
|
-
*
|
|
3231
|
-
*
|
|
3232
|
-
*
|
|
3259
|
+
* - Requires fixed-length member tuples, including in nested unions. Widened arrays
|
|
3260
|
+
* and open-ended tuples compile but are unsupported and can lose members from
|
|
3261
|
+
* `discriminants`, `cases`, `guards` and match handler types.
|
|
3262
|
+
* - Throws when multiple members use the same discriminant property key,
|
|
3263
|
+
* including members of nested unions. Numeric and string values such as `1`
|
|
3264
|
+
* and `"1"` count as duplicates.
|
|
3233
3265
|
*
|
|
3234
3266
|
* **Example** (Adding tagged-union utilities to an existing union)
|
|
3235
3267
|
*
|
|
@@ -7098,6 +7130,75 @@ export const BigDecimal = /*#__PURE__*/declare(BigDecimal_.isBigDecimal, {
|
|
|
7098
7130
|
* @since 4.0.0
|
|
7099
7131
|
*/
|
|
7100
7132
|
export const BigDecimalFromString = /*#__PURE__*/BigDecimalString.pipe(/*#__PURE__*/decodeTo(BigDecimal, bigDecimalFromString));
|
|
7133
|
+
// -----------------------------------------------------------------------------
|
|
7134
|
+
// Rational schemas
|
|
7135
|
+
// -----------------------------------------------------------------------------
|
|
7136
|
+
const rationalFromString = /*#__PURE__*/SchemaTransformation.transformEffect({
|
|
7137
|
+
decode: (s, options) => {
|
|
7138
|
+
const result = Rational_.fromString(s);
|
|
7139
|
+
return Option_.isNone(result) ? Effect.fail(new SchemaIssue.InvalidValue({
|
|
7140
|
+
expected: "a valid Rational string"
|
|
7141
|
+
}, s, options)) : Effect.succeed(result.value);
|
|
7142
|
+
},
|
|
7143
|
+
encode: rational => Effect.succeed(Rational_.format(rational))
|
|
7144
|
+
});
|
|
7145
|
+
const RationalString = /*#__PURE__*/String.annotate({
|
|
7146
|
+
expected: "a string that will be decoded as a Rational"
|
|
7147
|
+
});
|
|
7148
|
+
/**
|
|
7149
|
+
* Schema for `Rational` values.
|
|
7150
|
+
*
|
|
7151
|
+
* **Details**
|
|
7152
|
+
*
|
|
7153
|
+
* The JSON codec encodes a rational as its canonical `numerator/denominator`
|
|
7154
|
+
* string.
|
|
7155
|
+
*
|
|
7156
|
+
* @see {@link RationalFromString} for parsing fraction strings into a Rational
|
|
7157
|
+
*
|
|
7158
|
+
* @stability unstable
|
|
7159
|
+
* @category schemas
|
|
7160
|
+
* @since 4.1.3
|
|
7161
|
+
*/
|
|
7162
|
+
export const Rational = /*#__PURE__*/declare(Rational_.isRational, {
|
|
7163
|
+
representation: {
|
|
7164
|
+
id: "effect/schema/Rational",
|
|
7165
|
+
payload: null
|
|
7166
|
+
},
|
|
7167
|
+
toCode: () => ({
|
|
7168
|
+
runtime: `Schema.Rational`,
|
|
7169
|
+
Type: `Rational.Rational`,
|
|
7170
|
+
importDeclarations: [`import * as Rational from "effect/Rational"`]
|
|
7171
|
+
}),
|
|
7172
|
+
expected: "Rational",
|
|
7173
|
+
toCodecArbitrary: () => linkDecoding()(Struct({
|
|
7174
|
+
numerator: BigInt,
|
|
7175
|
+
denominator: BigInt.check(isGreaterThanOrEqualToBigInt(globalThis.BigInt(1)))
|
|
7176
|
+
}), SchemaGetter.transform(({
|
|
7177
|
+
denominator,
|
|
7178
|
+
numerator
|
|
7179
|
+
}) => Rational_.makeUnsafe(numerator, denominator))),
|
|
7180
|
+
toCodecJson: () => link()(RationalString, rationalFromString),
|
|
7181
|
+
toFormatter: () => Rational_.format
|
|
7182
|
+
});
|
|
7183
|
+
/**
|
|
7184
|
+
* Schema that parses a fraction string into a `Rational`.
|
|
7185
|
+
*
|
|
7186
|
+
* **Details**
|
|
7187
|
+
*
|
|
7188
|
+
* Decoding accepts `[+-]digits` or `[+-]digits/[+-]digits` via
|
|
7189
|
+
* `Rational.fromString`; reducible fractions and negative denominators are
|
|
7190
|
+
* normalized, and a zero denominator is rejected. Encoding uses
|
|
7191
|
+
* `Rational.format`, so the output is always a reduced `numerator/denominator`
|
|
7192
|
+
* string.
|
|
7193
|
+
*
|
|
7194
|
+
* @see {@link Rational} for validating values that are already Rational values
|
|
7195
|
+
* @see {@link BigDecimalFromString} for parsing decimal strings
|
|
7196
|
+
*
|
|
7197
|
+
* @stability unstable
|
|
7198
|
+
* @category schemas
|
|
7199
|
+
* @since 4.1.3
|
|
7200
|
+
*/
|
|
7201
|
+
export const RationalFromString = /*#__PURE__*/RationalString.pipe(/*#__PURE__*/decodeTo(Rational, rationalFromString));
|
|
7101
7202
|
/**
|
|
7102
7203
|
* Schema for exact, non-negative `ByteSize` values.
|
|
7103
7204
|
*
|
|
@@ -10729,14 +10830,15 @@ export function overrideToFormatter(toFormatter) {
|
|
|
10729
10830
|
});
|
|
10730
10831
|
}
|
|
10731
10832
|
/**
|
|
10732
|
-
* Derives a string formatter
|
|
10733
|
-
*
|
|
10734
|
-
* arrays, and unions.
|
|
10833
|
+
* Derives a string formatter from the decoded type side of a schema. The
|
|
10834
|
+
* formatter converts decoded values to human-readable strings, recursing into
|
|
10835
|
+
* structs, arrays, and unions.
|
|
10735
10836
|
*
|
|
10736
10837
|
* **Details**
|
|
10737
10838
|
*
|
|
10738
|
-
* The optional `onBefore` hook
|
|
10739
|
-
* the default formatting logic runs.
|
|
10839
|
+
* The optional `onBefore` hook receives type-side AST nodes with encoding
|
|
10840
|
+
* transformations removed, before the default formatting logic runs.
|
|
10841
|
+
* Use {@link toEncoded} before this function to format encoded values.
|
|
10740
10842
|
*
|
|
10741
10843
|
* @stability stable
|
|
10742
10844
|
* @category formatting
|
|
@@ -10764,9 +10866,13 @@ export function overrideToEquivalence(toEquivalence) {
|
|
|
10764
10866
|
});
|
|
10765
10867
|
}
|
|
10766
10868
|
/**
|
|
10767
|
-
* Derives an `Equivalence` from a schema. Two
|
|
10768
|
-
* every field
|
|
10769
|
-
* structure.
|
|
10869
|
+
* Derives an `Equivalence` from the decoded type side of a schema. Two decoded
|
|
10870
|
+
* values are considered equal when every field and nested field compares equal
|
|
10871
|
+
* according to the schema structure.
|
|
10872
|
+
*
|
|
10873
|
+
* **Details**
|
|
10874
|
+
*
|
|
10875
|
+
* Use {@link toEncoded} before this function to compare encoded values.
|
|
10770
10876
|
*
|
|
10771
10877
|
* **Example** (Comparing structs)
|
|
10772
10878
|
*
|