effect 4.0.0-beta.42 → 4.0.0-beta.44
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/dist/Cache.d.ts +12 -43
- package/dist/Cache.d.ts.map +1 -1
- package/dist/Cache.js +15 -42
- package/dist/Cache.js.map +1 -1
- package/dist/Cause.d.ts +21 -21
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Cause.js +89 -10
- package/dist/Cause.js.map +1 -1
- package/dist/Channel.d.ts +42 -19
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +86 -46
- package/dist/Channel.js.map +1 -1
- package/dist/Clock.d.ts +2 -2
- package/dist/Clock.d.ts.map +1 -1
- package/dist/Clock.js.map +1 -1
- package/dist/Config.d.ts +2 -2
- package/dist/ConfigProvider.d.ts +5 -5
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +5 -5
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Console.d.ts +2 -2
- package/dist/Console.d.ts.map +1 -1
- package/dist/Console.js.map +1 -1
- package/dist/Context.d.ts +1150 -0
- package/dist/Context.d.ts.map +1 -0
- package/dist/{ServiceMap.js → Context.js} +139 -139
- package/dist/Context.js.map +1 -0
- package/dist/DateTime.d.ts +2 -2
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +2 -2
- package/dist/DateTime.js.map +1 -1
- package/dist/Effect.d.ts +177 -177
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +81 -81
- package/dist/Effect.js.map +1 -1
- package/dist/ErrorReporter.d.ts +3 -3
- package/dist/ErrorReporter.d.ts.map +1 -1
- package/dist/ErrorReporter.js +1 -1
- package/dist/ErrorReporter.js.map +1 -1
- package/dist/ExecutionPlan.d.ts +6 -6
- package/dist/ExecutionPlan.d.ts.map +1 -1
- package/dist/ExecutionPlan.js +4 -4
- package/dist/ExecutionPlan.js.map +1 -1
- package/dist/Fiber.d.ts +7 -7
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js.map +1 -1
- package/dist/FiberHandle.d.ts +2 -2
- package/dist/FiberHandle.d.ts.map +1 -1
- package/dist/FiberHandle.js +4 -4
- package/dist/FiberHandle.js.map +1 -1
- package/dist/FiberMap.d.ts +2 -2
- package/dist/FiberMap.d.ts.map +1 -1
- package/dist/FiberMap.js +4 -4
- package/dist/FiberMap.js.map +1 -1
- package/dist/FiberSet.d.ts +2 -2
- package/dist/FiberSet.d.ts.map +1 -1
- package/dist/FiberSet.js +4 -4
- package/dist/FiberSet.js.map +1 -1
- package/dist/FileSystem.d.ts +3 -3
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +3 -3
- package/dist/FileSystem.js.map +1 -1
- package/dist/Layer.d.ts +309 -266
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +156 -132
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMap.d.ts +18 -18
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerMap.js +18 -15
- package/dist/LayerMap.js.map +1 -1
- package/dist/Logger.d.ts +3 -3
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js.map +1 -1
- package/dist/ManagedRuntime.d.ts +6 -6
- package/dist/ManagedRuntime.d.ts.map +1 -1
- package/dist/ManagedRuntime.js +18 -21
- package/dist/ManagedRuntime.js.map +1 -1
- package/dist/Metric.d.ts +19 -19
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +21 -21
- package/dist/Metric.js.map +1 -1
- package/dist/Path.d.ts +2 -2
- package/dist/Path.d.ts.map +1 -1
- package/dist/Path.js +2 -2
- package/dist/Path.js.map +1 -1
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +4 -4
- package/dist/Pool.js.map +1 -1
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +3 -3
- package/dist/PubSub.js.map +1 -1
- package/dist/Random.d.ts +2 -2
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +0 -23
- package/dist/Random.js.map +1 -1
- package/dist/RcMap.d.ts +2 -2
- package/dist/RcMap.d.ts.map +1 -1
- package/dist/RcMap.js +12 -12
- package/dist/RcMap.js.map +1 -1
- package/dist/Redactable.d.ts +139 -62
- package/dist/Redactable.d.ts.map +1 -1
- package/dist/Redactable.js +59 -55
- package/dist/Redactable.js.map +1 -1
- package/dist/References.d.ts +26 -14
- package/dist/References.d.ts.map +1 -1
- package/dist/References.js +0 -12
- package/dist/References.js.map +1 -1
- package/dist/Request.d.ts +5 -5
- package/dist/Request.d.ts.map +1 -1
- package/dist/Request.js.map +1 -1
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/RequestResolver.js +6 -7
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Resource.d.ts +0 -3
- package/dist/Resource.d.ts.map +1 -1
- package/dist/Resource.js +3 -3
- package/dist/Resource.js.map +1 -1
- package/dist/Schedule.d.ts +2 -2
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +2 -2
- package/dist/Schedule.js.map +1 -1
- package/dist/Scheduler.d.ts +4 -4
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +7 -4
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +531 -214
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +304 -103
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +5 -15
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +49 -5
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +64 -5
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +145 -0
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +146 -0
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/Scope.d.ts +2 -2
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js.map +1 -1
- package/dist/ScopedCache.d.ts.map +1 -1
- package/dist/ScopedCache.js +4 -4
- package/dist/ScopedCache.js.map +1 -1
- package/dist/Sink.d.ts +6 -6
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +1 -1
- package/dist/Sink.js.map +1 -1
- package/dist/Stdio.d.ts +2 -2
- package/dist/Stdio.d.ts.map +1 -1
- package/dist/Stdio.js +2 -2
- package/dist/Stdio.js.map +1 -1
- package/dist/Stream.d.ts +187 -117
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +133 -57
- package/dist/Stream.js.map +1 -1
- package/dist/Terminal.d.ts +3 -3
- package/dist/Terminal.d.ts.map +1 -1
- package/dist/Terminal.js +2 -2
- package/dist/Terminal.js.map +1 -1
- package/dist/Tracer.d.ts +16 -16
- package/dist/Tracer.d.ts.map +1 -1
- package/dist/Tracer.js +11 -8
- package/dist/Tracer.js.map +1 -1
- package/dist/Unify.d.ts +8 -2
- package/dist/Unify.d.ts.map +1 -1
- package/dist/Unify.js.map +1 -1
- package/dist/index.d.ts +81 -15
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +81 -15
- package/dist/index.js.map +1 -1
- package/dist/internal/core.js.map +1 -1
- package/dist/internal/effect.js +74 -74
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/layer.js +3 -3
- package/dist/internal/layer.js.map +1 -1
- package/dist/internal/random.js +2 -2
- package/dist/internal/random.js.map +1 -1
- package/dist/internal/rcRef.js +9 -9
- package/dist/internal/rcRef.js.map +1 -1
- package/dist/internal/references.js +13 -13
- package/dist/internal/references.js.map +1 -1
- package/dist/internal/request.js +6 -6
- package/dist/internal/request.js.map +1 -1
- package/dist/internal/schedule.js +1 -1
- package/dist/internal/schedule.js.map +1 -1
- package/dist/internal/schema/representation.js +11 -1
- package/dist/internal/schema/representation.js.map +1 -1
- package/dist/internal/schema/schema.d.ts +10 -1
- package/dist/internal/schema/schema.d.ts.map +1 -1
- package/dist/internal/schema/schema.js +21 -1
- package/dist/internal/schema/schema.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +3 -3
- package/dist/testing/TestSchema.d.ts.map +1 -1
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +19 -19
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.js +2 -1
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.js +5 -2
- package/dist/unstable/ai/AnthropicStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Chat.d.ts +4 -4
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.js +3 -3
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.d.ts +6 -6
- package/dist/unstable/ai/EmbeddingModel.d.ts.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.js +3 -3
- package/dist/unstable/ai/EmbeddingModel.js.map +1 -1
- package/dist/unstable/ai/IdGenerator.d.ts +2 -2
- package/dist/unstable/ai/IdGenerator.d.ts.map +1 -1
- package/dist/unstable/ai/IdGenerator.js +2 -2
- package/dist/unstable/ai/IdGenerator.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts +2 -2
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +2 -2
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +54 -54
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +15 -8
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts +22 -22
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +25 -25
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/Model.d.ts +3 -3
- package/dist/unstable/ai/Model.d.ts.map +1 -1
- package/dist/unstable/ai/Model.js +5 -5
- package/dist/unstable/ai/Model.js.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js +2 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Prompt.d.ts.map +1 -1
- package/dist/unstable/ai/Prompt.js +6 -9
- package/dist/unstable/ai/Prompt.js.map +1 -1
- package/dist/unstable/ai/Response.d.ts +1 -1
- package/dist/unstable/ai/Response.d.ts.map +1 -1
- package/dist/unstable/ai/Response.js +6 -7
- package/dist/unstable/ai/Response.js.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.d.ts +2 -2
- package/dist/unstable/ai/ResponseIdTracker.d.ts.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.js +2 -2
- package/dist/unstable/ai/ResponseIdTracker.js.map +1 -1
- package/dist/unstable/ai/Telemetry.d.ts +35 -2
- package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
- package/dist/unstable/ai/Telemetry.js +2 -2
- package/dist/unstable/ai/Telemetry.js.map +1 -1
- package/dist/unstable/ai/Tokenizer.d.ts +2 -2
- package/dist/unstable/ai/Tokenizer.d.ts.map +1 -1
- package/dist/unstable/ai/Tokenizer.js +2 -2
- package/dist/unstable/ai/Tokenizer.js.map +1 -1
- package/dist/unstable/ai/Tool.d.ts +16 -16
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +41 -13
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/ai/Toolkit.d.ts +3 -3
- package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
- package/dist/unstable/ai/Toolkit.js +10 -10
- package/dist/unstable/ai/Toolkit.js.map +1 -1
- package/dist/unstable/ai/internal/codec-transformer.js +5 -2
- package/dist/unstable/ai/internal/codec-transformer.js.map +1 -1
- package/dist/unstable/cli/Argument.d.ts +2 -3
- package/dist/unstable/cli/Argument.d.ts.map +1 -1
- package/dist/unstable/cli/Argument.js.map +1 -1
- package/dist/unstable/cli/CliError.d.ts +29 -8
- package/dist/unstable/cli/CliError.d.ts.map +1 -1
- package/dist/unstable/cli/CliError.js +8 -1
- package/dist/unstable/cli/CliError.js.map +1 -1
- package/dist/unstable/cli/CliOutput.d.ts +2 -2
- package/dist/unstable/cli/CliOutput.d.ts.map +1 -1
- package/dist/unstable/cli/CliOutput.js +2 -2
- package/dist/unstable/cli/CliOutput.js.map +1 -1
- package/dist/unstable/cli/Command.d.ts +14 -14
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +11 -10
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/Flag.d.ts +2 -3
- package/dist/unstable/cli/Flag.d.ts.map +1 -1
- package/dist/unstable/cli/Flag.js.map +1 -1
- package/dist/unstable/cli/GlobalFlag.d.ts +2 -2
- package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -1
- package/dist/unstable/cli/GlobalFlag.js +2 -2
- package/dist/unstable/cli/GlobalFlag.js.map +1 -1
- package/dist/unstable/cli/HelpDoc.d.ts +8 -8
- package/dist/unstable/cli/HelpDoc.d.ts.map +1 -1
- package/dist/unstable/cli/Param.d.ts +30 -2
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Param.js +17 -7
- package/dist/unstable/cli/Param.js.map +1 -1
- package/dist/unstable/cli/Prompt.js +8 -2
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cli/internal/command.d.ts +5 -5
- package/dist/unstable/cli/internal/command.d.ts.map +1 -1
- package/dist/unstable/cli/internal/command.js +3 -3
- package/dist/unstable/cli/internal/command.js.map +1 -1
- package/dist/unstable/cli/internal/parser.js +94 -15
- package/dist/unstable/cli/internal/parser.js.map +1 -1
- package/dist/unstable/cluster/ClusterError.d.ts +7 -7
- package/dist/unstable/cluster/ClusterSchema.d.ts +12 -9
- package/dist/unstable/cluster/ClusterSchema.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.js +9 -9
- package/dist/unstable/cluster/ClusterSchema.js.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts +1 -0
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +68 -40
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/Entity.d.ts +10 -10
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.js +25 -20
- package/dist/unstable/cluster/Entity.js.map +1 -1
- package/dist/unstable/cluster/EntityAddress.d.ts +2 -2
- package/dist/unstable/cluster/EntityProxy.js +3 -3
- package/dist/unstable/cluster/EntityProxy.js.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.js +4 -4
- package/dist/unstable/cluster/EntityProxyServer.js.map +1 -1
- package/dist/unstable/cluster/EntityResource.d.ts +2 -2
- package/dist/unstable/cluster/EntityResource.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityResource.js +2 -2
- package/dist/unstable/cluster/EntityResource.js.map +1 -1
- package/dist/unstable/cluster/Envelope.d.ts +3 -3
- package/dist/unstable/cluster/HttpRunner.js +2 -2
- package/dist/unstable/cluster/HttpRunner.js.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.d.ts +4 -4
- package/dist/unstable/cluster/K8sHttpClient.d.ts.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.js +2 -2
- package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
- package/dist/unstable/cluster/Message.d.ts +7 -4
- package/dist/unstable/cluster/Message.d.ts.map +1 -1
- package/dist/unstable/cluster/Message.js +5 -5
- package/dist/unstable/cluster/Message.js.map +1 -1
- package/dist/unstable/cluster/MessageStorage.d.ts +14 -14
- package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/MessageStorage.js +8 -8
- package/dist/unstable/cluster/MessageStorage.js.map +1 -1
- package/dist/unstable/cluster/Reply.d.ts +2 -2
- package/dist/unstable/cluster/Reply.d.ts.map +1 -1
- package/dist/unstable/cluster/Reply.js +5 -5
- package/dist/unstable/cluster/Reply.js.map +1 -1
- package/dist/unstable/cluster/Runner.d.ts +1 -1
- package/dist/unstable/cluster/RunnerAddress.d.ts +1 -1
- package/dist/unstable/cluster/RunnerHealth.d.ts +2 -2
- package/dist/unstable/cluster/RunnerHealth.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.js +2 -2
- package/dist/unstable/cluster/RunnerHealth.js.map +1 -1
- package/dist/unstable/cluster/RunnerServer.js +1 -1
- package/dist/unstable/cluster/RunnerServer.js.map +1 -1
- package/dist/unstable/cluster/RunnerStorage.d.ts +12 -12
- package/dist/unstable/cluster/RunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerStorage.js +3 -3
- package/dist/unstable/cluster/RunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/Runners.d.ts +3 -3
- package/dist/unstable/cluster/Runners.d.ts.map +1 -1
- package/dist/unstable/cluster/Runners.js +7 -7
- package/dist/unstable/cluster/Runners.js.map +1 -1
- package/dist/unstable/cluster/ShardId.d.ts +35 -49
- package/dist/unstable/cluster/ShardId.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardId.js +65 -67
- package/dist/unstable/cluster/ShardId.js.map +1 -1
- package/dist/unstable/cluster/Sharding.d.ts +2 -2
- package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
- package/dist/unstable/cluster/Sharding.js +21 -21
- package/dist/unstable/cluster/Sharding.js.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.d.ts +2 -2
- package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.js +5 -5
- package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
- package/dist/unstable/cluster/SingletonAddress.d.ts +2 -2
- package/dist/unstable/cluster/Snowflake.d.ts +2 -2
- package/dist/unstable/cluster/Snowflake.d.ts.map +1 -1
- package/dist/unstable/cluster/Snowflake.js +2 -2
- package/dist/unstable/cluster/Snowflake.js.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.js +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.js.map +1 -1
- package/dist/unstable/cluster/internal/entityManager.js +15 -14
- package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
- package/dist/unstable/cluster/internal/entityReaper.js +2 -2
- package/dist/unstable/cluster/internal/entityReaper.js.map +1 -1
- package/dist/unstable/cluster/internal/resourceMap.js +3 -3
- package/dist/unstable/cluster/internal/resourceMap.js.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.d.ts +2 -2
- package/dist/unstable/devtools/DevToolsClient.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.js +5 -5
- package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts +4 -4
- package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventJournal.js +2 -2
- package/dist/unstable/eventlog/EventJournal.js.map +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts +5 -5
- package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLog.js +18 -18
- package/dist/unstable/eventlog/EventLog.js.map +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.d.ts +2 -2
- package/dist/unstable/eventlog/EventLogEncryption.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.js +2 -2
- package/dist/unstable/eventlog/EventLogEncryption.js.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts +15 -12
- package/dist/unstable/eventlog/EventLogRemote.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.js +2 -2
- package/dist/unstable/eventlog/EventLogRemote.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.d.ts +3 -3
- package/dist/unstable/eventlog/EventLogServer.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.js +2 -2
- package/dist/unstable/eventlog/EventLogServer.js.map +1 -1
- package/dist/unstable/http/Etag.d.ts +2 -2
- package/dist/unstable/http/Etag.d.ts.map +1 -1
- package/dist/unstable/http/Etag.js +2 -2
- package/dist/unstable/http/Etag.js.map +1 -1
- package/dist/unstable/http/FetchHttpClient.d.ts +6 -3
- package/dist/unstable/http/FetchHttpClient.d.ts.map +1 -1
- package/dist/unstable/http/FetchHttpClient.js +5 -5
- package/dist/unstable/http/FetchHttpClient.js.map +1 -1
- package/dist/unstable/http/Headers.d.ts +5 -2
- package/dist/unstable/http/Headers.d.ts.map +1 -1
- package/dist/unstable/http/Headers.js +3 -3
- package/dist/unstable/http/Headers.js.map +1 -1
- package/dist/unstable/http/HttpClient.d.ts +8 -6
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.js +6 -6
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpClientError.d.ts +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts +2 -2
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +4 -4
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpEffect.d.ts +6 -6
- package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
- package/dist/unstable/http/HttpEffect.js +24 -24
- package/dist/unstable/http/HttpEffect.js.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.d.ts +2 -2
- package/dist/unstable/http/HttpIncomingMessage.d.ts.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.js +2 -2
- package/dist/unstable/http/HttpIncomingMessage.js.map +1 -1
- package/dist/unstable/http/HttpMiddleware.d.ts +3 -3
- package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
- package/dist/unstable/http/HttpMiddleware.js +26 -14
- package/dist/unstable/http/HttpMiddleware.js.map +1 -1
- package/dist/unstable/http/HttpPlatform.d.ts +2 -2
- package/dist/unstable/http/HttpPlatform.d.ts.map +1 -1
- package/dist/unstable/http/HttpPlatform.js +2 -2
- package/dist/unstable/http/HttpPlatform.js.map +1 -1
- package/dist/unstable/http/HttpRouter.d.ts +7 -7
- package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
- package/dist/unstable/http/HttpRouter.js +29 -29
- package/dist/unstable/http/HttpRouter.js.map +1 -1
- package/dist/unstable/http/HttpServer.d.ts +2 -2
- package/dist/unstable/http/HttpServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpServer.js +2 -2
- package/dist/unstable/http/HttpServer.js.map +1 -1
- package/dist/unstable/http/HttpServerError.d.ts +3 -3
- package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerError.js +3 -3
- package/dist/unstable/http/HttpServerError.js.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts +4 -4
- package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRequest.js +6 -6
- package/dist/unstable/http/HttpServerRequest.js.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts +2 -2
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +6 -6
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/Multipart.d.ts +6 -6
- package/dist/unstable/http/Multipart.d.ts.map +1 -1
- package/dist/unstable/http/Multipart.js +7 -7
- package/dist/unstable/http/Multipart.js.map +1 -1
- package/dist/unstable/httpapi/HttpApi.d.ts +9 -9
- package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApi.js +8 -8
- package/dist/unstable/httpapi/HttpApi.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts +0 -3
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +20 -20
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +7 -7
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.js +4 -4
- package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts +13 -13
- package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.d.ts +8 -8
- package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.js +4 -4
- package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +6 -6
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js +5 -5
- package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts +9 -6
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.js +6 -6
- package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
- package/dist/unstable/httpapi/OpenApi.d.ts +15 -15
- package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/OpenApi.js +23 -23
- package/dist/unstable/httpapi/OpenApi.js.map +1 -1
- package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.js +5 -5
- package/dist/unstable/observability/OtlpExporter.js.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.js +1 -1
- package/dist/unstable/observability/OtlpMetrics.js.map +1 -1
- package/dist/unstable/observability/OtlpSerialization.d.ts +2 -2
- package/dist/unstable/observability/OtlpSerialization.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpSerialization.js +2 -2
- package/dist/unstable/observability/OtlpSerialization.js.map +1 -1
- package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpTracer.js.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.d.ts +3 -3
- package/dist/unstable/observability/PrometheusMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.js +4 -33
- package/dist/unstable/observability/PrometheusMetrics.js.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.d.ts +23 -2
- package/dist/unstable/persistence/KeyValueStore.d.ts.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.js +144 -2
- package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
- package/dist/unstable/persistence/PersistedCache.d.ts +1 -2
- package/dist/unstable/persistence/PersistedCache.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedCache.js +10 -11
- package/dist/unstable/persistence/PersistedCache.js.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.d.ts +4 -4
- package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.js +3 -3
- package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
- package/dist/unstable/persistence/Persistence.d.ts +4 -4
- package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistence.js +3 -3
- package/dist/unstable/persistence/Persistence.js.map +1 -1
- package/dist/unstable/persistence/RateLimiter.d.ts +6 -6
- package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
- package/dist/unstable/persistence/RateLimiter.js +3 -3
- package/dist/unstable/persistence/RateLimiter.js.map +1 -1
- package/dist/unstable/persistence/Redis.d.ts +3 -3
- package/dist/unstable/persistence/Redis.d.ts.map +1 -1
- package/dist/unstable/persistence/Redis.js +2 -2
- package/dist/unstable/persistence/Redis.js.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.d.ts +45 -2
- package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.js +2 -2
- package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +36 -36
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +9 -9
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.d.ts +3 -3
- package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.js +2 -2
- package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.d.ts +2 -2
- package/dist/unstable/reactivity/AtomRegistry.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +3 -3
- package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.d.ts +3 -3
- package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.js +2 -2
- package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
- package/dist/unstable/reactivity/Reactivity.d.ts +2 -2
- package/dist/unstable/reactivity/Reactivity.d.ts.map +1 -1
- package/dist/unstable/reactivity/Reactivity.js +6 -6
- package/dist/unstable/reactivity/Reactivity.js.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +11 -11
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/Rpc.js +4 -4
- package/dist/unstable/rpc/Rpc.js.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts +18 -8
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js +27 -18
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/rpc/RpcClientError.d.ts +2 -2
- package/dist/unstable/rpc/RpcGroup.d.ts +7 -7
- package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcGroup.js +20 -20
- package/dist/unstable/rpc/RpcGroup.js.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.d.ts +6 -6
- package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.js +5 -5
- package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
- package/dist/unstable/rpc/RpcSchema.d.ts +3 -3
- package/dist/unstable/rpc/RpcSchema.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSchema.js +3 -3
- package/dist/unstable/rpc/RpcSchema.js.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.d.ts +2 -2
- package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.js +7 -7
- package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts +2 -2
- package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcServer.js +18 -18
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/rpc/RpcWorker.d.ts +2 -2
- package/dist/unstable/rpc/RpcWorker.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcWorker.js +4 -4
- package/dist/unstable/rpc/RpcWorker.js.map +1 -1
- package/dist/unstable/rpc/Utils.d.ts +0 -3
- package/dist/unstable/rpc/Utils.d.ts.map +1 -1
- package/dist/unstable/rpc/Utils.js +2 -5
- package/dist/unstable/rpc/Utils.js.map +1 -1
- package/dist/unstable/socket/Socket.d.ts +10 -10
- package/dist/unstable/socket/Socket.d.ts.map +1 -1
- package/dist/unstable/socket/Socket.js +9 -9
- package/dist/unstable/socket/Socket.js.map +1 -1
- package/dist/unstable/socket/SocketServer.d.ts +5 -2
- package/dist/unstable/socket/SocketServer.d.ts.map +1 -1
- package/dist/unstable/socket/SocketServer.js +2 -2
- package/dist/unstable/socket/SocketServer.js.map +1 -1
- package/dist/unstable/sql/SqlClient.d.ts +5 -5
- package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
- package/dist/unstable/sql/SqlClient.js +7 -7
- package/dist/unstable/sql/SqlClient.js.map +1 -1
- package/dist/unstable/sql/SqlConnection.d.ts +2 -2
- package/dist/unstable/sql/SqlConnection.d.ts.map +1 -1
- package/dist/unstable/sql/SqlConnection.js +5 -2
- package/dist/unstable/sql/SqlConnection.js.map +1 -1
- package/dist/unstable/sql/SqlError.d.ts +12 -12
- package/dist/unstable/sql/SqlModel.d.ts +8 -9
- package/dist/unstable/sql/SqlModel.d.ts.map +1 -1
- package/dist/unstable/sql/SqlModel.js +9 -35
- package/dist/unstable/sql/SqlModel.js.map +1 -1
- package/dist/unstable/sql/SqlResolver.js +11 -11
- package/dist/unstable/sql/SqlResolver.js.map +1 -1
- package/dist/unstable/sql/Statement.d.ts +2 -2
- package/dist/unstable/sql/Statement.d.ts.map +1 -1
- package/dist/unstable/sql/Statement.js +2 -2
- package/dist/unstable/sql/Statement.js.map +1 -1
- package/dist/unstable/workers/Transferable.d.ts +2 -2
- package/dist/unstable/workers/Transferable.d.ts.map +1 -1
- package/dist/unstable/workers/Transferable.js +6 -6
- package/dist/unstable/workers/Transferable.js.map +1 -1
- package/dist/unstable/workers/Worker.d.ts +3 -3
- package/dist/unstable/workers/Worker.d.ts.map +1 -1
- package/dist/unstable/workers/Worker.js +6 -3
- package/dist/unstable/workers/Worker.js.map +1 -1
- package/dist/unstable/workers/WorkerError.d.ts +5 -5
- package/dist/unstable/workers/WorkerRunner.d.ts +2 -2
- package/dist/unstable/workers/WorkerRunner.d.ts.map +1 -1
- package/dist/unstable/workers/WorkerRunner.js +5 -2
- package/dist/unstable/workers/WorkerRunner.js.map +1 -1
- package/dist/unstable/workflow/Activity.d.ts +7 -7
- package/dist/unstable/workflow/Activity.d.ts.map +1 -1
- package/dist/unstable/workflow/Activity.js +7 -7
- package/dist/unstable/workflow/Activity.js.map +1 -1
- package/dist/unstable/workflow/DurableClock.d.ts +0 -3
- package/dist/unstable/workflow/DurableClock.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableClock.js +3 -3
- package/dist/unstable/workflow/DurableClock.js.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.d.ts +1 -1
- package/dist/unstable/workflow/DurableDeferred.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.js +7 -7
- package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts +9 -9
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/dist/unstable/workflow/Workflow.js +18 -18
- package/dist/unstable/workflow/Workflow.js.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts +9 -3
- package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js +14 -5
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/dist/unstable/workflow/WorkflowProxyServer.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowProxyServer.js +4 -4
- package/dist/unstable/workflow/WorkflowProxyServer.js.map +1 -1
- package/package.json +1 -1
- package/src/Cache.ts +18 -46
- package/src/Cause.ts +21 -21
- package/src/Channel.ts +120 -79
- package/src/Clock.ts +2 -2
- package/src/Config.ts +2 -2
- package/src/ConfigProvider.ts +5 -5
- package/src/Console.ts +2 -2
- package/src/{ServiceMap.ts → Context.ts} +337 -340
- package/src/DateTime.ts +2 -2
- package/src/Effect.ts +182 -184
- package/src/ErrorReporter.ts +3 -3
- package/src/ExecutionPlan.ts +8 -9
- package/src/Fiber.ts +7 -7
- package/src/FiberHandle.ts +5 -5
- package/src/FiberMap.ts +5 -5
- package/src/FiberSet.ts +5 -5
- package/src/FileSystem.ts +3 -3
- package/src/Layer.ts +358 -305
- package/src/LayerMap.ts +27 -26
- package/src/Logger.ts +3 -3
- package/src/ManagedRuntime.ts +32 -32
- package/src/Metric.ts +58 -58
- package/src/Path.ts +2 -2
- package/src/Pool.ts +5 -5
- package/src/PubSub.ts +3 -3
- package/src/Random.ts +2 -2
- package/src/RcMap.ts +14 -14
- package/src/Redactable.ts +146 -72
- package/src/References.ts +14 -14
- package/src/Request.ts +5 -5
- package/src/RequestResolver.ts +6 -7
- package/src/Resource.ts +4 -4
- package/src/Schedule.ts +2 -2
- package/src/Scheduler.ts +4 -4
- package/src/Schema.ts +837 -397
- package/src/SchemaAST.ts +5 -14
- package/src/SchemaGetter.ts +69 -11
- package/src/SchemaTransformation.ts +166 -0
- package/src/Scope.ts +2 -2
- package/src/ScopedCache.ts +5 -5
- package/src/Sink.ts +9 -9
- package/src/Stdio.ts +2 -2
- package/src/Stream.ts +234 -158
- package/src/Terminal.ts +3 -3
- package/src/Tracer.ts +17 -17
- package/src/Unify.ts +26 -2
- package/src/index.ts +82 -16
- package/src/internal/core.ts +7 -7
- package/src/internal/effect.ts +106 -106
- package/src/internal/layer.ts +7 -7
- package/src/internal/random.ts +2 -2
- package/src/internal/rcRef.ts +10 -10
- package/src/internal/references.ts +13 -13
- package/src/internal/request.ts +8 -8
- package/src/internal/schedule.ts +3 -1
- package/src/internal/schema/representation.ts +8 -1
- package/src/internal/schema/schema.ts +24 -1
- package/src/testing/TestSchema.ts +3 -3
- package/src/unstable/ai/AiError.ts +3 -2
- package/src/unstable/ai/AnthropicStructuredOutput.ts +3 -3
- package/src/unstable/ai/Chat.ts +3 -3
- package/src/unstable/ai/EmbeddingModel.ts +3 -3
- package/src/unstable/ai/IdGenerator.ts +2 -2
- package/src/unstable/ai/LanguageModel.ts +2 -2
- package/src/unstable/ai/McpSchema.ts +11 -9
- package/src/unstable/ai/McpServer.ts +44 -44
- package/src/unstable/ai/Model.ts +8 -8
- package/src/unstable/ai/OpenAiStructuredOutput.ts +2 -2
- package/src/unstable/ai/Prompt.ts +6 -12
- package/src/unstable/ai/Response.ts +6 -8
- package/src/unstable/ai/ResponseIdTracker.ts +2 -4
- package/src/unstable/ai/Telemetry.ts +2 -2
- package/src/unstable/ai/Tokenizer.ts +2 -2
- package/src/unstable/ai/Tool.ts +25 -25
- package/src/unstable/ai/Toolkit.ts +12 -12
- package/src/unstable/ai/internal/codec-transformer.ts +3 -2
- package/src/unstable/cli/Argument.ts +3 -4
- package/src/unstable/cli/CliError.ts +22 -9
- package/src/unstable/cli/CliOutput.ts +2 -2
- package/src/unstable/cli/Command.ts +36 -30
- package/src/unstable/cli/Flag.ts +3 -4
- package/src/unstable/cli/GlobalFlag.ts +3 -3
- package/src/unstable/cli/HelpDoc.ts +8 -8
- package/src/unstable/cli/Param.ts +39 -16
- package/src/unstable/cli/Prompt.ts +13 -6
- package/src/unstable/cli/internal/command.ts +7 -7
- package/src/unstable/cli/internal/parser.ts +130 -21
- package/src/unstable/cluster/ClusterSchema.ts +12 -12
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +91 -53
- package/src/unstable/cluster/Entity.ts +43 -32
- package/src/unstable/cluster/EntityProxy.ts +3 -3
- package/src/unstable/cluster/EntityProxyServer.ts +4 -4
- package/src/unstable/cluster/EntityResource.ts +2 -2
- package/src/unstable/cluster/HttpRunner.ts +2 -2
- package/src/unstable/cluster/K8sHttpClient.ts +2 -2
- package/src/unstable/cluster/Message.ts +8 -8
- package/src/unstable/cluster/MessageStorage.ts +11 -11
- package/src/unstable/cluster/Reply.ts +7 -7
- package/src/unstable/cluster/RunnerHealth.ts +2 -2
- package/src/unstable/cluster/RunnerServer.ts +1 -1
- package/src/unstable/cluster/RunnerStorage.ts +9 -9
- package/src/unstable/cluster/Runners.ts +7 -7
- package/src/unstable/cluster/ShardId.ts +84 -74
- package/src/unstable/cluster/Sharding.ts +26 -26
- package/src/unstable/cluster/ShardingConfig.ts +5 -5
- package/src/unstable/cluster/Snowflake.ts +2 -2
- package/src/unstable/cluster/SqlMessageStorage.ts +1 -1
- package/src/unstable/cluster/internal/entityManager.ts +27 -23
- package/src/unstable/cluster/internal/entityReaper.ts +2 -2
- package/src/unstable/cluster/internal/resourceMap.ts +3 -3
- package/src/unstable/devtools/DevToolsClient.ts +5 -5
- package/src/unstable/eventlog/EventJournal.ts +2 -2
- package/src/unstable/eventlog/EventLog.ts +21 -21
- package/src/unstable/eventlog/EventLogEncryption.ts +2 -2
- package/src/unstable/eventlog/EventLogRemote.ts +2 -2
- package/src/unstable/eventlog/EventLogServer.ts +2 -2
- package/src/unstable/http/Etag.ts +2 -2
- package/src/unstable/http/FetchHttpClient.ts +5 -5
- package/src/unstable/http/Headers.ts +4 -4
- package/src/unstable/http/HttpClient.ts +9 -8
- package/src/unstable/http/HttpClientRequest.ts +5 -5
- package/src/unstable/http/HttpEffect.ts +35 -35
- package/src/unstable/http/HttpIncomingMessage.ts +2 -2
- package/src/unstable/http/HttpMiddleware.ts +28 -14
- package/src/unstable/http/HttpPlatform.ts +2 -2
- package/src/unstable/http/HttpRouter.ts +37 -37
- package/src/unstable/http/HttpServer.ts +2 -2
- package/src/unstable/http/HttpServerError.ts +4 -4
- package/src/unstable/http/HttpServerRequest.ts +7 -7
- package/src/unstable/http/HttpServerResponse.ts +8 -8
- package/src/unstable/http/Multipart.ts +8 -8
- package/src/unstable/httpapi/HttpApi.ts +18 -18
- package/src/unstable/httpapi/HttpApiBuilder.ts +20 -20
- package/src/unstable/httpapi/HttpApiClient.ts +4 -4
- package/src/unstable/httpapi/HttpApiEndpoint.ts +14 -14
- package/src/unstable/httpapi/HttpApiGroup.ts +16 -16
- package/src/unstable/httpapi/HttpApiMiddleware.ts +14 -14
- package/src/unstable/httpapi/HttpApiSecurity.ts +13 -13
- package/src/unstable/httpapi/OpenApi.ts +29 -31
- package/src/unstable/observability/OtlpExporter.ts +5 -5
- package/src/unstable/observability/OtlpMetrics.ts +1 -1
- package/src/unstable/observability/OtlpSerialization.ts +2 -2
- package/src/unstable/observability/OtlpTracer.ts +2 -2
- package/src/unstable/observability/PrometheusMetrics.ts +5 -5
- package/src/unstable/persistence/KeyValueStore.ts +226 -3
- package/src/unstable/persistence/PersistedCache.ts +20 -17
- package/src/unstable/persistence/PersistedQueue.ts +3 -3
- package/src/unstable/persistence/Persistence.ts +4 -4
- package/src/unstable/persistence/RateLimiter.ts +3 -3
- package/src/unstable/persistence/Redis.ts +2 -2
- package/src/unstable/process/ChildProcessSpawner.ts +46 -2
- package/src/unstable/reactivity/Atom.ts +79 -79
- package/src/unstable/reactivity/AtomHttpApi.ts +4 -4
- package/src/unstable/reactivity/AtomRegistry.ts +4 -4
- package/src/unstable/reactivity/AtomRpc.ts +4 -4
- package/src/unstable/reactivity/Reactivity.ts +6 -6
- package/src/unstable/rpc/Rpc.ts +17 -17
- package/src/unstable/rpc/RpcClient.ts +44 -30
- package/src/unstable/rpc/RpcGroup.ts +30 -30
- package/src/unstable/rpc/RpcMiddleware.ts +14 -14
- package/src/unstable/rpc/RpcSchema.ts +4 -4
- package/src/unstable/rpc/RpcSerialization.ts +7 -7
- package/src/unstable/rpc/RpcServer.ts +19 -19
- package/src/unstable/rpc/RpcWorker.ts +5 -5
- package/src/unstable/rpc/Utils.ts +4 -4
- package/src/unstable/socket/Socket.ts +9 -9
- package/src/unstable/socket/SocketServer.ts +2 -2
- package/src/unstable/sql/SqlClient.ts +11 -11
- package/src/unstable/sql/SqlConnection.ts +2 -2
- package/src/unstable/sql/SqlModel.ts +54 -82
- package/src/unstable/sql/SqlResolver.ts +11 -11
- package/src/unstable/sql/Statement.ts +2 -2
- package/src/unstable/workers/Transferable.ts +6 -6
- package/src/unstable/workers/Worker.ts +4 -4
- package/src/unstable/workers/WorkerRunner.ts +2 -2
- package/src/unstable/workflow/Activity.ts +14 -14
- package/src/unstable/workflow/DurableClock.ts +3 -3
- package/src/unstable/workflow/DurableDeferred.ts +8 -8
- package/src/unstable/workflow/Workflow.ts +23 -23
- package/src/unstable/workflow/WorkflowEngine.ts +28 -6
- package/src/unstable/workflow/WorkflowProxyServer.ts +4 -4
- package/dist/ServiceMap.d.ts +0 -1150
- package/dist/ServiceMap.d.ts.map +0 -1
- package/dist/ServiceMap.js.map +0 -1
package/src/Stream.ts
CHANGED
|
@@ -6,6 +6,7 @@ import * as Arr from "./Array.ts"
|
|
|
6
6
|
import * as Cause from "./Cause.ts"
|
|
7
7
|
import * as Channel from "./Channel.ts"
|
|
8
8
|
import { Clock } from "./Clock.ts"
|
|
9
|
+
import * as Context from "./Context.ts"
|
|
9
10
|
import * as Duration from "./Duration.ts"
|
|
10
11
|
import * as Effect from "./Effect.ts"
|
|
11
12
|
import * as Equal from "./Equal.ts"
|
|
@@ -37,7 +38,6 @@ import * as RcRef from "./RcRef.ts"
|
|
|
37
38
|
import * as Result from "./Result.ts"
|
|
38
39
|
import * as Schedule from "./Schedule.ts"
|
|
39
40
|
import * as Scope from "./Scope.ts"
|
|
40
|
-
import * as ServiceMap from "./ServiceMap.ts"
|
|
41
41
|
import * as Sink from "./Sink.ts"
|
|
42
42
|
import { isString } from "./String.ts"
|
|
43
43
|
import type * as Take from "./Take.ts"
|
|
@@ -354,6 +354,79 @@ export const fromChannel: <Arr extends Arr.NonEmptyReadonlyArray<any>, E, R>(
|
|
|
354
354
|
export const fromEffect = <A, E, R>(effect: Effect.Effect<A, E, R>): Stream<A, E, R> =>
|
|
355
355
|
fromChannel(Channel.fromEffect(Effect.map(effect, Arr.of)))
|
|
356
356
|
|
|
357
|
+
/**
|
|
358
|
+
* Accesses a service from the context and emits it as a single element.
|
|
359
|
+
*
|
|
360
|
+
* @example
|
|
361
|
+
* ```ts
|
|
362
|
+
* import { Effect, Context, Stream } from "effect"
|
|
363
|
+
*
|
|
364
|
+
* class Greeter extends Context.Service<Greeter, {
|
|
365
|
+
* readonly greet: (name: string) => string
|
|
366
|
+
* }>()("Greeter") {}
|
|
367
|
+
*
|
|
368
|
+
* const stream = Stream.service(Greeter).pipe(
|
|
369
|
+
* Stream.map((greeter) => greeter.greet("World"))
|
|
370
|
+
* )
|
|
371
|
+
*
|
|
372
|
+
* const program = Effect.gen(function*() {
|
|
373
|
+
* return yield* stream.pipe(
|
|
374
|
+
* Stream.provideService(Greeter, {
|
|
375
|
+
* greet: (name) => `Hello, ${name}!`
|
|
376
|
+
* }),
|
|
377
|
+
* Stream.runCollect
|
|
378
|
+
* )
|
|
379
|
+
* })
|
|
380
|
+
*
|
|
381
|
+
* Effect.runPromise(program)
|
|
382
|
+
* // Output: [ "Hello, World!" ]
|
|
383
|
+
* ```
|
|
384
|
+
*
|
|
385
|
+
* @since 4.0.0
|
|
386
|
+
* @category Context
|
|
387
|
+
*/
|
|
388
|
+
export const service = <I, S>(service: Context.Key<I, S>): Stream<S, never, I> => fromEffect(Effect.service(service))
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Optionally accesses a service from the context and emits the result as a
|
|
392
|
+
* single element.
|
|
393
|
+
*
|
|
394
|
+
* @example
|
|
395
|
+
* ```ts
|
|
396
|
+
* import { Effect, Option, Context, Stream } from "effect"
|
|
397
|
+
*
|
|
398
|
+
* class Greeter extends Context.Service<Greeter, {
|
|
399
|
+
* readonly greet: (name: string) => string
|
|
400
|
+
* }>()("Greeter") {}
|
|
401
|
+
*
|
|
402
|
+
* const stream = Stream.serviceOption(Greeter).pipe(
|
|
403
|
+
* Stream.map((maybeGreeter) =>
|
|
404
|
+
* Option.match(maybeGreeter, {
|
|
405
|
+
* onNone: () => "No greeter",
|
|
406
|
+
* onSome: (greeter) => greeter.greet("World")
|
|
407
|
+
* })
|
|
408
|
+
* )
|
|
409
|
+
* )
|
|
410
|
+
*
|
|
411
|
+
* const program = Effect.gen(function*() {
|
|
412
|
+
* return yield* stream.pipe(
|
|
413
|
+
* Stream.provideService(Greeter, {
|
|
414
|
+
* greet: (name) => `Hello, ${name}!`
|
|
415
|
+
* }),
|
|
416
|
+
* Stream.runCollect
|
|
417
|
+
* )
|
|
418
|
+
* })
|
|
419
|
+
*
|
|
420
|
+
* Effect.runPromise(program)
|
|
421
|
+
* // Output: [ "Hello, World!" ]
|
|
422
|
+
* ```
|
|
423
|
+
*
|
|
424
|
+
* @since 4.0.0
|
|
425
|
+
* @category Context
|
|
426
|
+
*/
|
|
427
|
+
export const serviceOption = <I, S>(service: Context.Key<I, S>): Stream<Option.Option<S>> =>
|
|
428
|
+
fromEffect(Effect.serviceOption(service))
|
|
429
|
+
|
|
357
430
|
/**
|
|
358
431
|
* Creates a stream that runs the effect and emits no elements.
|
|
359
432
|
*
|
|
@@ -1011,9 +1084,9 @@ export const fromIterable = <A>(
|
|
|
1011
1084
|
*
|
|
1012
1085
|
* @example
|
|
1013
1086
|
* ```ts
|
|
1014
|
-
* import { Console, Effect,
|
|
1087
|
+
* import { Console, Effect, Context, Stream } from "effect"
|
|
1015
1088
|
*
|
|
1016
|
-
* class UserRepo extends
|
|
1089
|
+
* class UserRepo extends Context.Service<UserRepo, {
|
|
1017
1090
|
* readonly list: Effect.Effect<ReadonlyArray<string>>
|
|
1018
1091
|
* }>()("UserRepo") {}
|
|
1019
1092
|
*
|
|
@@ -9083,9 +9156,9 @@ export const retry: {
|
|
|
9083
9156
|
*
|
|
9084
9157
|
* @example
|
|
9085
9158
|
* ```ts
|
|
9086
|
-
* import { Console, Effect, ExecutionPlan, Layer,
|
|
9159
|
+
* import { Console, Effect, ExecutionPlan, Layer, Context, Stream } from "effect"
|
|
9087
9160
|
*
|
|
9088
|
-
* class Service extends
|
|
9161
|
+
* class Service extends Context.Service<Service>()("Service", {
|
|
9089
9162
|
* make: Effect.succeed({
|
|
9090
9163
|
* stream: Stream.fail("A") as Stream.Stream<number, string>
|
|
9091
9164
|
* })
|
|
@@ -9125,9 +9198,9 @@ export const withExecutionPlan: {
|
|
|
9125
9198
|
*
|
|
9126
9199
|
* @example
|
|
9127
9200
|
* ```ts
|
|
9128
|
-
* import { Console, Effect, ExecutionPlan, Layer,
|
|
9201
|
+
* import { Console, Effect, ExecutionPlan, Layer, Context, Stream } from "effect"
|
|
9129
9202
|
*
|
|
9130
|
-
* class Service extends
|
|
9203
|
+
* class Service extends Context.Service<Service>()("Service", {
|
|
9131
9204
|
* make: Effect.succeed({
|
|
9132
9205
|
* stream: Stream.fail("A") as Stream.Stream<number, string>
|
|
9133
9206
|
* })
|
|
@@ -9170,9 +9243,9 @@ export const withExecutionPlan: {
|
|
|
9170
9243
|
*
|
|
9171
9244
|
* @example
|
|
9172
9245
|
* ```ts
|
|
9173
|
-
* import { Console, Effect, ExecutionPlan, Layer,
|
|
9246
|
+
* import { Console, Effect, ExecutionPlan, Layer, Context, Stream } from "effect"
|
|
9174
9247
|
*
|
|
9175
|
-
* class Service extends
|
|
9248
|
+
* class Service extends Context.Service<Service>()("Service", {
|
|
9176
9249
|
* make: Effect.succeed({
|
|
9177
9250
|
* stream: Stream.fail("A") as Stream.Stream<number, string>
|
|
9178
9251
|
* })
|
|
@@ -9245,9 +9318,9 @@ export const withExecutionPlan: {
|
|
|
9245
9318
|
*
|
|
9246
9319
|
* @example
|
|
9247
9320
|
* ```ts
|
|
9248
|
-
* import { Console, Effect, ExecutionPlan, Layer,
|
|
9321
|
+
* import { Console, Effect, ExecutionPlan, Layer, Context, Stream } from "effect"
|
|
9249
9322
|
*
|
|
9250
|
-
* class Service extends
|
|
9323
|
+
* class Service extends Context.Service<Service>()("Service", {
|
|
9251
9324
|
* make: Effect.succeed({
|
|
9252
9325
|
* stream: Stream.fail("A") as Stream.Stream<number, string>
|
|
9253
9326
|
* })
|
|
@@ -13664,11 +13737,9 @@ export const aggregateWithin: {
|
|
|
13664
13737
|
})
|
|
13665
13738
|
|
|
13666
13739
|
// upstream -> buffer
|
|
13667
|
-
let hadChunk = false
|
|
13668
13740
|
yield* pull.pipe(
|
|
13669
13741
|
pullLatch.whenOpen,
|
|
13670
13742
|
Effect.flatMap((arr) => {
|
|
13671
|
-
hadChunk = true
|
|
13672
13743
|
pullLatch.closeUnsafe()
|
|
13673
13744
|
return Queue.offer(buffer, arr)
|
|
13674
13745
|
}),
|
|
@@ -13706,10 +13777,11 @@ export const aggregateWithin: {
|
|
|
13706
13777
|
*/
|
|
13707
13778
|
B>()
|
|
13708
13779
|
let leftover: Arr.NonEmptyReadonlyArray<A2> | undefined
|
|
13780
|
+
let sinkHasInput = false
|
|
13709
13781
|
const step = yield* Schedule.toStepWithSleep(schedule)
|
|
13710
13782
|
const stepToBuffer = Effect.suspend(function loop(): Pull.Pull<never, E3, void, R3> {
|
|
13711
13783
|
return step(lastOutput).pipe(
|
|
13712
|
-
Effect.flatMap(() => !
|
|
13784
|
+
Effect.flatMap(() => !sinkHasInput ? loop() : Queue.offer(buffer, scheduleStep)),
|
|
13713
13785
|
Effect.flatMap(() => Effect.never),
|
|
13714
13786
|
Pull.catchDone(() => Cause.done())
|
|
13715
13787
|
)
|
|
@@ -13720,22 +13792,28 @@ export const aggregateWithin: {
|
|
|
13720
13792
|
Arr.NonEmptyReadonlyArray<A>,
|
|
13721
13793
|
E
|
|
13722
13794
|
> = Queue.take(buffer).pipe(
|
|
13723
|
-
Effect.flatMap((arr) =>
|
|
13795
|
+
Effect.flatMap((arr) => {
|
|
13796
|
+
if (arr === scheduleStep) {
|
|
13797
|
+
return Cause.done()
|
|
13798
|
+
}
|
|
13799
|
+
sinkHasInput = true
|
|
13800
|
+
return Effect.succeed(arr)
|
|
13801
|
+
})
|
|
13724
13802
|
)
|
|
13725
13803
|
|
|
13726
13804
|
const sinkUpstream = Effect.suspend((): Pull.Pull<Arr.NonEmptyReadonlyArray<A | A2>, E> => {
|
|
13727
13805
|
if (leftover !== undefined) {
|
|
13728
13806
|
const chunk = leftover
|
|
13729
13807
|
leftover = undefined
|
|
13808
|
+
sinkHasInput = true
|
|
13730
13809
|
return Effect.succeed(chunk)
|
|
13731
13810
|
}
|
|
13732
|
-
hadChunk = false
|
|
13733
13811
|
pullLatch.openUnsafe()
|
|
13734
13812
|
return pullFromBuffer
|
|
13735
13813
|
})
|
|
13736
13814
|
const catchSinkHalt = Effect.flatMap(([value, leftover_]: Sink.End<B, A2>) => {
|
|
13737
13815
|
// ignore the last output if the upstream only pulled a halt
|
|
13738
|
-
if (!
|
|
13816
|
+
if (!sinkHasInput && buffer.state._tag === "Done") return Cause.done()
|
|
13739
13817
|
lastOutput = Option.some(value)
|
|
13740
13818
|
leftover = leftover_
|
|
13741
13819
|
return Effect.succeed(Arr.of(value))
|
|
@@ -13743,9 +13821,10 @@ export const aggregateWithin: {
|
|
|
13743
13821
|
|
|
13744
13822
|
return Effect.suspend(() => {
|
|
13745
13823
|
// if the buffer has exited and there is no more data to process
|
|
13746
|
-
if (buffer.state._tag === "Done") {
|
|
13824
|
+
if (buffer.state._tag === "Done" && leftover === undefined) {
|
|
13747
13825
|
return buffer.state.exit as Exit.Exit<never, Cause.Done<void> | E>
|
|
13748
13826
|
}
|
|
13827
|
+
sinkHasInput = leftover !== undefined
|
|
13749
13828
|
return Effect.succeed(Effect.suspend(() => sink.transform(sinkUpstream as any, scope)))
|
|
13750
13829
|
}).pipe(
|
|
13751
13830
|
Effect.flatMap((pull) => Effect.raceFirst(catchSinkHalt(pull), stepToBuffer))
|
|
@@ -15876,7 +15955,7 @@ export const ensuring: {
|
|
|
15876
15955
|
)
|
|
15877
15956
|
|
|
15878
15957
|
/**
|
|
15879
|
-
* Provides a layer or
|
|
15958
|
+
* Provides a layer or context to the stream, removing the corresponding
|
|
15880
15959
|
* service requirements. Use `options.local` to build the layer every time; by
|
|
15881
15960
|
* default, layers are shared between provide calls.
|
|
15882
15961
|
*
|
|
@@ -15884,9 +15963,9 @@ export const ensuring: {
|
|
|
15884
15963
|
*
|
|
15885
15964
|
* @example
|
|
15886
15965
|
* ```ts
|
|
15887
|
-
* import { Console, Effect, Layer,
|
|
15966
|
+
* import { Console, Effect, Layer, Context, Stream } from "effect"
|
|
15888
15967
|
*
|
|
15889
|
-
* class Env extends
|
|
15968
|
+
* class Env extends Context.Service<Env, { readonly name: string }>()("Env") {}
|
|
15890
15969
|
*
|
|
15891
15970
|
* const layer = Layer.succeed(Env)({ name: "Ada" })
|
|
15892
15971
|
*
|
|
@@ -15913,7 +15992,7 @@ export const ensuring: {
|
|
|
15913
15992
|
*/
|
|
15914
15993
|
export const provide: {
|
|
15915
15994
|
/**
|
|
15916
|
-
* Provides a layer or
|
|
15995
|
+
* Provides a layer or context to the stream, removing the corresponding
|
|
15917
15996
|
* service requirements. Use `options.local` to build the layer every time; by
|
|
15918
15997
|
* default, layers are shared between provide calls.
|
|
15919
15998
|
*
|
|
@@ -15921,9 +16000,9 @@ export const provide: {
|
|
|
15921
16000
|
*
|
|
15922
16001
|
* @example
|
|
15923
16002
|
* ```ts
|
|
15924
|
-
* import { Console, Effect, Layer,
|
|
16003
|
+
* import { Console, Effect, Layer, Context, Stream } from "effect"
|
|
15925
16004
|
*
|
|
15926
|
-
* class Env extends
|
|
16005
|
+
* class Env extends Context.Service<Env, { readonly name: string }>()("Env") {}
|
|
15927
16006
|
*
|
|
15928
16007
|
* const layer = Layer.succeed(Env)({ name: "Ada" })
|
|
15929
16008
|
*
|
|
@@ -15949,7 +16028,7 @@ export const provide: {
|
|
|
15949
16028
|
* @category Services
|
|
15950
16029
|
*/
|
|
15951
16030
|
<AL, EL = never, RL = never>(
|
|
15952
|
-
layer: Layer.Layer<AL, EL, RL> |
|
|
16031
|
+
layer: Layer.Layer<AL, EL, RL> | Context.Context<AL>,
|
|
15953
16032
|
options?: {
|
|
15954
16033
|
readonly local?: boolean | undefined
|
|
15955
16034
|
} | undefined
|
|
@@ -15957,7 +16036,7 @@ export const provide: {
|
|
|
15957
16036
|
self: Stream<A, E, R>
|
|
15958
16037
|
) => Stream<A, E | EL, Exclude<R, AL> | RL>
|
|
15959
16038
|
/**
|
|
15960
|
-
* Provides a layer or
|
|
16039
|
+
* Provides a layer or context to the stream, removing the corresponding
|
|
15961
16040
|
* service requirements. Use `options.local` to build the layer every time; by
|
|
15962
16041
|
* default, layers are shared between provide calls.
|
|
15963
16042
|
*
|
|
@@ -15965,9 +16044,9 @@ export const provide: {
|
|
|
15965
16044
|
*
|
|
15966
16045
|
* @example
|
|
15967
16046
|
* ```ts
|
|
15968
|
-
* import { Console, Effect, Layer,
|
|
16047
|
+
* import { Console, Effect, Layer, Context, Stream } from "effect"
|
|
15969
16048
|
*
|
|
15970
|
-
* class Env extends
|
|
16049
|
+
* class Env extends Context.Service<Env, { readonly name: string }>()("Env") {}
|
|
15971
16050
|
*
|
|
15972
16051
|
* const layer = Layer.succeed(Env)({ name: "Ada" })
|
|
15973
16052
|
*
|
|
@@ -15994,31 +16073,31 @@ export const provide: {
|
|
|
15994
16073
|
*/
|
|
15995
16074
|
<A, E, R, AL, EL = never, RL = never>(
|
|
15996
16075
|
self: Stream<A, E, R>,
|
|
15997
|
-
layer: Layer.Layer<AL, EL, RL> |
|
|
16076
|
+
layer: Layer.Layer<AL, EL, RL> | Context.Context<AL>,
|
|
15998
16077
|
options?: {
|
|
15999
16078
|
readonly local?: boolean | undefined
|
|
16000
16079
|
} | undefined
|
|
16001
16080
|
): Stream<A, E | EL, Exclude<R, AL> | RL>
|
|
16002
16081
|
} = dual((args) => isStream(args[0]), <A, E, R, AL, EL = never, RL = never>(
|
|
16003
16082
|
self: Stream<A, E, R>,
|
|
16004
|
-
layer: Layer.Layer<AL, EL, RL> |
|
|
16083
|
+
layer: Layer.Layer<AL, EL, RL> | Context.Context<AL>,
|
|
16005
16084
|
options?: {
|
|
16006
16085
|
readonly local?: boolean | undefined
|
|
16007
16086
|
} | undefined
|
|
16008
16087
|
): Stream<A, E | EL, Exclude<R, AL> | RL> => fromChannel(Channel.provide(self.channel, layer, options)))
|
|
16009
16088
|
|
|
16010
16089
|
/**
|
|
16011
|
-
* Provides multiple services to the stream using a
|
|
16090
|
+
* Provides multiple services to the stream using a context.
|
|
16012
16091
|
*
|
|
16013
16092
|
* @example
|
|
16014
16093
|
* ```ts
|
|
16015
|
-
* import { Console, Effect,
|
|
16094
|
+
* import { Console, Effect, Context, Stream } from "effect"
|
|
16016
16095
|
*
|
|
16017
|
-
* class Config extends
|
|
16018
|
-
* class Greeter extends
|
|
16096
|
+
* class Config extends Context.Service<Config, { readonly prefix: string }>()("Config") {}
|
|
16097
|
+
* class Greeter extends Context.Service<Greeter, { greet: (name: string) => string }>()("Greeter") {}
|
|
16019
16098
|
*
|
|
16020
|
-
* const
|
|
16021
|
-
*
|
|
16099
|
+
* const context = Context.make(Config, { prefix: "Hello" }).pipe(
|
|
16100
|
+
* Context.add(Greeter, { greet: (name: string) => `${name}!` })
|
|
16022
16101
|
* )
|
|
16023
16102
|
*
|
|
16024
16103
|
* const stream = Stream.fromEffect(
|
|
@@ -16030,7 +16109,7 @@ export const provide: {
|
|
|
16030
16109
|
* )
|
|
16031
16110
|
*
|
|
16032
16111
|
* const program = Effect.gen(function*() {
|
|
16033
|
-
* const result = yield* Stream.runCollect(Stream.
|
|
16112
|
+
* const result = yield* Stream.runCollect(Stream.provideContext(stream, context))
|
|
16034
16113
|
* yield* Console.log(result)
|
|
16035
16114
|
* })
|
|
16036
16115
|
*
|
|
@@ -16041,19 +16120,19 @@ export const provide: {
|
|
|
16041
16120
|
* @since 4.0.0
|
|
16042
16121
|
* @category Services
|
|
16043
16122
|
*/
|
|
16044
|
-
export const
|
|
16123
|
+
export const provideContext: {
|
|
16045
16124
|
/**
|
|
16046
|
-
* Provides multiple services to the stream using a
|
|
16125
|
+
* Provides multiple services to the stream using a context.
|
|
16047
16126
|
*
|
|
16048
16127
|
* @example
|
|
16049
16128
|
* ```ts
|
|
16050
|
-
* import { Console, Effect,
|
|
16129
|
+
* import { Console, Effect, Context, Stream } from "effect"
|
|
16051
16130
|
*
|
|
16052
|
-
* class Config extends
|
|
16053
|
-
* class Greeter extends
|
|
16131
|
+
* class Config extends Context.Service<Config, { readonly prefix: string }>()("Config") {}
|
|
16132
|
+
* class Greeter extends Context.Service<Greeter, { greet: (name: string) => string }>()("Greeter") {}
|
|
16054
16133
|
*
|
|
16055
|
-
* const
|
|
16056
|
-
*
|
|
16134
|
+
* const context = Context.make(Config, { prefix: "Hello" }).pipe(
|
|
16135
|
+
* Context.add(Greeter, { greet: (name: string) => `${name}!` })
|
|
16057
16136
|
* )
|
|
16058
16137
|
*
|
|
16059
16138
|
* const stream = Stream.fromEffect(
|
|
@@ -16065,7 +16144,7 @@ export const provideServices: {
|
|
|
16065
16144
|
* )
|
|
16066
16145
|
*
|
|
16067
16146
|
* const program = Effect.gen(function*() {
|
|
16068
|
-
* const result = yield* Stream.runCollect(Stream.
|
|
16147
|
+
* const result = yield* Stream.runCollect(Stream.provideContext(stream, context))
|
|
16069
16148
|
* yield* Console.log(result)
|
|
16070
16149
|
* })
|
|
16071
16150
|
*
|
|
@@ -16076,19 +16155,19 @@ export const provideServices: {
|
|
|
16076
16155
|
* @since 4.0.0
|
|
16077
16156
|
* @category Services
|
|
16078
16157
|
*/
|
|
16079
|
-
<R2>(
|
|
16158
|
+
<R2>(context: Context.Context<R2>): <A, E, R>(self: Stream<A, E, R>) => Stream<A, E, Exclude<R, R2>>
|
|
16080
16159
|
/**
|
|
16081
|
-
* Provides multiple services to the stream using a
|
|
16160
|
+
* Provides multiple services to the stream using a context.
|
|
16082
16161
|
*
|
|
16083
16162
|
* @example
|
|
16084
16163
|
* ```ts
|
|
16085
|
-
* import { Console, Effect,
|
|
16164
|
+
* import { Console, Effect, Context, Stream } from "effect"
|
|
16086
16165
|
*
|
|
16087
|
-
* class Config extends
|
|
16088
|
-
* class Greeter extends
|
|
16166
|
+
* class Config extends Context.Service<Config, { readonly prefix: string }>()("Config") {}
|
|
16167
|
+
* class Greeter extends Context.Service<Greeter, { greet: (name: string) => string }>()("Greeter") {}
|
|
16089
16168
|
*
|
|
16090
|
-
* const
|
|
16091
|
-
*
|
|
16169
|
+
* const context = Context.make(Config, { prefix: "Hello" }).pipe(
|
|
16170
|
+
* Context.add(Greeter, { greet: (name: string) => `${name}!` })
|
|
16092
16171
|
* )
|
|
16093
16172
|
*
|
|
16094
16173
|
* const stream = Stream.fromEffect(
|
|
@@ -16100,7 +16179,7 @@ export const provideServices: {
|
|
|
16100
16179
|
* )
|
|
16101
16180
|
*
|
|
16102
16181
|
* const program = Effect.gen(function*() {
|
|
16103
|
-
* const result = yield* Stream.runCollect(Stream.
|
|
16182
|
+
* const result = yield* Stream.runCollect(Stream.provideContext(stream, context))
|
|
16104
16183
|
* yield* Console.log(result)
|
|
16105
16184
|
* })
|
|
16106
16185
|
*
|
|
@@ -16111,11 +16190,11 @@ export const provideServices: {
|
|
|
16111
16190
|
* @since 4.0.0
|
|
16112
16191
|
* @category Services
|
|
16113
16192
|
*/
|
|
16114
|
-
<A, E, R, R2>(self: Stream<A, E, R>,
|
|
16193
|
+
<A, E, R, R2>(self: Stream<A, E, R>, context: Context.Context<R2>): Stream<A, E, Exclude<R, R2>>
|
|
16115
16194
|
} = dual(
|
|
16116
16195
|
2,
|
|
16117
|
-
<A, E, R, R2>(self: Stream<A, E, R>,
|
|
16118
|
-
fromChannel(Channel.
|
|
16196
|
+
<A, E, R, R2>(self: Stream<A, E, R>, context: Context.Context<R2>): Stream<A, E, Exclude<R, R2>> =>
|
|
16197
|
+
fromChannel(Channel.provideContext(self.channel, context))
|
|
16119
16198
|
)
|
|
16120
16199
|
|
|
16121
16200
|
/**
|
|
@@ -16124,9 +16203,9 @@ export const provideServices: {
|
|
|
16124
16203
|
*
|
|
16125
16204
|
* @example
|
|
16126
16205
|
* ```ts
|
|
16127
|
-
* import { Console, Effect,
|
|
16206
|
+
* import { Console, Effect, Context, Stream } from "effect"
|
|
16128
16207
|
*
|
|
16129
|
-
* class Greeter extends
|
|
16208
|
+
* class Greeter extends Context.Service<Greeter, {
|
|
16130
16209
|
* greet: (name: string) => string
|
|
16131
16210
|
* }>()("Greeter") {}
|
|
16132
16211
|
*
|
|
@@ -16161,9 +16240,9 @@ export const provideService: {
|
|
|
16161
16240
|
*
|
|
16162
16241
|
* @example
|
|
16163
16242
|
* ```ts
|
|
16164
|
-
* import { Console, Effect,
|
|
16243
|
+
* import { Console, Effect, Context, Stream } from "effect"
|
|
16165
16244
|
*
|
|
16166
|
-
* class Greeter extends
|
|
16245
|
+
* class Greeter extends Context.Service<Greeter, {
|
|
16167
16246
|
* greet: (name: string) => string
|
|
16168
16247
|
* }>()("Greeter") {}
|
|
16169
16248
|
*
|
|
@@ -16191,7 +16270,7 @@ export const provideService: {
|
|
|
16191
16270
|
* @since 4.0.0
|
|
16192
16271
|
* @category Services
|
|
16193
16272
|
*/
|
|
16194
|
-
<I, S>(key:
|
|
16273
|
+
<I, S>(key: Context.Key<I, S>, service: NoInfer<S>): <A, E, R>(
|
|
16195
16274
|
self: Stream<A, E, R>
|
|
16196
16275
|
) => Stream<A, E, Exclude<R, I>>
|
|
16197
16276
|
/**
|
|
@@ -16200,9 +16279,9 @@ export const provideService: {
|
|
|
16200
16279
|
*
|
|
16201
16280
|
* @example
|
|
16202
16281
|
* ```ts
|
|
16203
|
-
* import { Console, Effect,
|
|
16282
|
+
* import { Console, Effect, Context, Stream } from "effect"
|
|
16204
16283
|
*
|
|
16205
|
-
* class Greeter extends
|
|
16284
|
+
* class Greeter extends Context.Service<Greeter, {
|
|
16206
16285
|
* greet: (name: string) => string
|
|
16207
16286
|
* }>()("Greeter") {}
|
|
16208
16287
|
*
|
|
@@ -16230,10 +16309,10 @@ export const provideService: {
|
|
|
16230
16309
|
* @since 4.0.0
|
|
16231
16310
|
* @category Services
|
|
16232
16311
|
*/
|
|
16233
|
-
<A, E, R, I, S>(self: Stream<A, E, R>, key:
|
|
16312
|
+
<A, E, R, I, S>(self: Stream<A, E, R>, key: Context.Key<I, S>, service: NoInfer<S>): Stream<A, E, Exclude<R, I>>
|
|
16234
16313
|
} = dual(3, <A, E, R, I, S>(
|
|
16235
16314
|
self: Stream<A, E, R>,
|
|
16236
|
-
key:
|
|
16315
|
+
key: Context.Key<I, S>,
|
|
16237
16316
|
service: NoInfer<S>
|
|
16238
16317
|
): Stream<A, E, Exclude<R, I>> => fromChannel(Channel.provideService(self.channel, key, service)))
|
|
16239
16318
|
|
|
@@ -16242,9 +16321,9 @@ export const provideService: {
|
|
|
16242
16321
|
*
|
|
16243
16322
|
* @example
|
|
16244
16323
|
* ```ts
|
|
16245
|
-
* import { Console, Effect,
|
|
16324
|
+
* import { Console, Effect, Context, Stream } from "effect"
|
|
16246
16325
|
*
|
|
16247
|
-
* class ApiConfig extends
|
|
16326
|
+
* class ApiConfig extends Context.Service<ApiConfig, { readonly baseUrl: string }>()("ApiConfig") {}
|
|
16248
16327
|
*
|
|
16249
16328
|
* const stream = Stream.fromEffect(
|
|
16250
16329
|
* Effect.gen(function*() {
|
|
@@ -16281,9 +16360,9 @@ export const provideServiceEffect: {
|
|
|
16281
16360
|
*
|
|
16282
16361
|
* @example
|
|
16283
16362
|
* ```ts
|
|
16284
|
-
* import { Console, Effect,
|
|
16363
|
+
* import { Console, Effect, Context, Stream } from "effect"
|
|
16285
16364
|
*
|
|
16286
|
-
* class ApiConfig extends
|
|
16365
|
+
* class ApiConfig extends Context.Service<ApiConfig, { readonly baseUrl: string }>()("ApiConfig") {}
|
|
16287
16366
|
*
|
|
16288
16367
|
* const stream = Stream.fromEffect(
|
|
16289
16368
|
* Effect.gen(function*() {
|
|
@@ -16314,7 +16393,7 @@ export const provideServiceEffect: {
|
|
|
16314
16393
|
* @since 4.0.0
|
|
16315
16394
|
* @category Services
|
|
16316
16395
|
*/
|
|
16317
|
-
<I, S, ES, RS>(key:
|
|
16396
|
+
<I, S, ES, RS>(key: Context.Key<I, S>, service: Effect.Effect<NoInfer<S>, ES, RS>): <A, E, R>(
|
|
16318
16397
|
self: Stream<A, E, R>
|
|
16319
16398
|
) => Stream<A, E | ES, Exclude<R, I> | RS>
|
|
16320
16399
|
/**
|
|
@@ -16322,9 +16401,9 @@ export const provideServiceEffect: {
|
|
|
16322
16401
|
*
|
|
16323
16402
|
* @example
|
|
16324
16403
|
* ```ts
|
|
16325
|
-
* import { Console, Effect,
|
|
16404
|
+
* import { Console, Effect, Context, Stream } from "effect"
|
|
16326
16405
|
*
|
|
16327
|
-
* class ApiConfig extends
|
|
16406
|
+
* class ApiConfig extends Context.Service<ApiConfig, { readonly baseUrl: string }>()("ApiConfig") {}
|
|
16328
16407
|
*
|
|
16329
16408
|
* const stream = Stream.fromEffect(
|
|
16330
16409
|
* Effect.gen(function*() {
|
|
@@ -16357,25 +16436,25 @@ export const provideServiceEffect: {
|
|
|
16357
16436
|
*/
|
|
16358
16437
|
<A, E, R, I, S, ES, RS>(
|
|
16359
16438
|
self: Stream<A, E, R>,
|
|
16360
|
-
key:
|
|
16439
|
+
key: Context.Key<I, S>,
|
|
16361
16440
|
service: Effect.Effect<NoInfer<S>, ES, RS>
|
|
16362
16441
|
): Stream<A, E | ES, Exclude<R, I> | RS>
|
|
16363
16442
|
} = dual(3, <A, E, R, I, S, ES, RS>(
|
|
16364
16443
|
self: Stream<A, E, R>,
|
|
16365
|
-
key:
|
|
16444
|
+
key: Context.Key<I, S>,
|
|
16366
16445
|
service: Effect.Effect<NoInfer<S>, ES, RS>
|
|
16367
16446
|
): Stream<A, E | ES, Exclude<R, I> | RS> => fromChannel(Channel.provideServiceEffect(self.channel, key, service)))
|
|
16368
16447
|
|
|
16369
16448
|
/**
|
|
16370
|
-
* Transforms the stream's required services by mapping the current
|
|
16449
|
+
* Transforms the stream's required services by mapping the current context
|
|
16371
16450
|
* to a new one.
|
|
16372
16451
|
*
|
|
16373
16452
|
* @example
|
|
16374
16453
|
* ```ts
|
|
16375
|
-
* import { Console, Effect,
|
|
16454
|
+
* import { Console, Effect, Context, Stream } from "effect"
|
|
16376
16455
|
*
|
|
16377
|
-
* class Logger extends
|
|
16378
|
-
* class Config extends
|
|
16456
|
+
* class Logger extends Context.Service<Logger, { prefix: string }>()("Logger") {}
|
|
16457
|
+
* class Config extends Context.Service<Config, { name: string }>()("Config") {}
|
|
16379
16458
|
*
|
|
16380
16459
|
* const stream = Stream.fromEffect(
|
|
16381
16460
|
* Effect.gen(function*() {
|
|
@@ -16386,8 +16465,8 @@ export const provideServiceEffect: {
|
|
|
16386
16465
|
* )
|
|
16387
16466
|
*
|
|
16388
16467
|
* const updated = stream.pipe(
|
|
16389
|
-
* Stream.
|
|
16390
|
-
*
|
|
16468
|
+
* Stream.updateContext((context: Context.Context<Logger>) =>
|
|
16469
|
+
* Context.add(context, Config, { name: "World" })
|
|
16391
16470
|
* )
|
|
16392
16471
|
* )
|
|
16393
16472
|
*
|
|
@@ -16405,17 +16484,17 @@ export const provideServiceEffect: {
|
|
|
16405
16484
|
* @since 2.0.0
|
|
16406
16485
|
* @category Services
|
|
16407
16486
|
*/
|
|
16408
|
-
export const
|
|
16487
|
+
export const updateContext: {
|
|
16409
16488
|
/**
|
|
16410
|
-
* Transforms the stream's required services by mapping the current
|
|
16489
|
+
* Transforms the stream's required services by mapping the current context
|
|
16411
16490
|
* to a new one.
|
|
16412
16491
|
*
|
|
16413
16492
|
* @example
|
|
16414
16493
|
* ```ts
|
|
16415
|
-
* import { Console, Effect,
|
|
16494
|
+
* import { Console, Effect, Context, Stream } from "effect"
|
|
16416
16495
|
*
|
|
16417
|
-
* class Logger extends
|
|
16418
|
-
* class Config extends
|
|
16496
|
+
* class Logger extends Context.Service<Logger, { prefix: string }>()("Logger") {}
|
|
16497
|
+
* class Config extends Context.Service<Config, { name: string }>()("Config") {}
|
|
16419
16498
|
*
|
|
16420
16499
|
* const stream = Stream.fromEffect(
|
|
16421
16500
|
* Effect.gen(function*() {
|
|
@@ -16426,8 +16505,8 @@ export const updateServices: {
|
|
|
16426
16505
|
* )
|
|
16427
16506
|
*
|
|
16428
16507
|
* const updated = stream.pipe(
|
|
16429
|
-
* Stream.
|
|
16430
|
-
*
|
|
16508
|
+
* Stream.updateContext((context: Context.Context<Logger>) =>
|
|
16509
|
+
* Context.add(context, Config, { name: "World" })
|
|
16431
16510
|
* )
|
|
16432
16511
|
* )
|
|
16433
16512
|
*
|
|
@@ -16445,19 +16524,19 @@ export const updateServices: {
|
|
|
16445
16524
|
* @since 2.0.0
|
|
16446
16525
|
* @category Services
|
|
16447
16526
|
*/
|
|
16448
|
-
<R, R2>(f: (
|
|
16527
|
+
<R, R2>(f: (context: Context.Context<R2>) => Context.Context<R>): <A, E>(
|
|
16449
16528
|
self: Stream<A, E, R>
|
|
16450
16529
|
) => Stream<A, E, R2>
|
|
16451
16530
|
/**
|
|
16452
|
-
* Transforms the stream's required services by mapping the current
|
|
16531
|
+
* Transforms the stream's required services by mapping the current context
|
|
16453
16532
|
* to a new one.
|
|
16454
16533
|
*
|
|
16455
16534
|
* @example
|
|
16456
16535
|
* ```ts
|
|
16457
|
-
* import { Console, Effect,
|
|
16536
|
+
* import { Console, Effect, Context, Stream } from "effect"
|
|
16458
16537
|
*
|
|
16459
|
-
* class Logger extends
|
|
16460
|
-
* class Config extends
|
|
16538
|
+
* class Logger extends Context.Service<Logger, { prefix: string }>()("Logger") {}
|
|
16539
|
+
* class Config extends Context.Service<Config, { name: string }>()("Config") {}
|
|
16461
16540
|
*
|
|
16462
16541
|
* const stream = Stream.fromEffect(
|
|
16463
16542
|
* Effect.gen(function*() {
|
|
@@ -16468,8 +16547,8 @@ export const updateServices: {
|
|
|
16468
16547
|
* )
|
|
16469
16548
|
*
|
|
16470
16549
|
* const updated = stream.pipe(
|
|
16471
|
-
* Stream.
|
|
16472
|
-
*
|
|
16550
|
+
* Stream.updateContext((context: Context.Context<Logger>) =>
|
|
16551
|
+
* Context.add(context, Config, { name: "World" })
|
|
16473
16552
|
* )
|
|
16474
16553
|
* )
|
|
16475
16554
|
*
|
|
@@ -16489,21 +16568,21 @@ export const updateServices: {
|
|
|
16489
16568
|
*/
|
|
16490
16569
|
<A, E, R, R2>(
|
|
16491
16570
|
self: Stream<A, E, R>,
|
|
16492
|
-
f: (
|
|
16571
|
+
f: (context: Context.Context<R2>) => Context.Context<R>
|
|
16493
16572
|
): Stream<A, E, R2>
|
|
16494
16573
|
} = dual(2, <A, E, R, R2>(
|
|
16495
16574
|
self: Stream<A, E, R>,
|
|
16496
|
-
f: (
|
|
16497
|
-
): Stream<A, E, R2> => fromChannel(Channel.
|
|
16575
|
+
f: (context: Context.Context<R2>) => Context.Context<R>
|
|
16576
|
+
): Stream<A, E, R2> => fromChannel(Channel.updateContext(self.channel, f)))
|
|
16498
16577
|
|
|
16499
16578
|
/**
|
|
16500
16579
|
* Updates a single service in the stream environment by applying a function.
|
|
16501
16580
|
*
|
|
16502
16581
|
* @example
|
|
16503
16582
|
* ```ts
|
|
16504
|
-
* import { Console, Effect,
|
|
16583
|
+
* import { Console, Effect, Context, Stream } from "effect"
|
|
16505
16584
|
*
|
|
16506
|
-
* class Counter extends
|
|
16585
|
+
* class Counter extends Context.Service<Counter, { count: number }>()("Counter") {}
|
|
16507
16586
|
*
|
|
16508
16587
|
* const stream = Stream.fromEffect(Effect.service(Counter)).pipe(
|
|
16509
16588
|
* Stream.updateService(Counter, (counter) => ({ count: counter.count + 1 }))
|
|
@@ -16527,9 +16606,9 @@ export const updateService: {
|
|
|
16527
16606
|
*
|
|
16528
16607
|
* @example
|
|
16529
16608
|
* ```ts
|
|
16530
|
-
* import { Console, Effect,
|
|
16609
|
+
* import { Console, Effect, Context, Stream } from "effect"
|
|
16531
16610
|
*
|
|
16532
|
-
* class Counter extends
|
|
16611
|
+
* class Counter extends Context.Service<Counter, { count: number }>()("Counter") {}
|
|
16533
16612
|
*
|
|
16534
16613
|
* const stream = Stream.fromEffect(Effect.service(Counter)).pipe(
|
|
16535
16614
|
* Stream.updateService(Counter, (counter) => ({ count: counter.count + 1 }))
|
|
@@ -16547,7 +16626,7 @@ export const updateService: {
|
|
|
16547
16626
|
* @since 2.0.0
|
|
16548
16627
|
* @category Services
|
|
16549
16628
|
*/
|
|
16550
|
-
<I, S>(key:
|
|
16629
|
+
<I, S>(key: Context.Key<I, S>, f: (service: NoInfer<S>) => S): <A, E, R>(
|
|
16551
16630
|
self: Stream<A, E, R>
|
|
16552
16631
|
) => Stream<A, E, R | I>
|
|
16553
16632
|
/**
|
|
@@ -16555,9 +16634,9 @@ export const updateService: {
|
|
|
16555
16634
|
*
|
|
16556
16635
|
* @example
|
|
16557
16636
|
* ```ts
|
|
16558
|
-
* import { Console, Effect,
|
|
16637
|
+
* import { Console, Effect, Context, Stream } from "effect"
|
|
16559
16638
|
*
|
|
16560
|
-
* class Counter extends
|
|
16639
|
+
* class Counter extends Context.Service<Counter, { count: number }>()("Counter") {}
|
|
16561
16640
|
*
|
|
16562
16641
|
* const stream = Stream.fromEffect(Effect.service(Counter)).pipe(
|
|
16563
16642
|
* Stream.updateService(Counter, (counter) => ({ count: counter.count + 1 }))
|
|
@@ -16577,19 +16656,19 @@ export const updateService: {
|
|
|
16577
16656
|
*/
|
|
16578
16657
|
<A, E, R, I, S>(
|
|
16579
16658
|
self: Stream<A, E, R>,
|
|
16580
|
-
key:
|
|
16659
|
+
key: Context.Key<I, S>,
|
|
16581
16660
|
f: (service: NoInfer<S>) => S
|
|
16582
16661
|
): Stream<A, E, R | I>
|
|
16583
16662
|
} = dual(3, <A, E, R, I, S>(
|
|
16584
16663
|
self: Stream<A, E, R>,
|
|
16585
|
-
service:
|
|
16664
|
+
service: Context.Key<I, S>,
|
|
16586
16665
|
f: (service: NoInfer<S>) => S
|
|
16587
16666
|
): Stream<A, E, R | I> =>
|
|
16588
|
-
|
|
16589
|
-
|
|
16590
|
-
|
|
16667
|
+
updateContext(self, (context) =>
|
|
16668
|
+
Context.add(
|
|
16669
|
+
context,
|
|
16591
16670
|
service,
|
|
16592
|
-
f(
|
|
16671
|
+
f(Context.get(context, service))
|
|
16593
16672
|
)))
|
|
16594
16673
|
|
|
16595
16674
|
/**
|
|
@@ -17757,10 +17836,10 @@ export const mkUint8Array = <E, R>(self: Stream<Uint8Array, E, R>): Effect.Effec
|
|
|
17757
17836
|
*
|
|
17758
17837
|
* @example
|
|
17759
17838
|
* ```ts
|
|
17760
|
-
* import {
|
|
17839
|
+
* import { Context, Stream } from "effect"
|
|
17761
17840
|
*
|
|
17762
17841
|
* const stream = Stream.make(1, 2, 3, 4, 5)
|
|
17763
|
-
* const readableStream = Stream.toReadableStreamWith(stream,
|
|
17842
|
+
* const readableStream = Stream.toReadableStreamWith(stream, Context.empty())
|
|
17764
17843
|
* ```
|
|
17765
17844
|
*
|
|
17766
17845
|
* @since 2.0.0
|
|
@@ -17774,17 +17853,17 @@ export const toReadableStreamWith = dual<
|
|
|
17774
17853
|
*
|
|
17775
17854
|
* @example
|
|
17776
17855
|
* ```ts
|
|
17777
|
-
* import {
|
|
17856
|
+
* import { Context, Stream } from "effect"
|
|
17778
17857
|
*
|
|
17779
17858
|
* const stream = Stream.make(1, 2, 3, 4, 5)
|
|
17780
|
-
* const readableStream = Stream.toReadableStreamWith(stream,
|
|
17859
|
+
* const readableStream = Stream.toReadableStreamWith(stream, Context.empty())
|
|
17781
17860
|
* ```
|
|
17782
17861
|
*
|
|
17783
17862
|
* @since 2.0.0
|
|
17784
17863
|
* @category Destructors
|
|
17785
17864
|
*/
|
|
17786
17865
|
<A, XR>(
|
|
17787
|
-
|
|
17866
|
+
context: Context.Context<XR>,
|
|
17788
17867
|
options?: { readonly strategy?: QueuingStrategy<A> | undefined }
|
|
17789
17868
|
) => <E, R extends XR>(self: Stream<A, E, R>) => ReadableStream<A>,
|
|
17790
17869
|
/**
|
|
@@ -17794,10 +17873,10 @@ export const toReadableStreamWith = dual<
|
|
|
17794
17873
|
*
|
|
17795
17874
|
* @example
|
|
17796
17875
|
* ```ts
|
|
17797
|
-
* import {
|
|
17876
|
+
* import { Context, Stream } from "effect"
|
|
17798
17877
|
*
|
|
17799
17878
|
* const stream = Stream.make(1, 2, 3, 4, 5)
|
|
17800
|
-
* const readableStream = Stream.toReadableStreamWith(stream,
|
|
17879
|
+
* const readableStream = Stream.toReadableStreamWith(stream, Context.empty())
|
|
17801
17880
|
* ```
|
|
17802
17881
|
*
|
|
17803
17882
|
* @since 2.0.0
|
|
@@ -17805,14 +17884,14 @@ export const toReadableStreamWith = dual<
|
|
|
17805
17884
|
*/
|
|
17806
17885
|
<A, E, XR, R extends XR>(
|
|
17807
17886
|
self: Stream<A, E, R>,
|
|
17808
|
-
|
|
17887
|
+
context: Context.Context<XR>,
|
|
17809
17888
|
options?: { readonly strategy?: QueuingStrategy<A> | undefined }
|
|
17810
17889
|
) => ReadableStream<A>
|
|
17811
17890
|
>(
|
|
17812
17891
|
(args) => isStream(args[0]),
|
|
17813
17892
|
<A, E, XR, R extends XR>(
|
|
17814
17893
|
self: Stream<A, E, R>,
|
|
17815
|
-
|
|
17894
|
+
context: Context.Context<XR>,
|
|
17816
17895
|
options?: { readonly strategy?: QueuingStrategy<A> | undefined }
|
|
17817
17896
|
): ReadableStream<A> => {
|
|
17818
17897
|
let currentResolve: (() => void) | undefined = undefined
|
|
@@ -17821,7 +17900,7 @@ export const toReadableStreamWith = dual<
|
|
|
17821
17900
|
|
|
17822
17901
|
return new ReadableStream<A>({
|
|
17823
17902
|
start(controller) {
|
|
17824
|
-
fiber = Effect.runFork(Effect.
|
|
17903
|
+
fiber = Effect.runFork(Effect.provideContext(
|
|
17825
17904
|
runForEachArray(self, (chunk) =>
|
|
17826
17905
|
latch.whenOpen(Effect.sync(() => {
|
|
17827
17906
|
latch.closeUnsafe()
|
|
@@ -17831,7 +17910,7 @@ export const toReadableStreamWith = dual<
|
|
|
17831
17910
|
currentResolve!()
|
|
17832
17911
|
currentResolve = undefined
|
|
17833
17912
|
}))),
|
|
17834
|
-
|
|
17913
|
+
context
|
|
17835
17914
|
))
|
|
17836
17915
|
fiber.addObserver((exit) => {
|
|
17837
17916
|
if (exit._tag === "Failure") {
|
|
@@ -17916,7 +17995,7 @@ export const toReadableStream: {
|
|
|
17916
17995
|
<A, E>(
|
|
17917
17996
|
self: Stream<A, E>,
|
|
17918
17997
|
options?: { readonly strategy?: QueuingStrategy<A> | undefined }
|
|
17919
|
-
): ReadableStream<A> => toReadableStreamWith(self,
|
|
17998
|
+
): ReadableStream<A> => toReadableStreamWith(self, Context.empty(), options)
|
|
17920
17999
|
)
|
|
17921
18000
|
|
|
17922
18001
|
/**
|
|
@@ -18000,7 +18079,7 @@ export const toReadableStreamEffect: {
|
|
|
18000
18079
|
options?: { readonly strategy?: QueuingStrategy<A> | undefined }
|
|
18001
18080
|
): Effect.Effect<ReadableStream<A>, never, R> =>
|
|
18002
18081
|
Effect.map(
|
|
18003
|
-
Effect.
|
|
18082
|
+
Effect.context</**
|
|
18004
18083
|
* Creates an Effect that builds a ReadableStream from the stream.
|
|
18005
18084
|
*
|
|
18006
18085
|
* See https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream.
|
|
@@ -18032,10 +18111,10 @@ export const toReadableStreamEffect: {
|
|
|
18032
18111
|
*
|
|
18033
18112
|
* @example
|
|
18034
18113
|
* ```ts
|
|
18035
|
-
* import {
|
|
18114
|
+
* import { Context, Stream } from "effect"
|
|
18036
18115
|
*
|
|
18037
18116
|
* const stream = Stream.make(1, 2, 3)
|
|
18038
|
-
* const iterable = Stream.toAsyncIterableWith(stream,
|
|
18117
|
+
* const iterable = Stream.toAsyncIterableWith(stream, Context.empty())
|
|
18039
18118
|
*
|
|
18040
18119
|
* const collect = async () => {
|
|
18041
18120
|
* const results: Array<number> = []
|
|
@@ -18055,10 +18134,10 @@ export const toAsyncIterableWith: {
|
|
|
18055
18134
|
*
|
|
18056
18135
|
* @example
|
|
18057
18136
|
* ```ts
|
|
18058
|
-
* import {
|
|
18137
|
+
* import { Context, Stream } from "effect"
|
|
18059
18138
|
*
|
|
18060
18139
|
* const stream = Stream.make(1, 2, 3)
|
|
18061
|
-
* const iterable = Stream.toAsyncIterableWith(stream,
|
|
18140
|
+
* const iterable = Stream.toAsyncIterableWith(stream, Context.empty())
|
|
18062
18141
|
*
|
|
18063
18142
|
* const collect = async () => {
|
|
18064
18143
|
* const results: Array<number> = []
|
|
@@ -18072,16 +18151,16 @@ export const toAsyncIterableWith: {
|
|
|
18072
18151
|
* @since 2.0.0
|
|
18073
18152
|
* @category Destructors
|
|
18074
18153
|
*/
|
|
18075
|
-
<XR>(
|
|
18154
|
+
<XR>(context: Context.Context<XR>): <A, E, R extends XR>(self: Stream<A, E, R>) => AsyncIterable<A>
|
|
18076
18155
|
/**
|
|
18077
18156
|
* Converts the stream to an `AsyncIterable` using the provided services.
|
|
18078
18157
|
*
|
|
18079
18158
|
* @example
|
|
18080
18159
|
* ```ts
|
|
18081
|
-
* import {
|
|
18160
|
+
* import { Context, Stream } from "effect"
|
|
18082
18161
|
*
|
|
18083
18162
|
* const stream = Stream.make(1, 2, 3)
|
|
18084
|
-
* const iterable = Stream.toAsyncIterableWith(stream,
|
|
18163
|
+
* const iterable = Stream.toAsyncIterableWith(stream, Context.empty())
|
|
18085
18164
|
*
|
|
18086
18165
|
* const collect = async () => {
|
|
18087
18166
|
* const results: Array<number> = []
|
|
@@ -18095,16 +18174,16 @@ export const toAsyncIterableWith: {
|
|
|
18095
18174
|
* @since 2.0.0
|
|
18096
18175
|
* @category Destructors
|
|
18097
18176
|
*/
|
|
18098
|
-
<A, E, XR, R extends XR>(self: Stream<A, E, R>,
|
|
18177
|
+
<A, E, XR, R extends XR>(self: Stream<A, E, R>, context: Context.Context<XR>): AsyncIterable<A>
|
|
18099
18178
|
} = dual(
|
|
18100
18179
|
2,
|
|
18101
18180
|
<A, E, XR, R extends XR>(
|
|
18102
18181
|
self: Stream<A, E, R>,
|
|
18103
|
-
|
|
18182
|
+
context: Context.Context<XR>
|
|
18104
18183
|
): AsyncIterable<A> => ({
|
|
18105
18184
|
[Symbol.asyncIterator]() {
|
|
18106
|
-
const runPromise = Effect.runPromiseWith(
|
|
18107
|
-
const runPromiseExit = Effect.runPromiseExitWith(
|
|
18185
|
+
const runPromise = Effect.runPromiseWith(context)
|
|
18186
|
+
const runPromiseExit = Effect.runPromiseExitWith(context)
|
|
18108
18187
|
const scope = Scope.makeUnsafe()
|
|
18109
18188
|
let pull: Pull.Pull<Arr.NonEmptyReadonlyArray<A>, E, void, R> | undefined
|
|
18110
18189
|
let currentIter: Iterator<A> | undefined
|
|
@@ -18166,8 +18245,8 @@ export const toAsyncIterableWith: {
|
|
|
18166
18245
|
*/
|
|
18167
18246
|
export const toAsyncIterableEffect = <A, E, R>(self: Stream<A, E, R>): Effect.Effect<AsyncIterable<A>, never, R> =>
|
|
18168
18247
|
Effect.map(
|
|
18169
|
-
Effect.
|
|
18170
|
-
(
|
|
18248
|
+
Effect.context<R>(),
|
|
18249
|
+
(context) => toAsyncIterableWith(self, context)
|
|
18171
18250
|
)
|
|
18172
18251
|
|
|
18173
18252
|
/**
|
|
@@ -18196,7 +18275,7 @@ export const toAsyncIterableEffect = <A, E, R>(self: Stream<A, E, R>): Effect.Ef
|
|
|
18196
18275
|
* @category Destructors
|
|
18197
18276
|
*/
|
|
18198
18277
|
export const toAsyncIterable = <A, E>(self: Stream<A, E>): AsyncIterable<A> =>
|
|
18199
|
-
toAsyncIterableWith(self,
|
|
18278
|
+
toAsyncIterableWith(self, Context.empty())
|
|
18200
18279
|
|
|
18201
18280
|
/**
|
|
18202
18281
|
* Runs the stream, publishing elements into the provided PubSub.
|
|
@@ -18542,16 +18621,16 @@ export const toPubSubTake: {
|
|
|
18542
18621
|
)
|
|
18543
18622
|
|
|
18544
18623
|
/**
|
|
18545
|
-
* Converts a stream to a
|
|
18624
|
+
* Converts a stream to a Queue for concurrent consumption.
|
|
18546
18625
|
*
|
|
18547
18626
|
* @example
|
|
18548
18627
|
* ```ts
|
|
18549
|
-
* import { Effect,
|
|
18628
|
+
* import { Effect, Queue, Stream } from "effect"
|
|
18550
18629
|
*
|
|
18551
18630
|
* const program = Effect.gen(function* () {
|
|
18552
|
-
* const
|
|
18553
|
-
* const
|
|
18554
|
-
* return
|
|
18631
|
+
* const queue = yield* Stream.toQueue(Stream.fromIterable([1, 2, 3]), { capacity: 8 })
|
|
18632
|
+
* const chunk = yield* Queue.takeBetween(queue, 1, 3)
|
|
18633
|
+
* return chunk
|
|
18555
18634
|
* })
|
|
18556
18635
|
* ```
|
|
18557
18636
|
*
|
|
@@ -18560,16 +18639,16 @@ export const toPubSubTake: {
|
|
|
18560
18639
|
*/
|
|
18561
18640
|
export const toQueue: {
|
|
18562
18641
|
/**
|
|
18563
|
-
* Converts a stream to a
|
|
18642
|
+
* Converts a stream to a Queue for concurrent consumption.
|
|
18564
18643
|
*
|
|
18565
18644
|
* @example
|
|
18566
18645
|
* ```ts
|
|
18567
|
-
* import { Effect,
|
|
18646
|
+
* import { Effect, Queue, Stream } from "effect"
|
|
18568
18647
|
*
|
|
18569
18648
|
* const program = Effect.gen(function* () {
|
|
18570
|
-
* const
|
|
18571
|
-
* const
|
|
18572
|
-
* return
|
|
18649
|
+
* const queue = yield* Stream.toQueue(Stream.fromIterable([1, 2, 3]), { capacity: 8 })
|
|
18650
|
+
* const chunk = yield* Queue.takeBetween(queue, 1, 3)
|
|
18651
|
+
* return chunk
|
|
18573
18652
|
* })
|
|
18574
18653
|
* ```
|
|
18575
18654
|
*
|
|
@@ -18585,16 +18664,16 @@ export const toQueue: {
|
|
|
18585
18664
|
}
|
|
18586
18665
|
): <A, E, R>(self: Stream<A, E, R>) => Effect.Effect<Queue.Dequeue<A, E | Cause.Done>, never, R | Scope.Scope>
|
|
18587
18666
|
/**
|
|
18588
|
-
* Converts a stream to a
|
|
18667
|
+
* Converts a stream to a Queue for concurrent consumption.
|
|
18589
18668
|
*
|
|
18590
18669
|
* @example
|
|
18591
18670
|
* ```ts
|
|
18592
|
-
* import { Effect,
|
|
18671
|
+
* import { Effect, Queue, Stream } from "effect"
|
|
18593
18672
|
*
|
|
18594
18673
|
* const program = Effect.gen(function* () {
|
|
18595
|
-
* const
|
|
18596
|
-
* const
|
|
18597
|
-
* return
|
|
18674
|
+
* const queue = yield* Stream.toQueue(Stream.fromIterable([1, 2, 3]), { capacity: 8 })
|
|
18675
|
+
* const chunk = yield* Queue.takeBetween(queue, 1, 3)
|
|
18676
|
+
* return chunk
|
|
18598
18677
|
* })
|
|
18599
18678
|
* ```
|
|
18600
18679
|
*
|
|
@@ -18609,22 +18688,19 @@ export const toQueue: {
|
|
|
18609
18688
|
readonly capacity: number
|
|
18610
18689
|
readonly strategy?: "dropping" | "sliding" | "suspend" | undefined
|
|
18611
18690
|
}
|
|
18612
|
-
): Effect.Effect<
|
|
18691
|
+
): Effect.Effect<Queue.Dequeue<A, E | Cause.Done>, never, R | Scope.Scope>
|
|
18613
18692
|
} = dual(
|
|
18614
18693
|
2,
|
|
18615
18694
|
<A, E, R>(
|
|
18616
18695
|
self: Stream<A, E, R>,
|
|
18617
18696
|
options: {
|
|
18618
18697
|
readonly capacity: "unbounded"
|
|
18619
|
-
readonly replay?: number | undefined
|
|
18620
|
-
readonly shutdownOnEnd?: boolean | undefined
|
|
18621
18698
|
} | {
|
|
18622
18699
|
readonly capacity: number
|
|
18623
18700
|
readonly strategy?: "dropping" | "sliding" | "suspend" | undefined
|
|
18624
|
-
readonly replay?: number | undefined
|
|
18625
|
-
readonly shutdownOnEnd?: boolean | undefined
|
|
18626
18701
|
}
|
|
18627
|
-
): Effect.Effect<
|
|
18702
|
+
): Effect.Effect<Queue.Dequeue<A, E | Cause.Done>, never, R | Scope.Scope> =>
|
|
18703
|
+
Channel.toQueueArray(self.channel, options)
|
|
18628
18704
|
)
|
|
18629
18705
|
|
|
18630
18706
|
/**
|