effect 4.0.0-beta.43 → 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 +286 -268
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +133 -134
- 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/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/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/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.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +13 -14
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/Entity.d.ts +8 -8
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.js +12 -12
- 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 +2 -2
- 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 +3 -3
- package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js +5 -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 +333 -307
- 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/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/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/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 +14 -15
- package/src/unstable/cluster/Entity.ts +25 -25
- 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 +2 -2
- 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 +6 -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/dist/Stream.js
CHANGED
|
@@ -6,6 +6,7 @@ import * as Arr from "./Array.js";
|
|
|
6
6
|
import * as Cause from "./Cause.js";
|
|
7
7
|
import * as Channel from "./Channel.js";
|
|
8
8
|
import { Clock } from "./Clock.js";
|
|
9
|
+
import * as Context from "./Context.js";
|
|
9
10
|
import * as Duration from "./Duration.js";
|
|
10
11
|
import * as Effect from "./Effect.js";
|
|
11
12
|
import * as Equal from "./Equal.js";
|
|
@@ -29,7 +30,6 @@ import * as RcRef from "./RcRef.js";
|
|
|
29
30
|
import * as Result from "./Result.js";
|
|
30
31
|
import * as Schedule from "./Schedule.js";
|
|
31
32
|
import * as Scope from "./Scope.js";
|
|
32
|
-
import * as ServiceMap from "./ServiceMap.js";
|
|
33
33
|
import * as Sink from "./Sink.js";
|
|
34
34
|
import { isString } from "./String.js";
|
|
35
35
|
/**
|
|
@@ -123,6 +123,76 @@ export const fromChannel = internal.fromChannel;
|
|
|
123
123
|
* @category Constructors
|
|
124
124
|
*/
|
|
125
125
|
export const fromEffect = effect => fromChannel(Channel.fromEffect(Effect.map(effect, Arr.of)));
|
|
126
|
+
/**
|
|
127
|
+
* Accesses a service from the context and emits it as a single element.
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```ts
|
|
131
|
+
* import { Effect, Context, Stream } from "effect"
|
|
132
|
+
*
|
|
133
|
+
* class Greeter extends Context.Service<Greeter, {
|
|
134
|
+
* readonly greet: (name: string) => string
|
|
135
|
+
* }>()("Greeter") {}
|
|
136
|
+
*
|
|
137
|
+
* const stream = Stream.service(Greeter).pipe(
|
|
138
|
+
* Stream.map((greeter) => greeter.greet("World"))
|
|
139
|
+
* )
|
|
140
|
+
*
|
|
141
|
+
* const program = Effect.gen(function*() {
|
|
142
|
+
* return yield* stream.pipe(
|
|
143
|
+
* Stream.provideService(Greeter, {
|
|
144
|
+
* greet: (name) => `Hello, ${name}!`
|
|
145
|
+
* }),
|
|
146
|
+
* Stream.runCollect
|
|
147
|
+
* )
|
|
148
|
+
* })
|
|
149
|
+
*
|
|
150
|
+
* Effect.runPromise(program)
|
|
151
|
+
* // Output: [ "Hello, World!" ]
|
|
152
|
+
* ```
|
|
153
|
+
*
|
|
154
|
+
* @since 4.0.0
|
|
155
|
+
* @category Context
|
|
156
|
+
*/
|
|
157
|
+
export const service = service => fromEffect(Effect.service(service));
|
|
158
|
+
/**
|
|
159
|
+
* Optionally accesses a service from the context and emits the result as a
|
|
160
|
+
* single element.
|
|
161
|
+
*
|
|
162
|
+
* @example
|
|
163
|
+
* ```ts
|
|
164
|
+
* import { Effect, Option, Context, Stream } from "effect"
|
|
165
|
+
*
|
|
166
|
+
* class Greeter extends Context.Service<Greeter, {
|
|
167
|
+
* readonly greet: (name: string) => string
|
|
168
|
+
* }>()("Greeter") {}
|
|
169
|
+
*
|
|
170
|
+
* const stream = Stream.serviceOption(Greeter).pipe(
|
|
171
|
+
* Stream.map((maybeGreeter) =>
|
|
172
|
+
* Option.match(maybeGreeter, {
|
|
173
|
+
* onNone: () => "No greeter",
|
|
174
|
+
* onSome: (greeter) => greeter.greet("World")
|
|
175
|
+
* })
|
|
176
|
+
* )
|
|
177
|
+
* )
|
|
178
|
+
*
|
|
179
|
+
* const program = Effect.gen(function*() {
|
|
180
|
+
* return yield* stream.pipe(
|
|
181
|
+
* Stream.provideService(Greeter, {
|
|
182
|
+
* greet: (name) => `Hello, ${name}!`
|
|
183
|
+
* }),
|
|
184
|
+
* Stream.runCollect
|
|
185
|
+
* )
|
|
186
|
+
* })
|
|
187
|
+
*
|
|
188
|
+
* Effect.runPromise(program)
|
|
189
|
+
* // Output: [ "Hello, World!" ]
|
|
190
|
+
* ```
|
|
191
|
+
*
|
|
192
|
+
* @since 4.0.0
|
|
193
|
+
* @category Context
|
|
194
|
+
*/
|
|
195
|
+
export const serviceOption = service => fromEffect(Effect.serviceOption(service));
|
|
126
196
|
/**
|
|
127
197
|
* Creates a stream that runs the effect and emits no elements.
|
|
128
198
|
*
|
|
@@ -700,9 +770,9 @@ export const fromIterable = (iterable, options) => Array.isArray(iterable) && op
|
|
|
700
770
|
*
|
|
701
771
|
* @example
|
|
702
772
|
* ```ts
|
|
703
|
-
* import { Console, Effect,
|
|
773
|
+
* import { Console, Effect, Context, Stream } from "effect"
|
|
704
774
|
*
|
|
705
|
-
* class UserRepo extends
|
|
775
|
+
* class UserRepo extends Context.Service<UserRepo, {
|
|
706
776
|
* readonly list: Effect.Effect<ReadonlyArray<string>>
|
|
707
777
|
* }>()("UserRepo") {}
|
|
708
778
|
*
|
|
@@ -3718,9 +3788,9 @@ export const retry = /*#__PURE__*/dual(2, (self, policy) => fromChannel(Channel.
|
|
|
3718
3788
|
*
|
|
3719
3789
|
* @example
|
|
3720
3790
|
* ```ts
|
|
3721
|
-
* import { Console, Effect, ExecutionPlan, Layer,
|
|
3791
|
+
* import { Console, Effect, ExecutionPlan, Layer, Context, Stream } from "effect"
|
|
3722
3792
|
*
|
|
3723
|
-
* class Service extends
|
|
3793
|
+
* class Service extends Context.Service<Service>()("Service", {
|
|
3724
3794
|
* make: Effect.succeed({
|
|
3725
3795
|
* stream: Stream.fail("A") as Stream.Stream<number, string>
|
|
3726
3796
|
* })
|
|
@@ -5230,9 +5300,7 @@ export const aggregateWithin = /*#__PURE__*/dual(3, (self, sink, schedule) => fr
|
|
|
5230
5300
|
capacity: 0
|
|
5231
5301
|
});
|
|
5232
5302
|
// upstream -> buffer
|
|
5233
|
-
let hadChunk = false;
|
|
5234
5303
|
yield* pull.pipe(pullLatch.whenOpen, Effect.flatMap(arr => {
|
|
5235
|
-
hadChunk = true;
|
|
5236
5304
|
pullLatch.closeUnsafe();
|
|
5237
5305
|
return Queue.offer(buffer, arr);
|
|
5238
5306
|
}), Effect.forever,
|
|
@@ -5241,34 +5309,42 @@ export const aggregateWithin = /*#__PURE__*/dual(3, (self, sink, schedule) => fr
|
|
|
5241
5309
|
// schedule -> buffer
|
|
5242
5310
|
let lastOutput = Option.none();
|
|
5243
5311
|
let leftover;
|
|
5312
|
+
let sinkHasInput = false;
|
|
5244
5313
|
const step = yield* Schedule.toStepWithSleep(schedule);
|
|
5245
5314
|
const stepToBuffer = Effect.suspend(function loop() {
|
|
5246
|
-
return step(lastOutput).pipe(Effect.flatMap(() => !
|
|
5315
|
+
return step(lastOutput).pipe(Effect.flatMap(() => !sinkHasInput ? loop() : Queue.offer(buffer, scheduleStep)), Effect.flatMap(() => Effect.never), Pull.catchDone(() => Cause.done()));
|
|
5247
5316
|
});
|
|
5248
5317
|
// buffer -> sink
|
|
5249
|
-
const pullFromBuffer = Queue.take(buffer).pipe(Effect.flatMap(arr =>
|
|
5318
|
+
const pullFromBuffer = Queue.take(buffer).pipe(Effect.flatMap(arr => {
|
|
5319
|
+
if (arr === scheduleStep) {
|
|
5320
|
+
return Cause.done();
|
|
5321
|
+
}
|
|
5322
|
+
sinkHasInput = true;
|
|
5323
|
+
return Effect.succeed(arr);
|
|
5324
|
+
}));
|
|
5250
5325
|
const sinkUpstream = Effect.suspend(() => {
|
|
5251
5326
|
if (leftover !== undefined) {
|
|
5252
5327
|
const chunk = leftover;
|
|
5253
5328
|
leftover = undefined;
|
|
5329
|
+
sinkHasInput = true;
|
|
5254
5330
|
return Effect.succeed(chunk);
|
|
5255
5331
|
}
|
|
5256
|
-
hadChunk = false;
|
|
5257
5332
|
pullLatch.openUnsafe();
|
|
5258
5333
|
return pullFromBuffer;
|
|
5259
5334
|
});
|
|
5260
5335
|
const catchSinkHalt = Effect.flatMap(([value, leftover_]) => {
|
|
5261
5336
|
// ignore the last output if the upstream only pulled a halt
|
|
5262
|
-
if (!
|
|
5337
|
+
if (!sinkHasInput && buffer.state._tag === "Done") return Cause.done();
|
|
5263
5338
|
lastOutput = Option.some(value);
|
|
5264
5339
|
leftover = leftover_;
|
|
5265
5340
|
return Effect.succeed(Arr.of(value));
|
|
5266
5341
|
});
|
|
5267
5342
|
return Effect.suspend(() => {
|
|
5268
5343
|
// if the buffer has exited and there is no more data to process
|
|
5269
|
-
if (buffer.state._tag === "Done") {
|
|
5344
|
+
if (buffer.state._tag === "Done" && leftover === undefined) {
|
|
5270
5345
|
return buffer.state.exit;
|
|
5271
5346
|
}
|
|
5347
|
+
sinkHasInput = leftover !== undefined;
|
|
5272
5348
|
return Effect.succeed(Effect.suspend(() => sink.transform(sinkUpstream, scope)));
|
|
5273
5349
|
}).pipe(Effect.flatMap(pull => Effect.raceFirst(catchSinkHalt(pull), stepToBuffer)));
|
|
5274
5350
|
}))));
|
|
@@ -6032,7 +6108,7 @@ export const onEnd = /*#__PURE__*/dual(2, (self, onEnd) => fromChannel(Channel.o
|
|
|
6032
6108
|
*/
|
|
6033
6109
|
export const ensuring = /*#__PURE__*/dual(2, (self, finalizer) => fromChannel(Channel.ensuring(self.channel, finalizer)));
|
|
6034
6110
|
/**
|
|
6035
|
-
* Provides a layer or
|
|
6111
|
+
* Provides a layer or context to the stream, removing the corresponding
|
|
6036
6112
|
* service requirements. Use `options.local` to build the layer every time; by
|
|
6037
6113
|
* default, layers are shared between provide calls.
|
|
6038
6114
|
*
|
|
@@ -6040,9 +6116,9 @@ export const ensuring = /*#__PURE__*/dual(2, (self, finalizer) => fromChannel(Ch
|
|
|
6040
6116
|
*
|
|
6041
6117
|
* @example
|
|
6042
6118
|
* ```ts
|
|
6043
|
-
* import { Console, Effect, Layer,
|
|
6119
|
+
* import { Console, Effect, Layer, Context, Stream } from "effect"
|
|
6044
6120
|
*
|
|
6045
|
-
* class Env extends
|
|
6121
|
+
* class Env extends Context.Service<Env, { readonly name: string }>()("Env") {}
|
|
6046
6122
|
*
|
|
6047
6123
|
* const layer = Layer.succeed(Env)({ name: "Ada" })
|
|
6048
6124
|
*
|
|
@@ -6069,17 +6145,17 @@ export const ensuring = /*#__PURE__*/dual(2, (self, finalizer) => fromChannel(Ch
|
|
|
6069
6145
|
*/
|
|
6070
6146
|
export const provide = /*#__PURE__*/dual(args => isStream(args[0]), (self, layer, options) => fromChannel(Channel.provide(self.channel, layer, options)));
|
|
6071
6147
|
/**
|
|
6072
|
-
* Provides multiple services to the stream using a
|
|
6148
|
+
* Provides multiple services to the stream using a context.
|
|
6073
6149
|
*
|
|
6074
6150
|
* @example
|
|
6075
6151
|
* ```ts
|
|
6076
|
-
* import { Console, Effect,
|
|
6152
|
+
* import { Console, Effect, Context, Stream } from "effect"
|
|
6077
6153
|
*
|
|
6078
|
-
* class Config extends
|
|
6079
|
-
* class Greeter extends
|
|
6154
|
+
* class Config extends Context.Service<Config, { readonly prefix: string }>()("Config") {}
|
|
6155
|
+
* class Greeter extends Context.Service<Greeter, { greet: (name: string) => string }>()("Greeter") {}
|
|
6080
6156
|
*
|
|
6081
|
-
* const
|
|
6082
|
-
*
|
|
6157
|
+
* const context = Context.make(Config, { prefix: "Hello" }).pipe(
|
|
6158
|
+
* Context.add(Greeter, { greet: (name: string) => `${name}!` })
|
|
6083
6159
|
* )
|
|
6084
6160
|
*
|
|
6085
6161
|
* const stream = Stream.fromEffect(
|
|
@@ -6091,7 +6167,7 @@ export const provide = /*#__PURE__*/dual(args => isStream(args[0]), (self, layer
|
|
|
6091
6167
|
* )
|
|
6092
6168
|
*
|
|
6093
6169
|
* const program = Effect.gen(function*() {
|
|
6094
|
-
* const result = yield* Stream.runCollect(Stream.
|
|
6170
|
+
* const result = yield* Stream.runCollect(Stream.provideContext(stream, context))
|
|
6095
6171
|
* yield* Console.log(result)
|
|
6096
6172
|
* })
|
|
6097
6173
|
*
|
|
@@ -6102,16 +6178,16 @@ export const provide = /*#__PURE__*/dual(args => isStream(args[0]), (self, layer
|
|
|
6102
6178
|
* @since 4.0.0
|
|
6103
6179
|
* @category Services
|
|
6104
6180
|
*/
|
|
6105
|
-
export const
|
|
6181
|
+
export const provideContext = /*#__PURE__*/dual(2, (self, context) => fromChannel(Channel.provideContext(self.channel, context)));
|
|
6106
6182
|
/**
|
|
6107
6183
|
* Provides the stream with a single required service, eliminating that
|
|
6108
6184
|
* requirement from its environment.
|
|
6109
6185
|
*
|
|
6110
6186
|
* @example
|
|
6111
6187
|
* ```ts
|
|
6112
|
-
* import { Console, Effect,
|
|
6188
|
+
* import { Console, Effect, Context, Stream } from "effect"
|
|
6113
6189
|
*
|
|
6114
|
-
* class Greeter extends
|
|
6190
|
+
* class Greeter extends Context.Service<Greeter, {
|
|
6115
6191
|
* greet: (name: string) => string
|
|
6116
6192
|
* }>()("Greeter") {}
|
|
6117
6193
|
*
|
|
@@ -6145,9 +6221,9 @@ export const provideService = /*#__PURE__*/dual(3, (self, key, service) => fromC
|
|
|
6145
6221
|
*
|
|
6146
6222
|
* @example
|
|
6147
6223
|
* ```ts
|
|
6148
|
-
* import { Console, Effect,
|
|
6224
|
+
* import { Console, Effect, Context, Stream } from "effect"
|
|
6149
6225
|
*
|
|
6150
|
-
* class ApiConfig extends
|
|
6226
|
+
* class ApiConfig extends Context.Service<ApiConfig, { readonly baseUrl: string }>()("ApiConfig") {}
|
|
6151
6227
|
*
|
|
6152
6228
|
* const stream = Stream.fromEffect(
|
|
6153
6229
|
* Effect.gen(function*() {
|
|
@@ -6180,15 +6256,15 @@ export const provideService = /*#__PURE__*/dual(3, (self, key, service) => fromC
|
|
|
6180
6256
|
*/
|
|
6181
6257
|
export const provideServiceEffect = /*#__PURE__*/dual(3, (self, key, service) => fromChannel(Channel.provideServiceEffect(self.channel, key, service)));
|
|
6182
6258
|
/**
|
|
6183
|
-
* Transforms the stream's required services by mapping the current
|
|
6259
|
+
* Transforms the stream's required services by mapping the current context
|
|
6184
6260
|
* to a new one.
|
|
6185
6261
|
*
|
|
6186
6262
|
* @example
|
|
6187
6263
|
* ```ts
|
|
6188
|
-
* import { Console, Effect,
|
|
6264
|
+
* import { Console, Effect, Context, Stream } from "effect"
|
|
6189
6265
|
*
|
|
6190
|
-
* class Logger extends
|
|
6191
|
-
* class Config extends
|
|
6266
|
+
* class Logger extends Context.Service<Logger, { prefix: string }>()("Logger") {}
|
|
6267
|
+
* class Config extends Context.Service<Config, { name: string }>()("Config") {}
|
|
6192
6268
|
*
|
|
6193
6269
|
* const stream = Stream.fromEffect(
|
|
6194
6270
|
* Effect.gen(function*() {
|
|
@@ -6199,8 +6275,8 @@ export const provideServiceEffect = /*#__PURE__*/dual(3, (self, key, service) =>
|
|
|
6199
6275
|
* )
|
|
6200
6276
|
*
|
|
6201
6277
|
* const updated = stream.pipe(
|
|
6202
|
-
* Stream.
|
|
6203
|
-
*
|
|
6278
|
+
* Stream.updateContext((context: Context.Context<Logger>) =>
|
|
6279
|
+
* Context.add(context, Config, { name: "World" })
|
|
6204
6280
|
* )
|
|
6205
6281
|
* )
|
|
6206
6282
|
*
|
|
@@ -6218,15 +6294,15 @@ export const provideServiceEffect = /*#__PURE__*/dual(3, (self, key, service) =>
|
|
|
6218
6294
|
* @since 2.0.0
|
|
6219
6295
|
* @category Services
|
|
6220
6296
|
*/
|
|
6221
|
-
export const
|
|
6297
|
+
export const updateContext = /*#__PURE__*/dual(2, (self, f) => fromChannel(Channel.updateContext(self.channel, f)));
|
|
6222
6298
|
/**
|
|
6223
6299
|
* Updates a single service in the stream environment by applying a function.
|
|
6224
6300
|
*
|
|
6225
6301
|
* @example
|
|
6226
6302
|
* ```ts
|
|
6227
|
-
* import { Console, Effect,
|
|
6303
|
+
* import { Console, Effect, Context, Stream } from "effect"
|
|
6228
6304
|
*
|
|
6229
|
-
* class Counter extends
|
|
6305
|
+
* class Counter extends Context.Service<Counter, { count: number }>()("Counter") {}
|
|
6230
6306
|
*
|
|
6231
6307
|
* const stream = Stream.fromEffect(Effect.service(Counter)).pipe(
|
|
6232
6308
|
* Stream.updateService(Counter, (counter) => ({ count: counter.count + 1 }))
|
|
@@ -6244,7 +6320,7 @@ export const updateServices = /*#__PURE__*/dual(2, (self, f) => fromChannel(Chan
|
|
|
6244
6320
|
* @since 2.0.0
|
|
6245
6321
|
* @category Services
|
|
6246
6322
|
*/
|
|
6247
|
-
export const updateService = /*#__PURE__*/dual(3, (self, service, f) =>
|
|
6323
|
+
export const updateService = /*#__PURE__*/dual(3, (self, service, f) => updateContext(self, context => Context.add(context, service, f(Context.get(context, service)))));
|
|
6248
6324
|
/**
|
|
6249
6325
|
* Wraps the stream with a new span for tracing.
|
|
6250
6326
|
*
|
|
@@ -6796,29 +6872,29 @@ export const mkUint8Array = self => Channel.runFold(self.channel, () => new Uint
|
|
|
6796
6872
|
*
|
|
6797
6873
|
* @example
|
|
6798
6874
|
* ```ts
|
|
6799
|
-
* import {
|
|
6875
|
+
* import { Context, Stream } from "effect"
|
|
6800
6876
|
*
|
|
6801
6877
|
* const stream = Stream.make(1, 2, 3, 4, 5)
|
|
6802
|
-
* const readableStream = Stream.toReadableStreamWith(stream,
|
|
6878
|
+
* const readableStream = Stream.toReadableStreamWith(stream, Context.empty())
|
|
6803
6879
|
* ```
|
|
6804
6880
|
*
|
|
6805
6881
|
* @since 2.0.0
|
|
6806
6882
|
* @category Destructors
|
|
6807
6883
|
*/
|
|
6808
|
-
export const toReadableStreamWith = /*#__PURE__*/dual(args => isStream(args[0]), (self,
|
|
6884
|
+
export const toReadableStreamWith = /*#__PURE__*/dual(args => isStream(args[0]), (self, context, options) => {
|
|
6809
6885
|
let currentResolve = undefined;
|
|
6810
6886
|
let fiber = undefined;
|
|
6811
6887
|
const latch = Latch.makeUnsafe(false);
|
|
6812
6888
|
return new ReadableStream({
|
|
6813
6889
|
start(controller) {
|
|
6814
|
-
fiber = Effect.runFork(Effect.
|
|
6890
|
+
fiber = Effect.runFork(Effect.provideContext(runForEachArray(self, chunk => latch.whenOpen(Effect.sync(() => {
|
|
6815
6891
|
latch.closeUnsafe();
|
|
6816
6892
|
for (let i = 0; i < chunk.length; i++) {
|
|
6817
6893
|
controller.enqueue(chunk[i]);
|
|
6818
6894
|
}
|
|
6819
6895
|
currentResolve();
|
|
6820
6896
|
currentResolve = undefined;
|
|
6821
|
-
}))),
|
|
6897
|
+
}))), context));
|
|
6822
6898
|
fiber.addObserver(exit => {
|
|
6823
6899
|
if (exit._tag === "Failure") {
|
|
6824
6900
|
controller.error(Cause.squash(exit.cause));
|
|
@@ -6855,7 +6931,7 @@ export const toReadableStreamWith = /*#__PURE__*/dual(args => isStream(args[0]),
|
|
|
6855
6931
|
* @since 2.0.0
|
|
6856
6932
|
* @category Destructors
|
|
6857
6933
|
*/
|
|
6858
|
-
export const toReadableStream = /*#__PURE__*/dual(args => isStream(args[0]), (self, options) => toReadableStreamWith(self,
|
|
6934
|
+
export const toReadableStream = /*#__PURE__*/dual(args => isStream(args[0]), (self, options) => toReadableStreamWith(self, Context.empty(), options));
|
|
6859
6935
|
/**
|
|
6860
6936
|
* Creates an Effect that builds a ReadableStream from the stream.
|
|
6861
6937
|
*
|
|
@@ -6878,16 +6954,16 @@ export const toReadableStream = /*#__PURE__*/dual(args => isStream(args[0]), (se
|
|
|
6878
6954
|
* @since 2.0.0
|
|
6879
6955
|
* @category Destructors
|
|
6880
6956
|
*/
|
|
6881
|
-
export const toReadableStreamEffect = /*#__PURE__*/dual(args => isStream(args[0]), (self, options) => Effect.map(Effect.
|
|
6957
|
+
export const toReadableStreamEffect = /*#__PURE__*/dual(args => isStream(args[0]), (self, options) => Effect.map(Effect.context(), context => toReadableStreamWith(self, context, options)));
|
|
6882
6958
|
/**
|
|
6883
6959
|
* Converts the stream to an `AsyncIterable` using the provided services.
|
|
6884
6960
|
*
|
|
6885
6961
|
* @example
|
|
6886
6962
|
* ```ts
|
|
6887
|
-
* import {
|
|
6963
|
+
* import { Context, Stream } from "effect"
|
|
6888
6964
|
*
|
|
6889
6965
|
* const stream = Stream.make(1, 2, 3)
|
|
6890
|
-
* const iterable = Stream.toAsyncIterableWith(stream,
|
|
6966
|
+
* const iterable = Stream.toAsyncIterableWith(stream, Context.empty())
|
|
6891
6967
|
*
|
|
6892
6968
|
* const collect = async () => {
|
|
6893
6969
|
* const results: Array<number> = []
|
|
@@ -6901,10 +6977,10 @@ export const toReadableStreamEffect = /*#__PURE__*/dual(args => isStream(args[0]
|
|
|
6901
6977
|
* @since 2.0.0
|
|
6902
6978
|
* @category Destructors
|
|
6903
6979
|
*/
|
|
6904
|
-
export const toAsyncIterableWith = /*#__PURE__*/dual(2, (self,
|
|
6980
|
+
export const toAsyncIterableWith = /*#__PURE__*/dual(2, (self, context) => ({
|
|
6905
6981
|
[Symbol.asyncIterator]() {
|
|
6906
|
-
const runPromise = Effect.runPromiseWith(
|
|
6907
|
-
const runPromiseExit = Effect.runPromiseExitWith(
|
|
6982
|
+
const runPromise = Effect.runPromiseWith(context);
|
|
6983
|
+
const runPromiseExit = Effect.runPromiseExitWith(context);
|
|
6908
6984
|
const scope = Scope.makeUnsafe();
|
|
6909
6985
|
let pull;
|
|
6910
6986
|
let currentIter;
|
|
@@ -6965,7 +7041,7 @@ export const toAsyncIterableWith = /*#__PURE__*/dual(2, (self, services) => ({
|
|
|
6965
7041
|
* @since 2.0.0
|
|
6966
7042
|
* @category Destructors
|
|
6967
7043
|
*/
|
|
6968
|
-
export const toAsyncIterableEffect = self => Effect.map(Effect.
|
|
7044
|
+
export const toAsyncIterableEffect = self => Effect.map(Effect.context(), context => toAsyncIterableWith(self, context));
|
|
6969
7045
|
/**
|
|
6970
7046
|
* Converts a stream to an `AsyncIterable` for `for await...of` consumption.
|
|
6971
7047
|
*
|
|
@@ -6991,7 +7067,7 @@ export const toAsyncIterableEffect = self => Effect.map(Effect.services(), servi
|
|
|
6991
7067
|
* @since 2.0.0
|
|
6992
7068
|
* @category Destructors
|
|
6993
7069
|
*/
|
|
6994
|
-
export const toAsyncIterable = self => toAsyncIterableWith(self,
|
|
7070
|
+
export const toAsyncIterable = self => toAsyncIterableWith(self, Context.empty());
|
|
6995
7071
|
/**
|
|
6996
7072
|
* Runs the stream, publishing elements into the provided PubSub.
|
|
6997
7073
|
*
|
|
@@ -7076,23 +7152,23 @@ export const toPubSub = /*#__PURE__*/dual(2, (self, options) => Channel.toPubSub
|
|
|
7076
7152
|
*/
|
|
7077
7153
|
export const toPubSubTake = /*#__PURE__*/dual(2, (self, options) => Channel.toPubSubTake(self.channel, options));
|
|
7078
7154
|
/**
|
|
7079
|
-
* Converts a stream to a
|
|
7155
|
+
* Converts a stream to a Queue for concurrent consumption.
|
|
7080
7156
|
*
|
|
7081
7157
|
* @example
|
|
7082
7158
|
* ```ts
|
|
7083
|
-
* import { Effect,
|
|
7159
|
+
* import { Effect, Queue, Stream } from "effect"
|
|
7084
7160
|
*
|
|
7085
7161
|
* const program = Effect.gen(function* () {
|
|
7086
|
-
* const
|
|
7087
|
-
* const
|
|
7088
|
-
* return
|
|
7162
|
+
* const queue = yield* Stream.toQueue(Stream.fromIterable([1, 2, 3]), { capacity: 8 })
|
|
7163
|
+
* const chunk = yield* Queue.takeBetween(queue, 1, 3)
|
|
7164
|
+
* return chunk
|
|
7089
7165
|
* })
|
|
7090
7166
|
* ```
|
|
7091
7167
|
*
|
|
7092
7168
|
* @since 2.0.0
|
|
7093
7169
|
* @category Destructors
|
|
7094
7170
|
*/
|
|
7095
|
-
export const toQueue = /*#__PURE__*/dual(2, (self, options) => Channel.
|
|
7171
|
+
export const toQueue = /*#__PURE__*/dual(2, (self, options) => Channel.toQueueArray(self.channel, options));
|
|
7096
7172
|
/**
|
|
7097
7173
|
* Runs the stream, offering each element to the provided queue and ending it
|
|
7098
7174
|
* with `Cause.Done` when the stream completes.
|